From 1497d669b9d07989ca22ccac02424d4e0f4e8889 Mon Sep 17 00:00:00 2001 From: Aaron Spike Date: Mon, 22 Jan 2007 03:26:44 +0000 Subject: continue switching sp_repr_new* over to XML::Document::create* (bzr r2257) --- src/extension/internal/gdkpixbuf-input.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/extension/internal/gdkpixbuf-input.cpp') diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp index 7f44fb553..b9fde9350 100644 --- a/src/extension/internal/gdkpixbuf-input.cpp +++ b/src/extension/internal/gdkpixbuf-input.cpp @@ -54,9 +54,10 @@ GdkpixbufInput::open(Inkscape::Extension::Input *mod, char const *uri) } } + Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); if (prefs_get_int_attribute("options.importbitmapsasimages", "value", 1) == 1) { // import as - repr = sp_repr_new("svg:image"); + repr = xml_doc->createElement("svg:image"); repr->setAttribute("xlink:href", relname); repr->setAttribute("sodipodi:absref", uri); @@ -65,7 +66,7 @@ GdkpixbufInput::open(Inkscape::Extension::Input *mod, char const *uri) } else { // import as pattern-filled rect - Inkscape::XML::Node *pat = sp_repr_new("svg:pattern"); + Inkscape::XML::Node *pat = xml_doc->createElement("svg:pattern"); pat->setAttribute("inkscape:collect", "always"); pat->setAttribute("patternUnits", "userSpaceOnUse"); sp_repr_set_svg_double(pat, "width", width); @@ -74,14 +75,14 @@ GdkpixbufInput::open(Inkscape::Extension::Input *mod, char const *uri) gchar const *pat_id = pat->attribute("id"); SPObject *pat_object = doc->getObjectById(pat_id); - Inkscape::XML::Node *im = sp_repr_new("svg:image"); + Inkscape::XML::Node *im = xml_doc->createElement("svg:image"); im->setAttribute("xlink:href", relname); im->setAttribute("sodipodi:absref", uri); sp_repr_set_svg_double(im, "width", width); sp_repr_set_svg_double(im, "height", height); SP_OBJECT_REPR(pat_object)->addChild(im, NULL); - repr = sp_repr_new("svg:rect"); + repr = xml_doc->createElement("svg:rect"); repr->setAttribute("style", g_strdup_printf("stroke:none;fill:url(#%s)", pat_id)); sp_repr_set_svg_double(repr, "width", width); sp_repr_set_svg_double(repr, "height", height); -- cgit v1.2.3