Alfredo Braunstein wrote:
Alfredo Braunstein wrote:
Abdelrazak Younes wrote:
Nope... unfortunately. I am sure this is a metrics problem actually.
Hum... "I am _not_ sure..."
Actually that's what I've read for some reason ;-) I would nevertheless
like to commit the patch, as valgrind tells that otherwise the wide_inset_
value is used before initialized. This wide stuff is really bad...
I did a bit of research, and I think I found something, and it seems
a mess. Please correct me if I'm wrong, this is what I understand:
Text::dispatch(LFUN_FLOAT_INSERT) calls dispatches
Cursor::dispatch(LFUN_CAPTION_INSERT) to insert the CAPTION.
One possible general problem with this may be that Cursor::dispatch is not
reentrant-safe (see beforeDispatch members).
I've looked at it more closely and you're right. We should either use
the local Text::dispatch() method or make sure the savings of
beforeDispX and beforeDispY happen before Cursor::dispatch():
// store some values to be used inside of the handlers
getPos(beforeDispX_, beforeDispY_);
For trunk, I think we should replace all occurence of
cur.dispatch() with this->dispatch() in Text3::dispatch().
For BRANCH_1_5 I think the simpler solution is to move the getPos() call
above at the beginning of the LFUN machinery: LyXFunc::dispatch().
The real problem in this case
seems to be that the dispatch machinery assumes up-to-date metrics
(Cursor::dispatch calls getPos), whereas in this case the Collapsable was
already inserted and the metrics still not updated.
I'll commit a hot fix shortly.
Abdel.