From: johncoswell Date: Sun, 25 Feb 2007 06:03:32 +0000 (+0000) Subject: Factor out bpath_to_Path X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=03fc1255a2b14836059ce44ffd41649a7a58431a;p=inkscape.git Factor out bpath_to_Path --- diff --git a/src/splivarot.cpp b/src/splivarot.cpp index 58adee3a2..a23d6da02 100644 --- a/src/splivarot.cpp +++ b/src/splivarot.cpp @@ -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; } diff --git a/src/splivarot.h b/src/splivarot.h index 4e73eac9f..cf1ebcd94 100644 --- a/src/splivarot.h +++ b/src/splivarot.h @@ -44,6 +44,7 @@ void sp_selected_path_simplify (); Path *Path_for_item(SPItem *item, bool doTransformation, bool transformFull = true); NR::Maybe 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