From 63731301866e7b9cb231a43658a7c51ec2d70690 Mon Sep 17 00:00:00 2001 From: MenTaLguY Date: Sun, 21 Jan 2007 19:03:03 +0000 Subject: start switching sp_repr_new* over to XML::Document::create*, and rename create methods to match DOM (bzr r2253) --- src/sp-use.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/sp-use.cpp') diff --git a/src/sp-use.cpp b/src/sp-use.cpp index ae4e9f61a..5b2ed9e23 100644 --- a/src/sp-use.cpp +++ b/src/sp-use.cpp @@ -241,7 +241,8 @@ sp_use_write(SPObject *object, Inkscape::XML::Node *repr, guint flags) SPUse *use = SP_USE(object); if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) { - repr = sp_repr_new("svg:use"); + Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object)); + repr = xml_doc->createElement("svg:use"); } if (((SPObjectClass *) (parent_class))->write) { @@ -652,6 +653,7 @@ sp_use_unlink(SPUse *use) Inkscape::XML::Node *parent = sp_repr_parent(repr); SPDocument *document = SP_OBJECT(use)->document; + Inkscape::XML::Document *xml_doc = sp_document_repr_doc(document); // Track the ultimate source of a chain of uses. SPItem *orig = sp_use_root(use); @@ -661,7 +663,7 @@ sp_use_unlink(SPUse *use) Inkscape::XML::Node *copy = NULL; if (SP_IS_SYMBOL(orig)) { // make a group, copy children - copy = sp_repr_new("svg:g"); + copy = xml_doc->createElement("svg:g"); for (Inkscape::XML::Node *child = SP_OBJECT_REPR(orig)->firstChild() ; child != NULL; child = child->next()) { Inkscape::XML::Node *newchild = child->duplicate(); copy->appendChild(newchild); -- cgit v1.2.3