From 6b9415aedb35d03561ef16d846f08bc0fc7c57c7 Mon Sep 17 00:00:00 2001 From: nick_m Date: Fri, 6 Feb 2015 21:54:27 +1100 Subject: 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. --- libs/pbd/undo.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libs/pbd/undo.cc') 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::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 */ -- cgit v1.2.3