From: acspike Date: Sun, 21 Jan 2007 20:15:12 +0000 (+0000) Subject: continue switching sp_repr_new* over to XML::Document::create* X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=89c06dcb4fdcf35ccb3c97548a8924393c709778;p=inkscape.git continue switching sp_repr_new* over to XML::Document::create* --- 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 #include #include +#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)) {