From c9e4d86b4c9183bdd059fd77efc2be6beea6ca7d Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sun, 13 Mar 2011 16:41:47 +0000 Subject: [PATCH] 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 --- src/frontends/qt4/GuiWorkArea.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index 61a40a0f37..880706eb36 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -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 p = up ? tm.first() : tm.last(); ParagraphMetrics const & pm = *p.second; -- 2.39.2