summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAaron Spike <aaron@ekips.org>2007-01-21 20:15:12 +0000
committeracspike <acspike@users.sourceforge.net>2007-01-21 20:15:12 +0000
commite54ee5ffc36f2264f83a9b7493089cd0aa3cd527 (patch)
treec19da83f8b764ed7d94d81334f6877546e19a2fe /src
parentstart switching sp_repr_new* over to XML::Document::create*, and rename creat... (diff)
downloadinkscape-e54ee5ffc36f2264f83a9b7493089cd0aa3cd527.tar.gz
inkscape-e54ee5ffc36f2264f83a9b7493089cd0aa3cd527.zip
continue switching sp_repr_new* over to XML::Document::create*
(bzr r2254)
Diffstat (limited to 'src')
-rw-r--r--src/arc-context.cpp3
-rw-r--r--src/dyna-draw-context.cpp3
-rw-r--r--src/extension/internal/grid.cpp3
-rw-r--r--src/layer-fns.cpp3
-rw-r--r--src/sp-anchor.cpp4
-rw-r--r--src/sp-line.cpp4
6 files changed, 14 insertions, 6 deletions
diff --git a/src/arc-context.cpp b/src/arc-context.cpp
index c0f8dd75c..c682677a6 100644
--- a/src/arc-context.cpp
+++ b/src/arc-context.cpp
@@ -395,7 +395,8 @@ static void sp_arc_drag(SPArcContext *ac, NR::Point pt, guint state)
}
/* Create object */
- Inkscape::XML::Node *repr = sp_repr_new("svg:path");
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(desktop->doc());
+ Inkscape::XML::Node *repr = xml_doc->createElement("svg:path");
repr->setAttribute("sodipodi:type", "arc");
/* Set style */
diff --git a/src/dyna-draw-context.cpp b/src/dyna-draw-context.cpp
index 7285f7b37..5c60eeb41 100644
--- a/src/dyna-draw-context.cpp
+++ b/src/dyna-draw-context.cpp
@@ -662,7 +662,8 @@ set_to_accumulated(SPDynaDrawContext *dc)
if (!dc->repr) {
/* Create object */
- Inkscape::XML::Node *repr = sp_repr_new("svg:path");
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(desktop->doc());
+ Inkscape::XML::Node *repr = xml_doc->createElement("svg:path");
/* Set style */
sp_desktop_apply_style_tool (desktop, repr, "tools.calligraphic", false);
diff --git a/src/extension/internal/grid.cpp b/src/extension/internal/grid.cpp
index b9d626f78..05c6bc4c9 100644
--- a/src/extension/internal/grid.cpp
+++ b/src/extension/internal/grid.cpp
@@ -130,8 +130,9 @@ Grid::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View *doc
// std::cout << "Path Data: " << path_data << std::endl;
+ Inkscape::XML::Document * xml_doc = sp_document_repr_doc(document->doc());
Inkscape::XML::Node * current_layer = ((SPDesktop *)document)->currentLayer()->repr;
- Inkscape::XML::Node * path = sp_repr_new("svg:path");
+ Inkscape::XML::Node * path = xml_doc->createElement("svg:path");
path->setAttribute("d", path_data.c_str());
diff --git a/src/layer-fns.cpp b/src/layer-fns.cpp
index 2d58796af..75bb89bcf 100644
--- a/src/layer-fns.cpp
+++ b/src/layer-fns.cpp
@@ -174,7 +174,8 @@ SPObject *create_layer(SPObject *root, SPObject *layer, LayerRelativePosition po
id = g_strdup_printf("layer%d", layer_suffix++);
} while (document->getObjectById(id));
- Inkscape::XML::Node *repr=sp_repr_new("svg:g");
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(document);
+ Inkscape::XML::Node *repr = xml_doc->createElement("svg:g");
repr->setAttribute("inkscape:groupmode", "layer");
repr->setAttribute("id", id);
g_free(id);
diff --git a/src/sp-anchor.cpp b/src/sp-anchor.cpp
index 4b93f7cf0..e16836957 100644
--- a/src/sp-anchor.cpp
+++ b/src/sp-anchor.cpp
@@ -24,6 +24,7 @@
#include "attributes.h"
#include "sp-anchor.h"
#include "ui/view/view.h"
+#include "document.h"
static void sp_anchor_class_init(SPAnchorClass *ac);
static void sp_anchor_init(SPAnchor *anchor);
@@ -147,7 +148,8 @@ static Inkscape::XML::Node *sp_anchor_write(SPObject *object, Inkscape::XML::Nod
SPAnchor *anchor = SP_ANCHOR(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- repr = sp_repr_new("svg:a");
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
+ repr = xml_doc->createElement("svg:a");
}
repr->setAttribute("xlink:href", anchor->href);
diff --git a/src/sp-line.cpp b/src/sp-line.cpp
index cca470530..f63dfd323 100644
--- a/src/sp-line.cpp
+++ b/src/sp-line.cpp
@@ -21,6 +21,7 @@
#include <glibmm/i18n.h>
#include <libnr/nr-matrix-fns.h>
#include <xml/repr.h>
+#include "document.h"
static void sp_line_class_init (SPLineClass *klass);
static void sp_line_init (SPLine *line);
@@ -163,7 +164,8 @@ sp_line_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
SPLine *line = SP_LINE (object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- repr = sp_repr_new ("svg:line");
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
+ repr = xml_doc->createElement("svg:line");
}
if (repr != SP_OBJECT_REPR (object)) {