diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp
index 5c01483c8f36ed762eb3bbba59eeeb13f02e8740..3981aa9ba4874fbd7daff7abc69055ec2ecba0ba 100644 (file)
--- a/src/sp-flowregion.cpp
+++ b/src/sp-flowregion.cpp
#include "sp-text.h"
#include "sp-use.h"
#include "style.h"
+#include "document.h"
#include "sp-flowregion.h"
sp_flowregion_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
if (flags & SP_OBJECT_WRITE_BUILD) {
- if ( repr == NULL ) repr = sp_repr_new ("svg:flowRegion");
-
+ if ( repr == NULL ) {
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
+ repr = xml_doc->createElement("svg:flowRegion");
+ }
+
GSList *l = NULL;
for ( SPObject *child = sp_object_first_child(object) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
Inkscape::XML::Node *crepr = child->updateRepr(NULL, flags);
if (crepr) l = g_slist_prepend(l, crepr);
}
-
+
while (l) {
repr->addChild((Inkscape::XML::Node *) l->data, NULL);
Inkscape::GC::release((Inkscape::XML::Node *) l->data);
l = g_slist_remove(l, l->data);
}
-
+
} else {
for ( SPObject *child = sp_object_first_child(object) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
child->updateRepr(flags);
sp_flowregionexclude_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
if (flags & SP_OBJECT_WRITE_BUILD) {
- if ( repr == NULL ) repr = sp_repr_new ("svg:flowRegionExclude");
-
+ if ( repr == NULL ) {
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
+ repr = xml_doc->createElement("svg:flowRegionExclude");
+ }
+
GSList *l = NULL;
for ( SPObject *child = sp_object_first_child(object) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
Inkscape::XML::Node *crepr = child->updateRepr(NULL, flags);
if (crepr) l = g_slist_prepend(l, crepr);
}
-
+
while (l) {
repr->addChild((Inkscape::XML::Node *) l->data, NULL);
Inkscape::GC::release((Inkscape::XML::Node *) l->data);
l = g_slist_remove(l, l->data);
}
-
+
} else {
for ( SPObject *child = sp_object_first_child(object) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
child->updateRepr(flags);
Path* temp=new Path;
NR::Matrix tr_mat=sp_item_i2root_affine (SP_ITEM(u_child));
tr_mat=itr_mat*tr_mat;
- temp->LoadArtBPath(curve->bpath,tr_mat,true);
+ temp->LoadArtBPath(SP_CURVE_BPATH(curve),tr_mat,true);
Shape* n_shp=new Shape;
temp->Convert(0.25);
temp->Fill(n_shp,0);