Code

Filter effects dialog:
[inkscape.git] / src / sp-spiral.cpp
index d7b703d1adbc70269657cf795f5a61ba6ce7a5fc..a2449fb9a334a8d6edfa9db187251acf4a6cd297 100644 (file)
@@ -23,6 +23,7 @@
 #include "display/curve.h"
 #include <glibmm/i18n.h>
 #include "xml/repr.h"
+#include "document.h"
 
 #include "sp-spiral.h"
 
@@ -139,7 +140,8 @@ sp_spiral_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
        SPSpiral *spiral = SP_SPIRAL (object);
 
        if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
-               repr = sp_repr_new ("svg:path");
+                Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
+               repr = xml_doc->createElement("svg:path");
        }
 
        if (flags & SP_OBJECT_WRITE_EXT) {
@@ -156,6 +158,9 @@ sp_spiral_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
                sp_repr_set_svg_double(repr, "sodipodi:t0", spiral->t0);
        }
 
+     // make sure the curve is rebuilt with all up-to-date parameters
+     sp_spiral_set_shape ((SPShape *) spiral);
+
         //Duplicate the path
         SPCurve *curve = ((SPShape *) spiral)->curve;
         //Nulls might be possible if this called iteratively
@@ -163,7 +168,7 @@ sp_spiral_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
                 //g_warning("sp_spiral_write(): No path to copy\n");
                 return NULL;
         }
-        NArtBpath *bpath = curve->bpath;
+        NArtBpath *bpath = SP_CURVE_BPATH(curve);
         if ( !bpath ) {
                 //g_warning("sp_spiral_write(): No path to copy\n");
                 return NULL;