diff options
Diffstat (limited to 'libs/pbd/stateful_diff_command.cc')
-rw-r--r-- | libs/pbd/stateful_diff_command.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/libs/pbd/stateful_diff_command.cc b/libs/pbd/stateful_diff_command.cc index 788a5be034..1332cae4ff 100644 --- a/libs/pbd/stateful_diff_command.cc +++ b/libs/pbd/stateful_diff_command.cc @@ -18,6 +18,7 @@ */ #include "pbd/stateful_diff_command.h" +#include "i18n.h" using namespace std; using namespace PBD; @@ -35,6 +36,13 @@ StatefulDiffCommand::StatefulDiffCommand (Stateful* s) _after = p.second; } +StatefulDiffCommand::StatefulDiffCommand (Stateful* s, XMLNode const & n) + : _object (s) +{ + _before = new XMLNode (*n.children().front()); + _after = new XMLNode (*n.children().back()); +} + StatefulDiffCommand::~StatefulDiffCommand () { @@ -57,5 +65,12 @@ StatefulDiffCommand::undo () XMLNode& StatefulDiffCommand::get_state () { - /* XXX */ + XMLNode* node = new XMLNode (X_("StatefulDiffCommand")); + + node->add_property ("obj-id", _object->id().to_s()); + node->add_property ("type-name", typeid(*_object).name()); + node->add_child_copy (*_before); + node->add_child_copy (*_after); + + return *node; } |