- if (cmd) {
- /* whenever one of the items emits DropReferences, make sure
- that the Destructible we've been told to notify hears about
- it. the Destructible is likely to be the Command being built
- with this diff().
- */
-
- for (typename ChangeContainer::iterator i = a->change().added.begin(); i != a->change().added.end(); ++i) {
- (*i)->DropReferences.connect_same_thread (*cmd, boost::bind (&Destructible::drop_references, cmd));
- }
- }
-
- undo.add (b);
- redo.add (a);
+ /* find the node for this property name */
+
+ std::string const c = capitalize (property_name ());
+ XMLNodeList::const_iterator i = children.begin();
+ while (i != children.end() && (*i)->name() != c) {
+ ++i;
+ }
+
+ if (i == children.end()) {
+ return 0;
+ }
+
+ /* create a property with the changes */
+
+ SequenceProperty<Container>* p = create ();
+
+ XMLNodeList const & grandchildren = (*i)->children ();
+ for (XMLNodeList::const_iterator j = grandchildren.begin(); j != grandchildren.end(); ++j) {
+
+ typename Container::value_type v = get_content_from_xml (**j);
+
+ if (!v) {
+ warning << "undo transaction references an unknown object" << endmsg;
+ } else if ((*j)->name() == "Add") {
+ p->_changes.added.insert (v);
+ } else if ((*j)->name() == "Remove") {
+ p->_changes.removed.insert (v);
+ }