summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8871aad)
raw | patch | inline | side by side (parent: 8871aad)
author | acspike <acspike@users.sourceforge.net> | |
Mon, 22 Jan 2007 03:26:44 +0000 (03:26 +0000) | ||
committer | acspike <acspike@users.sourceforge.net> | |
Mon, 22 Jan 2007 03:26:44 +0000 (03:26 +0000) |
index 16c6d0eb9fe15df4047e5d7f000d5aa7b8d3ea2f..5d8c9a82d005c058418d7595139c3ac725e2a760 100644 (file)
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 7f44fb55393515b79e10fed4191105c061427491..b9fde9350f6b705cde69c5c487fdf9126ac26c58 100644 (file)
}
}
+ 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);
} 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);
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);
diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp
index 51bc4c511be61d872c5966115971feb75669c883..3981aa9ba4874fbd7daff7abc69055ec2ecba0ba 100644 (file)
--- a/src/sp-flowregion.cpp
+++ b/src/sp-flowregion.cpp
#include "sp-text.h"
#include "sp-use.h"
#include "style.h"
+#include "document.h"
#include "sp-flowregion.h"
sp_flowregion_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
if (flags & SP_OBJECT_WRITE_BUILD) {
- if ( repr == NULL ) repr = sp_repr_new ("svg:flowRegion");
+ if ( repr == NULL ) {
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
+ repr = xml_doc->createElement("svg:flowRegion");
+ }
GSList *l = NULL;
for ( SPObject *child = sp_object_first_child(object) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
sp_flowregionexclude_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
if (flags & SP_OBJECT_WRITE_BUILD) {
- if ( repr == NULL ) repr = sp_repr_new ("svg:flowRegionExclude");
+ if ( repr == NULL ) {
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
+ repr = xml_doc->createElement("svg:flowRegionExclude");
+ }
GSList *l = NULL;
for ( SPObject *child = sp_object_first_child(object) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp
index 5cbf68fff2eea21c878dbf1b6b1ce534c9cf8e4f..bb94425c5beccbe8dbc88fc2966f86c1aae78704 100644 (file)
--- a/src/sp-item-group.cpp
+++ b/src/sp-item-group.cpp
if (flags & SP_OBJECT_WRITE_BUILD) {
GSList *l;
- if (!repr) repr = sp_repr_new ("svg:g");
+ if (!repr) {
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
+ repr = xml_doc->createElement("svg:g");
+ }
l = NULL;
for (child = sp_object_first_child(object); child != NULL; child = SP_OBJECT_NEXT(child) ) {
crepr = child->updateRepr(NULL, flags);
index ec698592f5f6b2c6430b3ee05a0dcebadcbfb5be..5674f44b2be7addbefca579a732040d49ee9f688 100644 (file)
--- a/src/sp-object-group.cpp
+++ b/src/sp-object-group.cpp
#include "sp-object-group.h"
#include "xml/repr.h"
+#include "document.h"
static void sp_objectgroup_class_init (SPObjectGroupClass *klass);
static void sp_objectgroup_init (SPObjectGroup *objectgroup);
@@ -107,7 +108,10 @@ sp_objectgroup_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
if (flags & SP_OBJECT_WRITE_BUILD) {
GSList *l;
- if (!repr) repr = sp_repr_new ("svg:g");
+ if (!repr) {
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
+ repr = xml_doc->createElement("svg:g");
+ }
l = NULL;
for ( child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
crepr = child->updateRepr(NULL, flags);
diff --git a/src/sp-polyline.cpp b/src/sp-polyline.cpp
index 54a38ccd1178f6ae97b2b8313a868ab82f5dd4aa..33f3286f96e61580ad6e8a54d884dffdca8430e6 100644 (file)
--- a/src/sp-polyline.cpp
+++ b/src/sp-polyline.cpp
#include "display/curve.h"
#include <glibmm/i18n.h>
#include "xml/repr.h"
+#include "document.h"
static void sp_polyline_class_init (SPPolyLineClass *klass);
static void sp_polyline_init (SPPolyLine *polyline);
polyline = SP_POLYLINE (object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- repr = sp_repr_new ("svg:polyline");
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
+ repr = xml_doc->createElement("svg:polyline");
}
if (repr != SP_OBJECT_REPR (object)) {
diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp
index edcea21a24cd757af5bfb77e28a2474ae9d61e37..6823f21229dca2aa254e9c291881538aeabe6593 100644 (file)
--- a/src/sp-rect.cpp
+++ b/src/sp-rect.cpp
#include <libnr/nr-matrix-div.h>
#include <libnr/nr-matrix-fns.h>
+#include "document.h"
#include "attributes.h"
#include "style.h"
#include "sp-rect.h"
SPRect *rect = SP_RECT(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- repr = sp_repr_new("svg:rect");
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
+ repr = xml_doc->createElement("svg:rect");
}
sp_repr_set_svg_double(repr, "width", rect->width.computed);
diff --git a/src/sp-star.cpp b/src/sp-star.cpp
index 2f3dcd6c1f23bf6e5767cbf65609f3d8d078e98c..ea25250541faadfa83d718b8079c9ae629d6ef6b 100644 (file)
--- a/src/sp-star.cpp
+++ b/src/sp-star.cpp
#include "attributes.h"
#include "display/curve.h"
#include "xml/repr.h"
+#include "document.h"
#include "sp-star.h"
SPStar *star = SP_STAR (object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- repr = sp_repr_new ("svg:path");
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
+ repr = xml_doc->createElement("svg:path");
}
if (flags & SP_OBJECT_WRITE_EXT) {
diff --git a/src/sp-symbol.cpp b/src/sp-symbol.cpp
index a7b0312e96b694e35c48a6b829eda5712456fd20..5dbbe4e415ca4d9ab1a8bc704e294d03780e8b0c 100644 (file)
--- a/src/sp-symbol.cpp
+++ b/src/sp-symbol.cpp
#include "attributes.h"
#include "print.h"
#include "sp-symbol.h"
+#include "document.h"
static void sp_symbol_class_init (SPSymbolClass *klass);
static void sp_symbol_init (SPSymbol *symbol);
symbol = SP_SYMBOL (object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- repr = sp_repr_new ("svg:symbol");
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
+ repr = xml_doc->createElement("svg:symbol");
}
repr->setAttribute("viewBox", object->repr->attribute("viewBox"));
index 3177700c3601c9f35f127b3c12960bafa97428f4..68d69f3f9b5a7c96e4056e36185f6a3907b1dce0 100644 (file)
#include <gtk/gtkmenuitem.h>
#include <gtk/gtktooltips.h>
+#include "document.h"
#include "../document-private.h"
#include "../gradient-chemistry.h"
@@ -312,14 +313,15 @@ sp_gradient_selector_add_vector_clicked (GtkWidget *w, SPGradientSelector *sel)
if (gr) {
repr = SP_OBJECT_REPR (gr)->duplicate();
} else {
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc);
Inkscape::XML::Node *stop;
- repr = sp_repr_new ("svg:linearGradient");
- stop = sp_repr_new ("svg:stop");
+ repr = xml_doc->createElement("svg:linearGradient");
+ stop = xml_doc->createElement("svg:stop");
stop->setAttribute("offset", "0");
stop->setAttribute("style", "stop-color:#000;stop-opacity:1;");
repr->appendChild(stop);
Inkscape::GC::release(stop);
- stop = sp_repr_new ("svg:stop");
+ stop = xml_doc->createElement("svg:stop");
stop->setAttribute("offset", "1");
stop->setAttribute("style", "stop-color:#fff;stop-opacity:1;");
repr->appendChild(stop);