summaryrefslogtreecommitdiffstats
path: root/src/util/units.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-09-08 21:29:10 +0000
committerJabiertxof <jtx@jtx.marker.es>2013-09-08 21:29:10 +0000
commit36553c85069d88ba5e7b5fba7cd31cc4818a454d (patch)
treef9832fe22e771c66215647a4857ee68fa3f9300b /src/util/units.cpp
parentupdate to trunk (diff)
parentAdd a check so objects removed from the document dont crash inkscape, happens... (diff)
downloadinkscape-36553c85069d88ba5e7b5fba7cd31cc4818a454d.tar.gz
inkscape-36553c85069d88ba5e7b5fba7cd31cc4818a454d.zip
update to trunk
(bzr r11950.1.138)
Diffstat (limited to 'src/util/units.cpp')
-rw-r--r--src/util/units.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/util/units.cpp b/src/util/units.cpp
index 7bc910fcc..3fdd77916 100644
--- a/src/util/units.cpp
+++ b/src/util/units.cpp
@@ -227,9 +227,10 @@ Quantity UnitTable::getQuantity(Glib::ustring const& q) const
// Extract value
double value = 0;
- Glib::RefPtr<Glib::Regex> value_regex = Glib::Regex::create("[-+]*[\\d+]*\\.*[\\d+]*[eE]*[-+]*\\d+");
+ Glib::RefPtr<Glib::Regex> value_regex = Glib::Regex::create("[-+]*[\\d+]*[\\.,]*[\\d+]*[eE]*[-+]*\\d+");
if (value_regex->match(q, match_info)) {
- value = atof(match_info.fetch(0).c_str());
+ std::istringstream tmp_v(match_info.fetch(0));
+ tmp_v >> value;
}
// Extract unit abbreviation