From 63731301866e7b9cb231a43658a7c51ec2d70690 Mon Sep 17 00:00:00 2001 From: MenTaLguY Date: Sun, 21 Jan 2007 19:03:03 +0000 Subject: start switching sp_repr_new* over to XML::Document::create*, and rename create methods to match DOM (bzr r2253) --- src/ui/context-menu.cpp | 5 ++++- src/ui/widget/ruler.cpp | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/ui') diff --git a/src/ui/context-menu.cpp b/src/ui/context-menu.cpp index a96e1589d..b701adc2b 100644 --- a/src/ui/context-menu.cpp +++ b/src/ui/context-menu.cpp @@ -15,6 +15,8 @@ #include "context-menu.h" #include "../xml/repr.h" +#include "desktop.h" +#include "document.h" static void sp_object_type_menu(GType type, SPObject *object, SPDesktop *desktop, GtkMenu *menu); @@ -158,7 +160,8 @@ sp_item_create_link(GtkMenuItem *menuitem, SPItem *item) SPDesktop *desktop = (SPDesktop*)gtk_object_get_data(GTK_OBJECT(menuitem), "desktop"); g_return_if_fail(desktop != NULL); - Inkscape::XML::Node *repr = sp_repr_new("svg:a"); + Inkscape::XML::Document *xml_doc = sp_document_repr_doc(desktop->doc()); + Inkscape::XML::Node *repr = xml_doc->createElement("svg:a"); SP_OBJECT_REPR(SP_OBJECT_PARENT(item))->addChild(repr, SP_OBJECT_REPR(item)); SPObject *object = SP_OBJECT_DOCUMENT(item)->getObjectByRepr(repr); g_return_if_fail(SP_IS_ANCHOR(object)); diff --git a/src/ui/widget/ruler.cpp b/src/ui/widget/ruler.cpp index 30a1761bd..681b1dbbc 100644 --- a/src/ui/widget/ruler.cpp +++ b/src/ui/widget/ruler.cpp @@ -147,7 +147,8 @@ Ruler::on_button_release_event(GdkEventButton *evb) _dragging = false; if ( (_horiz_f ? wy : wx ) >= 0 ) { - Inkscape::XML::Node *repr = sp_repr_new("sodipodi:guide"); + Inkscape::XML::Document *xml_doc = sp_document_repr_doc(_dt->doc()); + Inkscape::XML::Node *repr = xml_doc->createElement("sodipodi:guide"); repr->setAttribute("orientation", _horiz_f ? "horizontal" : "vertical"); double const guide_pos_dt = event_dt[ _horiz_f ? NR::Y : NR::X ]; sp_repr_set_svg_double(repr, "position", guide_pos_dt); -- cgit v1.2.3