diff options
| author | Liam P. White <inkscapebrony@gmail.com> | 2014-08-30 15:49:40 +0000 |
|---|---|---|
| committer | Liam P. White <inkscapebrony@gmail.com> | 2014-08-30 15:49:40 +0000 |
| commit | 18770eebe339cdc673812a48c5e05c7cdcb3a82e (patch) | |
| tree | 1e3846a72decad64d24100cdbe0a2e0d42f252b8 /src/util | |
| parent | Update to experimental r13464 (diff) | |
| parent | Fix paint-selector orientation (diff) | |
| download | inkscape-18770eebe339cdc673812a48c5e05c7cdcb3a82e.tar.gz inkscape-18770eebe339cdc673812a48c5e05c7cdcb3a82e.zip | |
Update to experimental r13527
(bzr r13341.5.15)
Diffstat (limited to 'src/util')
| -rw-r--r-- | src/util/units.cpp | 6 |
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); } |
