diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp
index 99d22edc745ee4b68b9e09e771ebe1c93c2b7412..cbb157c3dc24099c4945742ec66cdd6becae8e9f 100644 (file)
--- a/src/path-chemistry.cpp
+++ b/src/path-chemistry.cpp
#include "text-editing.h"
#include "style.h"
#include "inkscape.h"
+#include "desktop.h"
#include "document.h"
#include "message-stack.h"
#include "selection.h"
g_slist_free(items);
- 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");
// restore id
repr->setAttribute("id", id);
for (GSList *l = list; l != NULL; l = l->next) {
curve = (SPCurve *) l->data;
- Inkscape::XML::Node *repr = sp_repr_new("svg:path");
+ Inkscape::XML::Node *repr = parent->document()->createElement("svg:path");
repr->setAttribute("style", style);
gchar *str = sp_svg_write_path(SP_CURVE_BPATH(curve));
selection->remove(item);
- // it's going to resurrect, so we delete without advertisement
+ // It's going to resurrect, so we delete without notifying listeners.
SP_OBJECT(item)->deleteObject(false);
// restore id
// move to the saved position
repr->setPosition(pos > 0 ? pos : 0);
+ /* Buglet: We don't re-add the (new version of the) object to the selection of any other
+ * desktops where it was previously selected. */
selection->add(repr);
Inkscape::GC::release(repr);
}
if (!curve)
return NULL;
- Inkscape::XML::Node *repr = sp_repr_new("svg:path");
+ Inkscape::XML::Document *xml_doc = SP_OBJECT_REPR(item)->document();
+ Inkscape::XML::Node *repr = xml_doc->createElement("svg:path");
/* Transformation */
repr->setAttribute("transform", SP_OBJECT_REPR(item)->attribute("transform"));
/* Style */