summaryrefslogtreecommitdiffstats
path: root/src/util/units.cpp
diff options
context:
space:
mode:
authorsu_v <suv-sf@users.sourceforge.net>2014-08-20 03:16:23 +0000
committer~suv <suv-sf@users.sourceforge.net>2014-08-20 03:16:23 +0000
commit9225fd3f29be0822c556f4ca2a8a6ec3099377f9 (patch)
treefdb1a8ea2013aac3f8c0f73ff95d29e55bc13dc7 /src/util/units.cpp
parentmacosx packaging: a few minor changes (diff)
parentClear the waiting cursor on the old desktop after creating a new one (diff)
downloadinkscape-9225fd3f29be0822c556f4ca2a8a6ec3099377f9.tar.gz
inkscape-9225fd3f29be0822c556f4ca2a8a6ec3099377f9.zip
update to trunk (r13528)
(bzr r13506.1.18)
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);
}