Code

noop: dialogs/rdf.cpp: Mark a few pointers as not being written through. Make rdf_ma...
[inkscape.git] / src / dialogs / xml-tree.cpp
index 3402e72b5cc0a0b147a55c794b1734771d26f14f..dd5371460f7c21a552f5a3f58a1f147f709bb002 100644 (file)
@@ -1368,8 +1368,9 @@ void cmd_new_element_node(GtkObject *object, gpointer data)
     g_assert(selected_repr != NULL);
 
     if (name.text) {
+        Inkscape::XML::Document *xml_doc = sp_document_repr_doc(current_document);
         Inkscape::XML::Node *new_repr;
-        new_repr = sp_repr_new(name.text);
+        new_repr = xml_doc->createElement(name.text);
         g_free(name.text);
         selected_repr->appendChild(new_repr);
         set_tree_select(new_repr);
@@ -1387,7 +1388,8 @@ void cmd_new_text_node(GtkObject *object, gpointer data)
 {
     g_assert(selected_repr != NULL);
 
-    Inkscape::XML::Node *text = sp_repr_new_text("");
+    Inkscape::XML::Document *xml_doc = sp_document_repr_doc(current_document);
+    Inkscape::XML::Node *text = xml_doc->createTextNode("");
     selected_repr->appendChild(text);
 
     sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
@@ -1405,7 +1407,7 @@ void cmd_duplicate_node(GtkObject *object, gpointer data)
     g_assert(selected_repr != NULL);
 
     Inkscape::XML::Node *parent = sp_repr_parent(selected_repr);
-    Inkscape::XML::Node *dup = selected_repr->duplicate();
+    Inkscape::XML::Node *dup = selected_repr->duplicate(parent->document());
     parent->addChild(dup, selected_repr);
 
     sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,