diff --git a/src/sp-use.cpp b/src/sp-use.cpp
index ae4e9f61a2c451e21f7413115cc073ecdd0cabfd..cd5f818356115b19588de9b10d4f9088561c025c 100644 (file)
--- a/src/sp-use.cpp
+++ b/src/sp-use.cpp
static void sp_use_modified(SPObject *object, guint flags);
static void sp_use_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsigned const flags);
static void sp_use_modified(SPObject *object, guint flags);
static void sp_use_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsigned const flags);
+static void sp_use_snappoints(SPItem const *item, SnapPointsIter p);
static void sp_use_print(SPItem *item, SPPrintContext *ctx);
static gchar *sp_use_description(SPItem *item);
static NRArenaItem *sp_use_show(SPItem *item, NRArena *arena, unsigned key, unsigned flags);
static void sp_use_print(SPItem *item, SPPrintContext *ctx);
static gchar *sp_use_description(SPItem *item);
static NRArenaItem *sp_use_show(SPItem *item, NRArena *arena, unsigned key, unsigned flags);
item_class->print = sp_use_print;
item_class->show = sp_use_show;
item_class->hide = sp_use_hide;
item_class->print = sp_use_print;
item_class->show = sp_use_show;
item_class->hide = sp_use_hide;
+ item_class->snappoints = sp_use_snappoints;
}
static void
}
static void
SPUse *use = SP_USE(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
SPUse *use = SP_USE(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- repr = sp_repr_new("svg:use");
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
+ repr = xml_doc->createElement("svg:use");
}
if (((SPObjectClass *) (parent_class))->write) {
}
if (((SPObjectClass *) (parent_class))->write) {
Inkscape::XML::Node *parent = sp_repr_parent(repr);
SPDocument *document = SP_OBJECT(use)->document;
Inkscape::XML::Node *parent = sp_repr_parent(repr);
SPDocument *document = SP_OBJECT(use)->document;
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(document);
// Track the ultimate source of a chain of uses.
SPItem *orig = sp_use_root(use);
// Track the ultimate source of a chain of uses.
SPItem *orig = sp_use_root(use);
Inkscape::XML::Node *copy = NULL;
if (SP_IS_SYMBOL(orig)) { // make a group, copy children
Inkscape::XML::Node *copy = NULL;
if (SP_IS_SYMBOL(orig)) { // make a group, copy children
- copy = sp_repr_new("svg:g");
+ copy = xml_doc->createElement("svg:g");
for (Inkscape::XML::Node *child = SP_OBJECT_REPR(orig)->firstChild() ; child != NULL; child = child->next()) {
for (Inkscape::XML::Node *child = SP_OBJECT_REPR(orig)->firstChild() ; child != NULL; child = child->next()) {
- Inkscape::XML::Node *newchild = child->duplicate();
+ Inkscape::XML::Node *newchild = child->duplicate(xml_doc);
copy->appendChild(newchild);
}
} else { // just copy
copy->appendChild(newchild);
}
} else { // just copy
- copy = SP_OBJECT_REPR(orig)->duplicate();
+ copy = SP_OBJECT_REPR(orig)->duplicate(xml_doc);
}
// Add the duplicate repr just after the existing one.
}
// Add the duplicate repr just after the existing one.
return ref;
}
return ref;
}
+static void
+sp_use_snappoints(SPItem const *item, SnapPointsIter p)
+{
+ g_assert (item != NULL);
+ g_assert (SP_IS_ITEM(item));
+ g_assert (SP_IS_USE(item));
+
+ SPUse *use = SP_USE(item);
+ SPItem *root = sp_use_root(use);
+
+ SPItemClass const &item_class = *(SPItemClass const *) G_OBJECT_GET_CLASS(root);
+ if (item_class.snappoints) {
+ item_class.snappoints(root, p);
+ }
+}
+
/*
Local Variables:
/*
Local Variables: