X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fsp-object-group.cpp;h=1d5c0433974a67fdccfd647864aa3886e2920e07;hb=ae5f81d1dccb2f382e3a548b95c1220485c667ec;hp=ec698592f5f6b2c6430b3ee05a0dcebadcbfb5be;hpb=6b15695578f07a3f72c4c9475c1a261a3021472a;p=inkscape.git diff --git a/src/sp-object-group.cpp b/src/sp-object-group.cpp index ec698592f..1d5c04339 100644 --- a/src/sp-object-group.cpp +++ b/src/sp-object-group.cpp @@ -14,6 +14,7 @@ #include "sp-object-group.h" #include "xml/repr.h" +#include "document.h" static void sp_objectgroup_class_init (SPObjectGroupClass *klass); static void sp_objectgroup_init (SPObjectGroup *objectgroup); @@ -21,7 +22,7 @@ static void sp_objectgroup_init (SPObjectGroup *objectgroup); static void sp_objectgroup_child_added (SPObject * object, Inkscape::XML::Node * child, Inkscape::XML::Node * ref); static void sp_objectgroup_remove_child (SPObject * object, Inkscape::XML::Node * child); static void sp_objectgroup_order_changed (SPObject * object, Inkscape::XML::Node * child, Inkscape::XML::Node * old_ref, Inkscape::XML::Node * new_ref); -static Inkscape::XML::Node *sp_objectgroup_write (SPObject *object, Inkscape::XML::Node *repr, guint flags); +static Inkscape::XML::Node *sp_objectgroup_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); static SPObjectClass *parent_class; @@ -65,7 +66,7 @@ sp_objectgroup_class_init (SPObjectGroupClass *klass) } static void -sp_objectgroup_init (SPObjectGroup *objectgroup) +sp_objectgroup_init (SPObjectGroup */*objectgroup*/) { } @@ -97,7 +98,7 @@ sp_objectgroup_order_changed (SPObject *object, Inkscape::XML::Node *child, Inks } static Inkscape::XML::Node * -sp_objectgroup_write (SPObject *object, Inkscape::XML::Node *repr, guint flags) +sp_objectgroup_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { SPObjectGroup *group; SPObject *child; @@ -107,10 +108,12 @@ sp_objectgroup_write (SPObject *object, Inkscape::XML::Node *repr, guint flags) if (flags & SP_OBJECT_WRITE_BUILD) { GSList *l; - if (!repr) repr = sp_repr_new ("svg:g"); + if (!repr) { + repr = xml_doc->createElement("svg:g"); + } l = NULL; for ( child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) { - crepr = child->updateRepr(NULL, flags); + crepr = child->updateRepr(xml_doc, NULL, flags); if (crepr) l = g_slist_prepend (l, crepr); } while (l) { @@ -125,7 +128,7 @@ sp_objectgroup_write (SPObject *object, Inkscape::XML::Node *repr, guint flags) } if (((SPObjectClass *) (parent_class))->write) - ((SPObjectClass *) (parent_class))->write (object, repr, flags); + ((SPObjectClass *) (parent_class))->write (object, xml_doc, repr, flags); return repr; }