diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2014-11-23 23:36:49 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2014-11-23 23:36:49 +0000 |
| commit | 0969085ddf607a7a98cf7fd6d9b10da5fbebe62d (patch) | |
| tree | 59b2bc9ed3412ab2de4c703ef30342dfe2401704 /src/util | |
| parent | refactor from lastApplied (diff) | |
| parent | Fixed a bug pointed by suv running from comand line, also removed another des... (diff) | |
| download | inkscape-0969085ddf607a7a98cf7fd6d9b10da5fbebe62d.tar.gz inkscape-0969085ddf607a7a98cf7fd6d9b10da5fbebe62d.zip | |
fixing to trunk
(bzr r12588.1.34)
Diffstat (limited to 'src/util')
| -rw-r--r-- | src/util/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | src/util/Makefile_insert | 1 | ||||
| -rw-r--r-- | src/util/units.cpp | 7 |
3 files changed, 9 insertions, 2 deletions
diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index cfccfa94d..732e01b0c 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -5,6 +5,7 @@ set(util_SRC expression-evaluator.cpp share.cpp units.cpp + ziptool.cpp # ------- @@ -34,10 +35,12 @@ set(util_SRC reference.h reverse-list.h share.h + signal-blocker.h tuple.h ucompose.hpp units.h unordered-containers.h + ziptool.h ) # add_inkscape_lib(util_LIB "${util_SRC}") diff --git a/src/util/Makefile_insert b/src/util/Makefile_insert index 7169fa8f7..6d2e63278 100644 --- a/src/util/Makefile_insert +++ b/src/util/Makefile_insert @@ -31,6 +31,7 @@ ink_common_sources += \ util/reverse-list.h \ util/share.h \ util/share.cpp \ + util/signal-blocker.h \ util/tuple.h \ util/ucompose.hpp \ util/units.cpp \ diff --git a/src/util/units.cpp b/src/util/units.cpp index d2053f60b..3d635e2d2 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -206,7 +206,6 @@ bool Unit::compatibleWith(Unit const *u) const } bool Unit::compatibleWith(Glib::ustring const &u) const { - static UnitTable unit_table; return compatibleWith(unit_table.getUnit(u)); } @@ -291,11 +290,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); } |
