summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3731078)
raw | patch | inline | side by side (parent: 3731078)
author | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Sun, 12 Dec 2010 13:45:12 +0000 (14:45 +0100) | ||
committer | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Sun, 12 Dec 2010 13:45:12 +0000 (14:45 +0100) |
src/helper-fns.h | patch | blob | history | |
src/ui/dialog/filter-effects-dialog.cpp | patch | blob | history |
diff --git a/src/helper-fns.h b/src/helper-fns.h
index 05e65fea82edbc9ba48e0a44b7e7093a83232ac1..f407364a595e7366be01be82bb718667550bb585 100644 (file)
--- a/src/helper-fns.h
+++ b/src/helper-fns.h
// can be more clear.
#define HELPERFNS_NO_WARNING false
// 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
* 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
return 0;
}
char *end;
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);
if (*end) {
if (warning) {
g_warning("helper-fns::helperfns_read_number() Unable to convert \"%s\" to number", value);
return 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
* 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
is >> str;
char *end;
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
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
return v;
}
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
* 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
while(*beg)
{
char *end;
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
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
index ed7103be3c801a91fc4628d271e403d0e13c38b1..3fbb3663d86d27bbf1dfcbfd1c970b8a062e1d6a 100644 (file)
#include "style.h"
#include "svg/svg-color.h"
#include "style.h"
#include "svg/svg-color.h"
+#include "svg/stringstream.h"
#include "ui/dialog/filedialog.h"
#include "verbs.h"
#include "xml/node.h"
#include "ui/dialog/filedialog.h"
#include "verbs.h"
#include "xml/node.h"
// Returns the color in 'rgb(r,g,b)' form.
Glib::ustring get_as_attribute() const
{
// 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?
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?
Glib::ustring get_as_attribute() const
{
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) {
for(Gtk::TreeIter iter = _model->children().begin();
iter != _model->children().end(); ++iter) {