From: Michael Schmitt Date: Thu, 25 Jan 2007 22:51:00 +0000 (+0000) Subject: * src/text2.C: deleteEmptyParagraphMechanism(): fix a crash in X-Git-Tag: 1.6.10~11059 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=89b422b320a352e503c0625820da1073805d74a9;p=lyx.git * src/text2.C: deleteEmptyParagraphMechanism(): fix a crash in LyXText::acceptOrRejectChanges() caused by too aggressive deletion git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16860 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/text2.C b/src/text2.C index bc9980e1de..4b905d6f6f 100644 --- a/src/text2.C +++ b/src/text2.C @@ -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