diff options
author | nick_m <mainsbridge@gmail.com> | 2015-02-06 21:54:27 +1100 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2015-02-06 21:54:27 +1100 |
commit | 6b9415aedb35d03561ef16d846f08bc0fc7c57c7 (patch) | |
tree | a00c8a23c9528451c8e5d2ffedd761074335174c | |
parent | ec37c835074e0218b1cf216d4099e18fa77dcdbc (diff) |
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.
-rw-r--r-- | libs/pbd/undo.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/pbd/undo.cc b/libs/pbd/undo.cc index 42f7d574ea..2da9c7214d 100644 --- a/libs/pbd/undo.cc +++ b/libs/pbd/undo.cc @@ -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 */ |