]> git.lyx.org Git - features.git/commitdiff
Text::setCursor(): make sure an update is asked if the current cursor is not visible.
authorAbdelrazak Younes <younes@lyx.org>
Fri, 22 Feb 2008 12:27:56 +0000 (12:27 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Fri, 22 Feb 2008 12:27:56 +0000 (12:27 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23128 a592a061-630c-0410-9148-cb99ea01b6c8

src/Text2.cpp

index a4f78271a4d834ed5ff2d20e37dbb4331e666b30..fff739ed47a37419a504372e2d654ec9c1aae773 100644 (file)
@@ -525,9 +525,11 @@ void Text::insertStringAsParagraphs(Cursor & cur, docstring const & str)
 bool Text::setCursor(Cursor & cur, pit_type par, pos_type pos,
                        bool setfont, bool boundary)
 {
+       TextMetrics const & tm = cur.bv().textMetrics(this);
+       bool const update_needed = !tm.has(par);
        Cursor old = cur;
        setCursorIntern(cur, par, pos, setfont, boundary);
-       return cur.bv().checkDepm(cur, old);
+       return cur.bv().checkDepm(cur, old) || update_needed;
 }