13
0

Make undo/redo work for:

undo (n) where n > 1
redo (m) where m < n
new transaction.

Previously the redo list was left untouched.
This would lead to utter nonsense in the redo list.

AFAICT this never worked.
This commit is contained in:
nick_m 2015-02-06 21:54:27 +11:00
parent ec37c83507
commit 6b9415aedb

View File

@ -220,6 +220,13 @@ UndoHistory::add (UndoTransaction* const ut)
}
UndoList.push_back (ut);
/* Adding a transacrion means that redo is meaningless from this point. */
_clearing = true;
for (std::list<UndoTransaction*>::iterator i = RedoList.begin(); i != RedoList.end(); ++i) {
delete *i;
}
RedoList.clear ();
_clearing = false;
/* we are now owners of the transaction and must delete it when finished with it */