]> git.lyx.org Git - features.git/commitdiff
fix bug 1998
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Mon, 5 Sep 2005 06:50:42 +0000 (06:50 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Mon, 5 Sep 2005 06:50:42 +0000 (06:50 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10410 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/text2.C

index 262e49ad7430ebc56da1df48e9847a6a241f4cc0..ac32700ded36d0d197c63f63b3f5ef455a5dbb54 100644 (file)
@@ -1,3 +1,7 @@
+2005-08-26  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
+
+       * text2.C (cursorEnd): check for empty text (fixes bug 1998)
+
 2005-08-19  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * CutAndPaste.C (eraseSelectionHelper): fix bug 1920
index b4b3b2d61dc14c6465d11ce1e5d6b2290a28190f..87795a7eec40c03d226ff8af4452ee528da33cb7 100644 (file)
@@ -494,6 +494,9 @@ void LyXText::cursorEnd(LCursor & cur)
        // the final space exept if I have a spanning inset or one string
        // is so long that we force a break.
        pos_type end = cur.textRow().endpos();
+       if (end == 0)
+               // empty text, end-1 is no valid position
+               return;
        bool boundary = false;
        if (!cur.paragraph().isLineSeparator(end-1) &&
            !cur.paragraph().isNewline(end-1))