* 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
This commit is contained in:
Michael Schmitt 2007-01-04 23:10:51 +00:00
parent 895416b103
commit 1cdbdc1bdc

View File

@ -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();