summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorLiam P. White <inkscapebrony@gmail.com>2014-08-17 14:46:20 +0000
committerLiam P. White <inkscapebrony@gmail.com>2014-08-17 14:46:20 +0000
commita4c8b296b04ffcb728e75f465872cfd42aef787e (patch)
tree139168352b7852adff3237e9323246e0603ff81d /src/util
parentFix gtk3 build (diff)
parentSimilar workaround to r13523 (text&font dialog not appearing quickly) (diff)
downloadinkscape-a4c8b296b04ffcb728e75f465872cfd42aef787e.tar.gz
inkscape-a4c8b296b04ffcb728e75f465872cfd42aef787e.zip
Update to trunk r13525
(bzr r13341.1.142)
Diffstat (limited to 'src/util')
-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);
}