mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Do this check before we start creating things.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25525 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
2b70ed0204
commit
aee1d2b0f7
19
src/Undo.cpp
19
src/Undo.cpp
@ -227,23 +227,26 @@ void Undo::Private::doRecordUndo(UndoKind kind,
|
||||
{
|
||||
if (first_pit > last_pit)
|
||||
swap(first_pit, last_pit);
|
||||
// create the position information of the Undo entry
|
||||
UndoElement undo(kind, cur, cell, first_pit, cell.lastpit() - last_pit, 0, 0,
|
||||
buffer_.params(), isFullBuffer);
|
||||
UndoElementStack & stack = isUndoOperation ? undostack_ : redostack_;
|
||||
|
||||
// Undo::ATOMIC are always recorded (no overlapping there).
|
||||
// As nobody wants all removed character appear one by one when undoing,
|
||||
// we want combine 'similar' non-ATOMIC undo recordings to one.
|
||||
pit_type from = first_pit;
|
||||
pit_type end = cell.lastpit() - last_pit;
|
||||
UndoElementStack & stack = isUndoOperation ? undostack_ : redostack_;
|
||||
if (!undo_finished_
|
||||
&& kind != ATOMIC_UNDO
|
||||
&& !stack.empty()
|
||||
&& samePar(stack.top().cell, undo.cell)
|
||||
&& stack.top().kind == undo.kind
|
||||
&& stack.top().from == undo.from
|
||||
&& stack.top().end == undo.end)
|
||||
&& samePar(stack.top().cell, cell)
|
||||
&& stack.top().kind == kind
|
||||
&& stack.top().from == from
|
||||
&& stack.top().end == end)
|
||||
return;
|
||||
|
||||
// create the position information of the Undo entry
|
||||
UndoElement undo(kind, cur, cell, from, end, 0, 0,
|
||||
buffer_.params(), isFullBuffer);
|
||||
|
||||
// fill in the real data to be saved
|
||||
if (cell.inMathed()) {
|
||||
// simply use the whole cell
|
||||
|
Loading…
Reference in New Issue
Block a user