mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 12:32:26 +00:00
* src/text.C: first step to sanitize accept/rejectChange
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16520 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
95643e2450
commit
895416b103
40
src/text.C
40
src/text.C
@ -862,16 +862,22 @@ void LyXText::acceptChange(LCursor & cur)
|
|||||||
pos_type right = (pit == et.pit() ? et.pos() : pars_[pit].size());
|
pos_type right = (pit == et.pit() ? et.pos() : pars_[pit].size());
|
||||||
pars_[pit].acceptChanges(left, right);
|
pars_[pit].acceptChanges(left, right);
|
||||||
|
|
||||||
// merge paragraph if appropriate:
|
// handle imaginary end-of-par character
|
||||||
// if (right >= pars_[pit].size() && pit + 1 < et.pit() &&
|
if (right == pars_[pit].size() && !pars_[pit].isUnchanged(right)) {
|
||||||
// pars_[pit].isDeleted(pars_[pit].size())) {
|
if (pars_[pit].isInserted(right)) {
|
||||||
// setCursorIntern(cur, pit + 1, 0);
|
pars_[pit].setChange(right, Change(Change::UNCHANGED));
|
||||||
// backspacePos0(cur);
|
} else {
|
||||||
//}
|
// if (pit + 1 < et.pit()) {
|
||||||
|
// setCursorIntern(cur, pit + 1, 0);
|
||||||
|
// backspacePos0(cur);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
finishUndo();
|
finishUndo();
|
||||||
cur.clearSelection();
|
cur.clearSelection();
|
||||||
setCursorIntern(cur, it.pit(), 0);
|
setCursorIntern(cur, it.pit(), it.pos());
|
||||||
|
cur.updateFlags(Update::Force);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -896,16 +902,22 @@ void LyXText::rejectChange(LCursor & cur)
|
|||||||
pos_type right = (pit == et.pit() ? et.pos() : pars_[pit].size());
|
pos_type right = (pit == et.pit() ? et.pos() : pars_[pit].size());
|
||||||
pars_[pit].rejectChanges(left, right);
|
pars_[pit].rejectChanges(left, right);
|
||||||
|
|
||||||
// merge paragraph if appropriate:
|
// handle imaginary end-of-par character
|
||||||
// if (right >= pars_[pit].size() && pit + 1 < et.pit() &&
|
if (right == pars_[pit].size() && !pars_[pit].isUnchanged(right)) {
|
||||||
// pars_[pit].isInserted(pars_[pit].size())) {
|
if (pars_[pit].isDeleted(right)) {
|
||||||
// setCursorIntern(cur, pit + 1, 0);
|
pars_[pit].setChange(right, Change(Change::UNCHANGED));
|
||||||
// backspacePos0(cur);
|
} else {
|
||||||
//}
|
// if (pit + 1 < et.pit()) {
|
||||||
|
// setCursorIntern(cur, pit + 1, 0);
|
||||||
|
// backspacePos0(cur);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
finishUndo();
|
finishUndo();
|
||||||
cur.clearSelection();
|
cur.clearSelection();
|
||||||
setCursorIntern(cur, it.pit(), 0);
|
setCursorIntern(cur, it.pit(), it.pos());
|
||||||
|
cur.updateFlags(Update::Force);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user