Code

remove many unnecessary to_2geom and from_2geom calls
[inkscape.git] / src / path-chemistry.cpp
index aac75756e305ffc7098b146b00f97a15cd9be940..c4855e7d38980239adafd20c7d0568c84116c20b 100644 (file)
@@ -37,7 +37,7 @@
 #include "selection.h"
 #include "desktop-handles.h"
 #include "box3d.h"
-
+#include <2geom/pathvector.h>
 #include "path-chemistry.h"
 
 /* Helper functions for sp_selected_path_to_curves */
@@ -221,14 +221,14 @@ sp_selected_path_break_apart(void)
         gchar *style = g_strdup(SP_OBJECT(item)->repr->attribute("style"));
         gchar *path_effect = g_strdup(SP_OBJECT(item)->repr->attribute("inkscape:path-effect"));
 
-        NArtBpath *abp = nr_artpath_affine(SP_CURVE_BPATH(curve), (SP_ITEM(path))->transform);
+        Geom::PathVector apv = curve->get_pathvector() * SP_ITEM(path)->transform;
 
         curve->unref();
 
         // it's going to resurrect as one of the pieces, so we delete without advertisement
         SP_OBJECT(item)->deleteObject(false);
 
-        curve = SPCurve::new_from_bpath(abp);
+        curve = new SPCurve(apv);
         g_assert(curve != NULL);
 
         GSList *list = curve->split();
@@ -435,7 +435,7 @@ sp_selected_item_to_curved_repr(SPItem *item, guint32 /*text_grouping_policy*/)
 
     // Prevent empty paths from being added to the document
     // otherwise we end up with zomby markup in the SVG file
-    if(curve->get_length() <= 0)
+    if(curve->is_empty())
     {
         curve->unref();
         return NULL;