From c8acdbb7c5bb3f79f895cc7d762284589bf44ac7 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Mon, 5 Sep 2005 06:50:42 +0000 Subject: [PATCH] fix bug 1998 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10410 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 4 ++++ src/text2.C | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 262e49ad74..ac32700ded 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2005-08-26 Georg Baum + + * text2.C (cursorEnd): check for empty text (fixes bug 1998) + 2005-08-19 Lars Gullik Bjønnes * CutAndPaste.C (eraseSelectionHelper): fix bug 1920 diff --git a/src/text2.C b/src/text2.C index b4b3b2d61d..87795a7eec 100644 --- a/src/text2.C +++ b/src/text2.C @@ -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)) -- 2.39.2