]> git.lyx.org Git - features.git/commitdiff
fix bug 2155: crash when undoing dEPM
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 4 Jan 2006 14:24:40 +0000 (14:24 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 4 Jan 2006 14:24:40 +0000 (14:24 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10707 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/text2.C

index 018768bfd4221e8b11b650284608f794b3f750ac..426f9923afd59e252889d42bd626e8939fbb22e4 100644 (file)
@@ -1,3 +1,8 @@
+2006-01-04  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * text2.C (deleteEmptyParagraphMechanism): since we delete a
+       paragraph, recordUndo should span two paragraphs (bug 2155).
+
 2006-01-01  Martin Vermeer  <martin.vermeer@hut.fi>
 
        * rowpainter.C (paintPar): always repaint the row with the
index 0032efbfb372b2010b72edb60d45da0d4b800c44..27c17921a23f79069954d75d81757cf41f333ba6 100644 (file)
@@ -1234,7 +1234,8 @@ bool LyXText::deleteEmptyParagraphMechanism(LCursor & cur, LCursor & old)
 
        if (oldpar.empty() || (oldpar.size() == 1 && oldpar.isLineSeparator(0))) {
                // Delete old par.
-               recordUndo(old, Undo::ATOMIC, old.pit());
+               recordUndo(old, Undo::ATOMIC, 
+                          old.pit(), min(old.pit() + 1, old.lastpit()));
                ParagraphList & plist = old.text()->paragraphs();
                plist.erase(plist.begin() + old.pit());