Code

for sppath, use 2geompath for svg_write: sp_svg_write_path(np->curve->get_pathvector...
authorjohanengelen <johanengelen@users.sourceforge.net>
Fri, 6 Jun 2008 23:47:18 +0000 (23:47 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Fri, 6 Jun 2008 23:47:18 +0000 (23:47 +0000)
src/sp-path.cpp

index 81d05ebef05a3b904c843ea0f690d43428417ac9..e16147b120ad0ef3d304564fbd7d251aaece2ba9 100644 (file)
@@ -308,28 +308,18 @@ sp_path_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
     }
 
     if ( shape->curve != NULL ) {
-        NArtBpath const * abp = shape->curve->get_bpath();
-        if (abp) {
-            gchar *str = sp_svg_write_path(abp);
-            repr->setAttribute("d", str);
-            g_free(str);
-        } else {
-            repr->setAttribute("d", "");
-        }
+        gchar *str = sp_svg_write_path(shape->curve->get_pathvector());
+        repr->setAttribute("d", str);
+        g_free(str);
     } else {
         repr->setAttribute("d", NULL);
     }
 
     SPPath *path = (SPPath *) object;
     if ( path->original_curve != NULL ) {
-        NArtBpath const * abp = path->original_curve->get_bpath();
-        if (abp) {
-            gchar *str = sp_svg_write_path(abp);
-            repr->setAttribute("inkscape:original-d", str);
-            g_free(str);
-        } else {
-            repr->setAttribute("inkscape:original-d", "");
-        }
+        gchar *str = sp_svg_write_path(path->original_curve->get_pathvector());
+        repr->setAttribute("inkscape:original-d", str);
+        g_free(str);
     } else {
         repr->setAttribute("inkscape:original-d", NULL);
     }
@@ -414,14 +404,9 @@ sp_path_update_patheffect(SPLPEItem *lpeitem, bool write)
             // could also do SP_OBJECT(shape)->updateRepr();  but only the d attribute needs updating.
             Inkscape::XML::Node *repr = SP_OBJECT_REPR(shape);
             if ( shape->curve != NULL ) {
-                NArtBpath const *abp = shape->curve->get_bpath();
-                if (abp) {
-                    gchar *str = sp_svg_write_path(abp);
-                    repr->setAttribute("d", str);
-                    g_free(str);
-                } else {
-                    repr->setAttribute("d", "");
-                }
+                gchar *str = sp_svg_write_path(shape->curve->get_pathvector());
+                repr->setAttribute("d", str);
+                g_free(str);
             } else {
                 repr->setAttribute("d", NULL);
             }