diff options
Diffstat (limited to 'libs/pbd/undo.cc')
-rw-r--r-- | libs/pbd/undo.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/libs/pbd/undo.cc b/libs/pbd/undo.cc index a5ca6b713a..8d1b416c16 100644 --- a/libs/pbd/undo.cc +++ b/libs/pbd/undo.cc @@ -22,6 +22,7 @@ #include <pbd/undo.h> #include <pbd/xml++.h> +#include <string> using namespace std; using namespace sigc; @@ -86,7 +87,11 @@ UndoTransaction::redo () XMLNode &UndoTransaction::get_state() { XMLNode *node = new XMLNode ("UndoTransaction"); - // TODO + + list<Command*>::iterator it; + for (it=actions.begin(); it!=actions.end(); it++) + node->add_child_nocopy((*it)->get_state()); + return *node; } @@ -142,3 +147,14 @@ UndoHistory::clear () RedoList.clear (); UndoList.clear (); } + +XMLNode & UndoHistory::get_state() +{ + XMLNode *node = new XMLNode ("UndoHistory"); + + list<UndoTransaction>::iterator it; + for (it=UndoList.begin(); it != UndoList.end(); it++) + node->add_child_nocopy(it->get_state()); + + return *node; +} |