Jean-Marc Lasgouttes wrote:
"Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes:
Abdelrazak> Hi, This crash was due to an invalid CursorSlice::text()
Abdelrazak> null pointer accessed in InsetMathNest::cursorPos():
Abdelrazak> CoordCache & coord_cache =
Abdelrazak> sl.text()->bv()->coordCache();
Abdelrazak> As you can see, I used this indirection to access the
Abdelrazak> BufferView::CoordCache(). Bad luck, the passed CursorSlice
Abdelrazak> was not completely valid inside a mathed inset, hence the
Abdelrazak> crash. My solution is to pass BufferView to
Abdelrazak> InsetBase::cursorPos() and all its derivative.
I still think that using a cursor would be better in this case. The
API change
-Point coordOffset(DocIterator const & dit, bool boundary)
+Point coordOffset(BufferView const & bv, constDocIterator const & dit,
+ bool boundary)
makes it clear that there is a problem.
Andre', Abdel, could you tell me again what would be wrong with using
a cursor here?
Nothing wrong per see. But Andre (and I think I agree with him) thinks
that we should decorrelate the model and the view. Passing a BufferView
(the view) and a DocIterator (the model independent from the view) make
explicit the fact that we need both in this function. Passing Cursor
would hide that fact.
Abdel.