Code

Fix bug #1077600 -> correct mirroring and no drifting of origin
[inkscape.git] / src / sp-spiral.cpp
index 9c04120e1e8dea67091c679d1e7185a93cba5697..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) {
@@ -166,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;