Code

Factor out bpath_to_Path
authorjohncoswell <johncoswell@users.sourceforge.net>
Sun, 25 Feb 2007 06:03:32 +0000 (06:03 +0000)
committerjohncoswell <johncoswell@users.sourceforge.net>
Sun, 25 Feb 2007 06:03:32 +0000 (06:03 +0000)
src/splivarot.cpp
src/splivarot.h

index 58adee3a26be9be0f213b1d78065a9c292504c0e..a23d6da02727eda7752da84de035a4bdba21d190 100644 (file)
@@ -1723,6 +1723,17 @@ Path_for_item(SPItem *item, bool doTransformation, bool transformFull)
         bpath=SP_CURVE_BPATH(curve);
     }
 
+    Path *dest = bpath_to_Path(bpath);
+
+    if ( doTransformation ) {
+        if ( bpath ) g_free(bpath);
+    } else {
+        sp_curve_unref(curve);
+    }
+    return dest;
+}
+
+Path *bpath_to_Path(NArtBpath const *bpath) {
     Path *dest = new Path;
     dest->SetBackData(false);
     {
@@ -1776,12 +1787,6 @@ Path_for_item(SPItem *item, bool doTransformation, bool transformFull)
         if (closed)
             dest->Close();
     }
-
-    if ( doTransformation ) {
-        if ( bpath ) g_free(bpath);
-    } else {
-        sp_curve_unref(curve);
-    }
     return dest;
 }
 
index 4e73eac9f913ed20b943a45370f9c87e97287d70..cf1ebcd9400f2777088dde90e1fdafb000628310 100644 (file)
@@ -44,6 +44,7 @@ void sp_selected_path_simplify ();
 Path *Path_for_item(SPItem *item, bool doTransformation, bool transformFull = true);
 NR::Maybe<Path::cut_position> get_nearest_position_on_Path(Path *path, NR::Point p);
 NR::Point get_point_on_Path(Path *path, int piece, double t);
+Path *bpath_to_Path(NArtBpath const *bpath);
 
 #endif