diff options
| author | MenTaLguY <mental@rydia.net> | 2007-01-21 19:03:03 +0000 |
|---|---|---|
| committer | mental <mental@users.sourceforge.net> | 2007-01-21 19:03:03 +0000 |
| commit | 63731301866e7b9cb231a43658a7c51ec2d70690 (patch) | |
| tree | 91b475a32308003e60e40ac0f318dc00be019a6e /src/sp-use.cpp | |
| parent | Deprecate sp_repr_new* functions (diff) | |
| download | inkscape-63731301866e7b9cb231a43658a7c51ec2d70690.tar.gz inkscape-63731301866e7b9cb231a43658a7c51ec2d70690.zip | |
start switching sp_repr_new* over to XML::Document::create*, and rename create methods to match DOM
(bzr r2253)
Diffstat (limited to 'src/sp-use.cpp')
| -rw-r--r-- | src/sp-use.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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); |
