summaryrefslogtreecommitdiffstats
path: root/src/extension/internal
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
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')
-rw-r--r--src/extension/internal/bluredge.cpp3
-rw-r--r--src/extension/internal/gdkpixbuf-input.cpp9
2 files changed, 7 insertions, 5 deletions
diff --git a/src/extension/internal/bluredge.cpp b/src/extension/internal/bluredge.cpp
index 16c6d0eb9..5d8c9a82d 100644
--- a/src/extension/internal/bluredge.cpp
+++ b/src/extension/internal/bluredge.cpp
@@ -71,7 +71,8 @@ BlurEdge::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View
SPItem * spitem = *item;
std::vector<Inkscape::XML::Node *> new_items(steps);
- Inkscape::XML::Node * new_group = sp_repr_new("svg:g");
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(document->doc());
+ Inkscape::XML::Node * new_group = xml_doc->createElement("svg:g");
(SP_OBJECT_REPR(spitem)->parent())->appendChild(new_group);
double orig_opacity = sp_repr_css_double_property(sp_repr_css_attr(SP_OBJECT_REPR(spitem), "style"), "opacity", 1.0);
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);