From f92e6ec4025b82d140a65a949741e10d2380c5d6 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Tue, 2 Sep 2014 16:37:58 -0400 Subject: Fix locale issue in powerstroke width selection (bzr r13542) --- src/ui/tools/freehand-base.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp index a90a23a3e..37a170bc9 100644 --- a/src/ui/tools/freehand-base.cpp +++ b/src/ui/tools/freehand-base.cpp @@ -247,8 +247,9 @@ static void spdc_apply_powerstroke_shape(const std::vector & points sp_style_unref(style); } - char * width_str = new char[50]; - sprintf(width_str, "0,%f", stroke_width / 2.); + std::ostringstream s; + s.imbue(std::locale::classic()); + s << "0," << stroke_width / 2.; // write powerstroke parameters: lpe->getRepr()->setAttribute("start_linecap_type", "zerowidth"); @@ -257,9 +258,7 @@ static void spdc_apply_powerstroke_shape(const std::vector & points lpe->getRepr()->setAttribute("sort_points", "true"); lpe->getRepr()->setAttribute("interpolator_type", "CubicBezierJohan"); lpe->getRepr()->setAttribute("interpolator_beta", "0.2"); - lpe->getRepr()->setAttribute("offset_points", width_str); - - delete [] width_str; + lpe->getRepr()->setAttribute("offset_points", s.str().c_str()); } static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item, SPCurve *curve) -- cgit v1.2.3