summaryrefslogtreecommitdiffstats
path: root/src/util/units.cpp
diff options
context:
space:
mode:
authorsu_v <suv-sf@users.sourceforge.net>2014-08-26 08:44:06 +0000
committer~suv <suv-sf@users.sourceforge.net>2014-08-26 08:44:06 +0000
commit84632bca5511a1daae902bbd9faad00d67fd58bf (patch)
tree2dd483c8d5c7411b9cbac3b263f3f77f86d37c38 /src/util/units.cpp
parentlibrevenge: update to latest patch from bug #1323592 (support old and new ver... (diff)
parentUI. Fix for Bug #340723 "Interface inconsistency of tooltips". (diff)
downloadinkscape-84632bca5511a1daae902bbd9faad00d67fd58bf.tar.gz
inkscape-84632bca5511a1daae902bbd9faad00d67fd58bf.zip
update to trunk (r13532)
(bzr r13398.1.8)
Diffstat (limited to 'src/util/units.cpp')
-rw-r--r--src/util/units.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util/units.cpp b/src/util/units.cpp
index d2053f60b..eb4a313e0 100644
--- a/src/util/units.cpp
+++ b/src/util/units.cpp
@@ -291,11 +291,15 @@ Quantity UnitTable::parseQuantity(Glib::ustring const &q) const
std::istringstream tmp_v(match_info.fetch(0));
tmp_v >> value;
}
+ int start_pos, end_pos;
+ match_info.fetch_pos(0, end_pos, start_pos);
+ end_pos = q.size() - start_pos;
+ Glib::ustring u = q.substr(start_pos, end_pos);
// Extract unit abbreviation
Glib::ustring abbr;
Glib::RefPtr<Glib::Regex> unit_regex = Glib::Regex::create("[A-z%]+");
- if (unit_regex->match(q, match_info)) {
+ if (unit_regex->match(u, match_info)) {
abbr = match_info.fetch(0);
}