#include "pbd/property_basics.h"
#include "pbd/property_list.h"
#include "pbd/stateful_diff_command.h"
+#include "pbd/error.h"
namespace PBD {
/** Get a representation of one of our items as XML. The representation must be sufficient to
* restore the item's state later; an ID is ok if someone else is storing the item state,
- * otherwise it needs to be the full state. The supplied node is an <Add> or <Remove>
+ * otherwise it needs to be the full state. The supplied node is an \<Add\> or \<Remove\>
* which this method can either add properties or children to.
*/
virtual void get_content_as_xml (typename ChangeContainer::value_type, XMLNode &) const = 0;
for (XMLNodeList::const_iterator j = grandchildren.begin(); j != grandchildren.end(); ++j) {
typename Container::value_type v = get_content_from_xml (**j);
- assert (v);
-
- if ((*j)->name() == "Add") {
+
+ 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);
return p;
}
- /** Given an <Add> or <Remove> node as passed into get_content_to_xml, obtain an item */
+ /** Given an \<Add\> or \<Remove\> node as passed into get_content_to_xml, obtain an item */
virtual typename Container::value_type get_content_from_xml (XMLNode const & node) const = 0;
void clear_owned_changes () {
}
}
- Container rlist() { return _val; }
+ Container rlist() const { return _val; }
/* Wrap salient methods of Sequence
*/