summaryrefslogtreecommitdiffstats
path: root/src/extension/internal/gdkpixbuf-input.cpp
diff options
context:
space:
mode:
authorAaron Spike <aaron@ekips.org>2007-01-22 03:26:44 +0000
committeracspike <acspike@users.sourceforge.net>2007-01-22 03:26:44 +0000
commit1497d669b9d07989ca22ccac02424d4e0f4e8889 (patch)
tree33db56b6a87a3d32b2fb727aed090cfd81694371 /src/extension/internal/gdkpixbuf-input.cpp
parentrefactor grid extension to reduce amount of redundant code (diff)
downloadinkscape-1497d669b9d07989ca22ccac02424d4e0f4e8889.tar.gz
inkscape-1497d669b9d07989ca22ccac02424d4e0f4e8889.zip
continue switching sp_repr_new* over to XML::Document::create*
(bzr r2257)
Diffstat (limited to 'src/extension/internal/gdkpixbuf-input.cpp')
-rw-r--r--src/extension/internal/gdkpixbuf-input.cpp9
1 files changed, 5 insertions, 4 deletions
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 <image>
- 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);