]> git.lyx.org Git - lyx.git/commitdiff
* src/text2.C: deleteEmptyParagraphMechanism(): fix a crash in
authorMichael Schmitt <michael.schmitt@teststep.org>
Thu, 25 Jan 2007 22:51:00 +0000 (22:51 +0000)
committerMichael Schmitt <michael.schmitt@teststep.org>
Thu, 25 Jan 2007 22:51:00 +0000 (22:51 +0000)
LyXText::acceptOrRejectChanges() caused by too aggressive deletion

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16860 a592a061-630c-0410-9148-cb99ea01b6c8

src/text2.C

index bc9980e1de429b57eb62b06e2425280339b576c0..4b905d6f6f71f5813dfcb2ff82cb2bf88e96e5bc 100644 (file)
@@ -1264,8 +1264,9 @@ void LyXText::deleteEmptyParagraphMechanism(pit_type first, pit_type last, bool
                        }
                }
 
-               // don't delete anything if this is the ONLY paragraph
-               if (pars_.size() == 1)
+               // don't delete anything if this is the only remaining paragraph within the given range
+               // note: LyXText::acceptOrRejectChanges() sets the cursor to 'first' after calling DEPM 
+               if (first == last)
                        continue;
 
                // don't delete empty paragraphs with keepempty set