X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fpbd%2Fundo.cc;h=88b3c4ead5b0b2b40f3e1eae7606a44cf45e4e9c;hb=76036ae0f369ea76aaa47bb43e41af450114f190;hp=2da9c7214d78084d905894c3e85a6ff897880ed9;hpb=6b9415aedb35d03561ef16d846f08bc0fc7c57c7;p=ardour.git diff --git a/libs/pbd/undo.cc b/libs/pbd/undo.cc index 2da9c7214d..88b3c4ead5 100644 --- a/libs/pbd/undo.cc +++ b/libs/pbd/undo.cc @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 2001 Brett Viren & Paul Davis This program is free software; you can redistribute it and/or modify @@ -51,7 +51,7 @@ UndoTransaction::~UndoTransaction () clear (); } -void +void command_death (UndoTransaction* ut, Command* c) { if (ut->clearing()) { @@ -65,7 +65,7 @@ command_death (UndoTransaction* ut, Command* c) } } -UndoTransaction& +UndoTransaction& UndoTransaction::operator= (const UndoTransaction& rhs) { if (this == &rhs) return *this; @@ -135,13 +135,9 @@ UndoTransaction::redo () XMLNode &UndoTransaction::get_state() { XMLNode *node = new XMLNode ("UndoTransaction"); - stringstream ss; - ss << _timestamp.tv_sec; - node->add_property("tv_sec", ss.str()); - ss.str(""); - ss << _timestamp.tv_usec; - node->add_property("tv_usec", ss.str()); - node->add_property("name", _name); + node->set_property("tv-sec", (int64_t)_timestamp.tv_sec); + node->set_property("tv-usec", (int64_t)_timestamp.tv_usec); + node->set_property("name", _name); list::iterator it; for (it=actions.begin(); it!=actions.end(); it++) @@ -152,12 +148,12 @@ XMLNode &UndoTransaction::get_state() class UndoRedoSignaller { public: - UndoRedoSignaller (UndoHistory& uh) - : _history (uh) { - _history.BeginUndoRedo(); + UndoRedoSignaller (UndoHistory& uh) + : _history (uh) { + _history.BeginUndoRedo(); } - ~UndoRedoSignaller() { - _history.EndUndoRedo(); + ~UndoRedoSignaller() { + _history.EndUndoRedo(); } private: @@ -220,7 +216,7 @@ UndoHistory::add (UndoTransaction* const ut) } UndoList.push_back (ut); - /* Adding a transacrion means that redo is meaningless from this point. */ + /* Adding a transacrion makes the redo list meaningless. */ _clearing = true; for (std::list::iterator i = RedoList.begin(); i != RedoList.end(); ++i) { delete *i; @@ -282,7 +278,7 @@ UndoHistory::redo (unsigned int n) { UndoRedoSignaller exception_safe_signaller (*this); - + while (n--) { if (RedoList.size() == 0) { return; @@ -333,7 +329,7 @@ UndoHistory::clear () Changed (); /* EMIT SIGNAL */ } -XMLNode& +XMLNode& UndoHistory::get_state (int32_t depth) { XMLNode *node = new XMLNode ("UndoHistory");