From d25a9a072143eafa4a9823b84e977c4b85d45efe Mon Sep 17 00:00:00 2001 From: Abhishek Sharma Public Date: Fri, 2 Jul 2010 18:05:42 +0530 Subject: New Class SPDocumentUndo created which takes care of c++fying some non SPDocument based methods (bzr r9546.1.3) --- src/dialogs/xml-tree.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/dialogs/xml-tree.cpp') diff --git a/src/dialogs/xml-tree.cpp b/src/dialogs/xml-tree.cpp index c8644fef9..515b49360 100644 --- a/src/dialogs/xml-tree.cpp +++ b/src/dialogs/xml-tree.cpp @@ -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); -- cgit v1.2.3