From: JazzyNico Date: Thu, 27 May 2010 19:41:41 +0000 (+0200) Subject: Extensions. Localized float values in SVG due to internal extensions, %f in printf... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a5d4ad5bb1f7aef41ad04b5b35c41bf9f47a8795;p=inkscape.git Extensions. Localized float values in SVG due to internal extensions, %f in printf (bug #586063) --- diff --git a/src/extension/internal/filter/drop-shadow.h b/src/extension/internal/filter/drop-shadow.h index 34939222c..a48175fde 100644 --- a/src/extension/internal/filter/drop-shadow.h +++ b/src/extension/internal/filter/drop-shadow.h @@ -57,21 +57,26 @@ DropShadow::get_filter_text (Inkscape::Extension::Extension * ext) { if (_filter != NULL) g_free((void *)_filter); - float blur = ext->get_param_float("blur"); - float opacity = ext->get_param_float("opacity") / 100; - float x = ext->get_param_float("xoffset"); - float y = ext->get_param_float("yoffset"); + std::ostringstream blur; + std::ostringstream opacity; + std::ostringstream x; + std::ostringstream y; + + blur << ext->get_param_float("blur"); + opacity << ext->get_param_float("opacity") / 100; + x << ext->get_param_float("xoffset"); + y << ext->get_param_float("yoffset"); _filter = g_strdup_printf( "\n" - "\n" - "\n" - "\n" + "\n" + "\n" + "\n" "\n" "\n" "\n" "\n" - "\n", blur, opacity, x, y); + "\n", blur.str().c_str(), opacity.str().c_str(), x.str().c_str(), y.str().c_str()); return _filter; }; @@ -112,21 +117,26 @@ DropGlow::get_filter_text (Inkscape::Extension::Extension * ext) { if (_filter != NULL) g_free((void *)_filter); - float blur = ext->get_param_float("blur"); - float opacity = ext->get_param_float("opacity") / 100; - float x = ext->get_param_float("xoffset"); - float y = ext->get_param_float("yoffset"); + std::ostringstream blur; + std::ostringstream opacity; + std::ostringstream x; + std::ostringstream y; + + blur << ext->get_param_float("blur"); + opacity << ext->get_param_float("opacity") / 100; + x << ext->get_param_float("xoffset"); + y << ext->get_param_float("yoffset"); _filter = g_strdup_printf( "\n" - "\n" - "\n" - "\n" + "\n" + "\n" + "\n" "\n" "\n" "\n" "\n" - "\n", blur, opacity, x, y); + "\n", blur.str().c_str(), opacity.str().c_str(), x.str().c_str(), y.str().c_str()); return _filter; }; diff --git a/src/extension/internal/filter/snow.h b/src/extension/internal/filter/snow.h index cb5c55f57..2bb798cf1 100644 --- a/src/extension/internal/filter/snow.h +++ b/src/extension/internal/filter/snow.h @@ -51,12 +51,13 @@ Snow::get_filter_text (Inkscape::Extension::Extension * ext) { if (_filter != NULL) g_free((void *)_filter); - float drift = ext->get_param_float("drift"); + std::ostringstream drift; + drift << ext->get_param_float("drift"); _filter = g_strdup_printf( "\n" "\n" - "\n" + "\n" "\n" "\n" "\n" @@ -67,7 +68,7 @@ Snow::get_filter_text (Inkscape::Extension::Extension * ext) "\n" "\n" "\n" - "\n", drift); + "\n", drift.str().c_str()); return _filter; }; diff --git a/src/extension/internal/grid.cpp b/src/extension/internal/grid.cpp index 39bca52d8..1593ffe79 100644 --- a/src/extension/internal/grid.cpp +++ b/src/extension/internal/grid.cpp @@ -120,7 +120,9 @@ Grid::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View *doc Glib::ustring style("fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000"); style += ";stroke-width:"; gchar floatstring[64]; - sprintf(floatstring, "%f", line_width); + std::ostringstream stringstream; + stringstream << line_width; + sprintf(floatstring, "%s", stringstream.str().c_str()); style += floatstring; style += "pt"; path->setAttribute("style", style.c_str());