Code

Filter effects dialog:
[inkscape.git] / src / sp-path.cpp
index 9fe2f54c56a216b440a98a4ab55caaa88e7a925a..3b455e50532a74cff05f14107cf666db144df300 100644 (file)
@@ -18,9 +18,7 @@
 # include <config.h>
 #endif
 
-#if defined(WIN32) || defined(__APPLE__)
-# include <glibmm/i18n.h>
-#endif
+#include <glibmm/i18n.h>
 
 #include <display/curve.h>
 #include <libnr/n-art-bpath.h>
@@ -33,6 +31,8 @@
 
 #include "sp-path.h"
 
+#include "document.h"
+
 #define noPATH_VERBOSE
 
 static void sp_path_class_init(SPPathClass *klass);
@@ -111,7 +111,7 @@ sp_nodes_in_path(SPPath *path)
     gint i = curve->length - 1;
     if (i > r) i = r; // sometimes after switching from node editor length is wrong, e.g. f6 - draw - f2 - tab - f1, this fixes it
     for (; i >= 0; i --)
-        if ((curve->bpath + i) -> code == NR_MOVETO)
+        if (SP_CURVE_BPATH(curve)[i].code == NR_MOVETO)
             r --;
     return r;
 }
@@ -234,7 +234,8 @@ sp_path_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
     SPShape *shape = (SPShape *) 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 ( shape->curve != NULL ) {
@@ -289,7 +290,7 @@ sp_path_set_transform(SPItem *item, NR::Matrix const &xform)
 
     /* Transform the path */
     NRBPath dpath, spath;
-    spath.path = shape->curve->bpath;
+    spath.path = SP_CURVE_BPATH(shape->curve);
     nr_path_duplicate_transform(&dpath, &spath, xform);
     SPCurve *curve = sp_curve_new_from_bpath(dpath.path);
     if (curve) {