diff options
author | Robin Gareus <robin@gareus.org> | 2020-02-28 06:08:26 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-02-28 06:08:26 +0100 |
commit | 016eaddad72a369022d1f7f29ecbbbed17bef3f5 (patch) | |
tree | b633b21f9815eec0c69d0b9b4df2a1e872304e4b /libs/pbd | |
parent | 4b28e4ee3ce622683b0c967d715116fb84441cc3 (diff) |
NO-OP: whitespace, re-indent
Diffstat (limited to 'libs/pbd')
-rw-r--r-- | libs/pbd/pbd/stateful_diff_command.h | 11 | ||||
-rw-r--r-- | libs/pbd/stateful_diff_command.cc | 60 |
2 files changed, 35 insertions, 36 deletions
diff --git a/libs/pbd/pbd/stateful_diff_command.h b/libs/pbd/pbd/stateful_diff_command.h index 61c5940ed9..ccf1ae69ef 100644 --- a/libs/pbd/pbd/stateful_diff_command.h +++ b/libs/pbd/pbd/stateful_diff_command.h @@ -23,12 +23,11 @@ #include <boost/shared_ptr.hpp> #include <boost/weak_ptr.hpp> -#include "pbd/libpbd_visibility.h" #include "pbd/command.h" +#include "pbd/libpbd_visibility.h" namespace PBD { - class StatefulDestructible; class PropertyList; @@ -39,7 +38,7 @@ class LIBPBD_API StatefulDiffCommand : public Command { public: StatefulDiffCommand (boost::shared_ptr<StatefulDestructible>); - StatefulDiffCommand (boost::shared_ptr<StatefulDestructible>, XMLNode const &); + StatefulDiffCommand (boost::shared_ptr<StatefulDestructible>, XMLNode const&); ~StatefulDiffCommand (); void operator() (); @@ -50,10 +49,10 @@ public: bool empty () const; private: - boost::weak_ptr<Stateful> _object; ///< the object in question - PBD::PropertyList* _changes; ///< property changes to execute this command + boost::weak_ptr<Stateful> _object; ///< the object in question + PBD::PropertyList* _changes; ///< property changes to execute this command }; -}; +}; // namespace PBD #endif /* __pbd_stateful_diff_command_h__ */ 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 (); } |