summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2010-12-12 13:45:12 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2010-12-12 13:45:12 +0000
commitcf166525fc839c389a49b117a1aa15db23471a26 (patch)
treefe7d0223be6a02e3a157cb444ab6d5910f9f424e /src
parentFix build failure (diff)
downloadinkscape-cf166525fc839c389a49b117a1aa15db23471a26.tar.gz
inkscape-cf166525fc839c389a49b117a1aa15db23471a26.zip
Prevent localized doubles from being written into filter matrices
(bzr r9948)
Diffstat (limited to 'src')
-rw-r--r--src/helper-fns.h12
-rw-r--r--src/ui/dialog/filter-effects-dialog.cpp5
2 files changed, 10 insertions, 7 deletions
diff --git a/src/helper-fns.h b/src/helper-fns.h
index 05e65fea8..f407364a5 100644
--- a/src/helper-fns.h
+++ b/src/helper-fns.h
@@ -22,7 +22,7 @@
// can be more clear.
#define HELPERFNS_NO_WARNING false
-/* convert localized ascii representation to double
+/* convert ascii representation to double
* the function can only be used to convert numbers as given by gui elements that use localized representation
* @param value ascii representation of the number
* @return the converted number
@@ -37,7 +37,7 @@ inline double helperfns_read_number(gchar const *value, bool warning = true) {
return 0;
}
char *end;
- double ret = g_strtod(value, &end);
+ double ret = g_ascii_strtod(value, &end);
if (*end) {
if (warning) {
g_warning("helper-fns::helperfns_read_number() Unable to convert \"%s\" to number", value);
@@ -62,7 +62,7 @@ inline bool helperfns_read_bool(gchar const *value, bool default_value){
return default_value;
}
-/* convert localized ascii representation to double
+/* convert ascii representation to double
* the function can only be used to convert numbers as given by gui elements that use localized representation
* numbers are delimeted by space
* @param value ascii representation of the number
@@ -77,7 +77,7 @@ inline std::vector<gdouble> helperfns_read_vector(const gchar* value, int size){
is >> str;
char *end;
- double ret = g_strtod(str.c_str(), &end);
+ double ret = g_ascii_strtod(str.c_str(), &end);
if (*end) {
g_warning("helper-fns::helperfns_read_vector() Unable to convert \"%s\" to number", str.c_str());
// We could leave this out, too. If strtod can't convert
@@ -89,7 +89,7 @@ inline std::vector<gdouble> helperfns_read_vector(const gchar* value, int size){
return v;
}
-/* convert localized ascii representation to double
+/* convert ascii representation to double
* the function can only be used to convert numbers as given by gui elements that use localized representation
* numbers are delimeted by space
* @param value ascii representation of the number
@@ -103,7 +103,7 @@ inline std::vector<gdouble> helperfns_read_vector(const gchar* value){
while(*beg)
{
char *end;
- double ret = g_strtod(beg, &end);
+ double ret = g_ascii_strtod(beg, &end);
if (end==beg){
g_warning("helper-fns::helperfns_read_vector() Unable to convert \"%s\" to number", beg);
// We could leave this out, too. If strtod can't convert
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp
index ed7103be3..3fbb3663d 100644
--- a/src/ui/dialog/filter-effects-dialog.cpp
+++ b/src/ui/dialog/filter-effects-dialog.cpp
@@ -58,6 +58,7 @@
#include "style.h"
#include "svg/svg-color.h"
+#include "svg/stringstream.h"
#include "ui/dialog/filedialog.h"
#include "verbs.h"
#include "xml/node.h"
@@ -304,6 +305,7 @@ public:
// Returns the color in 'rgb(r,g,b)' form.
Glib::ustring get_as_attribute() const
{
+ // no doubles here, so we can use the standard string stream.
std::ostringstream os;
const Gdk::Color c = get_color();
const int r = c.get_red() / 257, g = c.get_green() / 257, b = c.get_blue() / 257;//TO-DO: verify this. This sounds a lot strange! shouldn't it be 256?
@@ -371,7 +373,8 @@ public:
Glib::ustring get_as_attribute() const
{
- std::ostringstream os;
+ // use SVGOStringStream to output SVG-compatible doubles
+ Inkscape::SVGOStringStream os;
for(Gtk::TreeIter iter = _model->children().begin();
iter != _model->children().end(); ++iter) {