From 1cdbdc1bdc3d2f10ac875d6e4e771202caa5694a Mon Sep 17 00:00:00 2001 From: Michael Schmitt Date: Thu, 4 Jan 2007 23:10:51 +0000 Subject: [PATCH] * src/text.C: check end-of-par BEFORE you accept/reject the rest of the par (I fear this code has to rewritten later) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16521 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/text.C | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/text.C b/src/text.C index 437701acf3..83eef76405 100644 --- a/src/text.C +++ b/src/text.C @@ -860,9 +860,8 @@ void LyXText::acceptChange(LCursor & cur) for (; pit <= et.pit(); ++pit) { pos_type left = (pit == it.pit() ? it.pos() : 0); pos_type right = (pit == et.pit() ? et.pos() : pars_[pit].size()); - pars_[pit].acceptChanges(left, right); - // handle imaginary end-of-par character + // handle imaginary end-of-par character first if (right == pars_[pit].size() && !pars_[pit].isUnchanged(right)) { if (pars_[pit].isInserted(right)) { pars_[pit].setChange(right, Change(Change::UNCHANGED)); @@ -873,6 +872,8 @@ void LyXText::acceptChange(LCursor & cur) // } } } + + pars_[pit].acceptChanges(left, right); } finishUndo(); cur.clearSelection(); @@ -900,9 +901,8 @@ void LyXText::rejectChange(LCursor & cur) for (; pit <= et.pit(); ++pit) { pos_type left = (pit == it.pit() ? it.pos() : 0); pos_type right = (pit == et.pit() ? et.pos() : pars_[pit].size()); - pars_[pit].rejectChanges(left, right); - // handle imaginary end-of-par character + // handle imaginary end-of-par character first if (right == pars_[pit].size() && !pars_[pit].isUnchanged(right)) { if (pars_[pit].isDeleted(right)) { pars_[pit].setChange(right, Change(Change::UNCHANGED)); @@ -913,6 +913,8 @@ void LyXText::rejectChange(LCursor & cur) // } } } + + pars_[pit].rejectChanges(left, right); } finishUndo(); cur.clearSelection();