summaryrefslogtreecommitdiff
path: root/libs/pbd/stateful_diff_command.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-02-28 06:08:26 +0100
committerRobin Gareus <robin@gareus.org>2020-02-28 06:08:26 +0100
commit016eaddad72a369022d1f7f29ecbbbed17bef3f5 (patch)
treeb633b21f9815eec0c69d0b9b4df2a1e872304e4b /libs/pbd/stateful_diff_command.cc
parent4b28e4ee3ce622683b0c967d715116fb84441cc3 (diff)
NO-OP: whitespace, re-indent
Diffstat (limited to 'libs/pbd/stateful_diff_command.cc')
-rw-r--r--libs/pbd/stateful_diff_command.cc60
1 files changed, 30 insertions, 30 deletions
diff --git a/libs/pbd/stateful_diff_command.cc b/libs/pbd/stateful_diff_command.cc
index 48ea675179..b42edcb80b 100644
--- a/libs/pbd/stateful_diff_command.cc
+++ b/libs/pbd/stateful_diff_command.cc
@@ -19,10 +19,10 @@
*/
#include "pbd/stateful_diff_command.h"
-#include "pbd/types_convert.h"
-#include "pbd/property_list.h"
#include "pbd/demangle.h"
#include "pbd/i18n.h"
+#include "pbd/property_list.h"
+#include "pbd/types_convert.h"
using namespace std;
using namespace PBD;
@@ -33,86 +33,86 @@ using namespace PBD;
*/
StatefulDiffCommand::StatefulDiffCommand (boost::shared_ptr<StatefulDestructible> s)
- : _object (s)
- , _changes (0)
+ : _object (s)
+ , _changes (0)
{
_changes = s->get_changes_as_properties (this);
- /* if the stateful object that this command refers to goes away,
+ /* if the stateful object that this command refers to goes away,
be sure to notify owners of this command.
*/
- s->DropReferences.connect_same_thread (*this, boost::bind (&Destructible::drop_references, this));
+ s->DropReferences.connect_same_thread (*this, boost::bind (&Destructible::drop_references, this));
}
-StatefulDiffCommand::StatefulDiffCommand (boost::shared_ptr<StatefulDestructible> s, XMLNode const & n)
+StatefulDiffCommand::StatefulDiffCommand (boost::shared_ptr<StatefulDestructible> s, XMLNode const& n)
: _object (s)
- , _changes (0)
+ , _changes (0)
{
- const XMLNodeList& children (n.children());
+ const XMLNodeList& children (n.children ());
- for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) {
- if ((*i)->name() == X_("Changes")) {
- _changes = s->property_factory (**i);
- }
+ for (XMLNodeList::const_iterator i = children.begin (); i != children.end (); ++i) {
+ if ((*i)->name () == X_ ("Changes")) {
+ _changes = s->property_factory (**i);
+ }
}
- assert (_changes != 0);
+ assert (_changes != 0);
- /* if the stateful object that this command refers to goes away,
+ /* if the stateful object that this command refers to goes away,
be sure to notify owners of this command.
*/
- s->DropReferences.connect_same_thread (*this, boost::bind (&Destructible::drop_references, this));
+ s->DropReferences.connect_same_thread (*this, boost::bind (&Destructible::drop_references, this));
}
StatefulDiffCommand::~StatefulDiffCommand ()
{
- delete _changes;
+ delete _changes;
}
void
StatefulDiffCommand::operator() ()
{
- boost::shared_ptr<Stateful> s (_object.lock());
+ boost::shared_ptr<Stateful> s (_object.lock ());
if (s) {
- s->apply_changes (*_changes);
+ s->apply_changes (*_changes);
}
}
void
StatefulDiffCommand::undo ()
{
- boost::shared_ptr<Stateful> s (_object.lock());
+ boost::shared_ptr<Stateful> s (_object.lock ());
if (s) {
PropertyList p = *_changes;
p.invert ();
- s->apply_changes (p);
+ s->apply_changes (p);
}
}
XMLNode&
StatefulDiffCommand::get_state ()
{
- boost::shared_ptr<Stateful> s (_object.lock());
+ boost::shared_ptr<Stateful> s (_object.lock ());
if (!s) {
/* XXX should we throw? */
- return * new XMLNode("");
+ return *new XMLNode ("");
}
- XMLNode* node = new XMLNode (X_("StatefulDiffCommand"));
+ XMLNode* node = new XMLNode (X_ ("StatefulDiffCommand"));
- node->set_property ("obj-id", s->id());
- node->set_property ("type-name", demangled_name (*s.get()));
+ node->set_property ("obj-id", s->id ());
+ node->set_property ("type-name", demangled_name (*s.get ()));
- XMLNode* changes = new XMLNode (X_("Changes"));
+ XMLNode* changes = new XMLNode (X_ ("Changes"));
- _changes->get_changes_as_xml (changes);
+ _changes->get_changes_as_xml (changes);
- node->add_child_nocopy (*changes);
+ node->add_child_nocopy (*changes);
return *node;
}
@@ -120,5 +120,5 @@ StatefulDiffCommand::get_state ()
bool
StatefulDiffCommand::empty () const
{
- return _changes->empty();
+ return _changes->empty ();
}