Code

New Class SPDocumentUndo created which takes care of c++fying some non SPDocument...
[inkscape.git] / src / dialogs / xml-tree.cpp
index c8644fef962ef2b3af6adddb79be4791f2d50f19..515b49360d20f1705764328647d8d57632cfe857 100644 (file)
@@ -870,10 +870,10 @@ void after_tree_move(GtkCTree */*tree*/,
     if (GTK_CTREE_ROW(node)->parent  == new_parent &&
         GTK_CTREE_ROW(node)->sibling == new_sibling)
     {
-        sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+        SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
                          _("Drag XML subtree"));
     } else {
-        sp_document_cancel(current_document);
+        SPDocumentUndo::cancel(current_document);
     }
 }
 
@@ -1371,7 +1371,7 @@ void cmd_new_element_node(GtkObject */*object*/, gpointer /*data*/)
         set_tree_select(new_repr);
         set_dt_select(new_repr);
 
-        sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+        SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
                      _("Create new element node"));
     }
 
@@ -1387,7 +1387,7 @@ void cmd_new_text_node(GtkObject */*object*/, gpointer /*data*/)
     Inkscape::XML::Node *text = xml_doc->createTextNode("");
     selected_repr->appendChild(text);
 
-    sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+    SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
                      _("Create new text node"));
 
     set_tree_select(text);
@@ -1405,7 +1405,7 @@ void cmd_duplicate_node(GtkObject */*object*/, gpointer /*data*/)
     Inkscape::XML::Node *dup = selected_repr->duplicate(parent->document());
     parent->addChild(dup, selected_repr);
 
-    sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+    SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
                      _("Duplicate node"));
 
     GtkCTreeNode *node = sp_xmlview_tree_get_repr_node(SP_XMLVIEW_TREE(tree), dup);
@@ -1422,7 +1422,7 @@ void cmd_delete_node(GtkObject */*object*/, gpointer /*data*/)
     g_assert(selected_repr != NULL);
     sp_repr_unparent(selected_repr);
 
-    sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+    SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
                      Q_("nodeAsInXMLinHistoryDialog|Delete node"));
 }
 
@@ -1440,7 +1440,7 @@ void cmd_delete_attr(GtkObject */*object*/, gpointer /*data*/)
         updated->updateRepr();
     }
 
-    sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+    SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
                      _("Delete attribute"));
 }
 
@@ -1469,7 +1469,7 @@ void cmd_set_attr(GtkObject */*object*/, gpointer /*data*/)
         updated->updateRepr();
     }
 
-    sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+    SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
                      _("Change attribute"));
 
     /* TODO: actually, the row won't have been created yet.  why? */
@@ -1499,7 +1499,7 @@ void cmd_raise_node(GtkObject */*object*/, gpointer /*data*/)
 
     parent->changeOrder(selected_repr, ref);
 
-    sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+    SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
                      _("Raise node"));
 
     set_tree_select(selected_repr);
@@ -1516,7 +1516,7 @@ void cmd_lower_node(GtkObject */*object*/, gpointer /*data*/)
 
     parent->changeOrder(selected_repr, selected_repr->next());
 
-    sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+    SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
                      _("Lower node"));
 
     set_tree_select(selected_repr);
@@ -1546,7 +1546,7 @@ void cmd_indent_node(GtkObject */*object*/, gpointer /*data*/)
     parent->removeChild(repr);
     prev->addChild(repr, ref);
 
-    sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+    SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
                      _("Indent node"));
     set_tree_select(repr);
     set_dt_select(repr);
@@ -1567,7 +1567,7 @@ void cmd_unindent_node(GtkObject */*object*/, gpointer /*data*/)
     parent->removeChild(repr);
     grandparent->addChild(repr, parent);
 
-    sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+    SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
                      _("Unindent node"));
     set_tree_select(repr);
     set_dt_select(repr);