Temporally fix #7321 until a better solution is found. The auto scrolling is very bad but at least it does not crash nor assert.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37916 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2011-03-13 16:41:47 +00:00
parent 8d06c1ebda
commit c9e4d86b4c

View File

@ -943,9 +943,11 @@ void GuiWorkArea::generateSyntheticMouseEvent()
// In which paragraph do we have to set the cursor ?
Cursor & cur = buffer_view_->cursor();
// FIXME: we use innerText() because we only know how to handle text.
// so this will not work nicely inside big equation.
TextMetrics const & tm = buffer_view_->textMetrics(cur.innerText());
// FIXME: we don't know howto handle math.
Text * text = cur.text();
if (!text)
return;
TextMetrics const & tm = buffer_view_->textMetrics(text);
pair<pit_type, const ParagraphMetrics *> p = up ? tm.first() : tm.last();
ParagraphMetrics const & pm = *p.second;