diff options
| author | Sebastian Wüst <sebi@timewaster.de> | 2013-10-20 15:32:08 +0000 |
|---|---|---|
| committer | Sebastian Wüst <sebi@timewaster.de> | 2013-10-20 15:32:08 +0000 |
| commit | 82908f949129e1fcbf62002799ee7b1b77986eed (patch) | |
| tree | c02098dd7720cdf424f2793ecd3ddac2ea86b969 /src/preferences.cpp | |
| parent | changed text (diff) | |
| parent | Fix build errors with clang 3.3 and c++11 enabled. (diff) | |
| download | inkscape-82908f949129e1fcbf62002799ee7b1b77986eed.tar.gz inkscape-82908f949129e1fcbf62002799ee7b1b77986eed.zip | |
merge from trunk
(bzr r12417.1.24)
Diffstat (limited to 'src/preferences.cpp')
| -rw-r--r-- | src/preferences.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/preferences.cpp b/src/preferences.cpp index 1d7009a99..0dcebbb90 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -28,6 +28,8 @@ #define PREFERENCES_FILE_NAME "preferences.xml" +using Inkscape::Util::unit_table; + namespace Inkscape { static Inkscape::XML::Document *loadImpl( std::string const& prefsFilename, Glib::ustring & errMsg ); @@ -777,17 +779,14 @@ double Preferences::_extractDouble(Entry const &v) double Preferences::_extractDouble(Entry const &v, Glib::ustring const &requested_unit) { - static Inkscape::Util::UnitTable unit_table; // load the unit_table once by making it static - double val = _extractDouble(v); Glib::ustring unit = _extractUnit(v); if (unit.length() == 0) { // no unit specified, don't do conversion return val; - } else { - return val * (unit_table.getUnit(unit).factor / unit_table.getUnit(requested_unit).factor); } + return val * (unit_table.getUnit(unit)->factor / unit_table.getUnit(requested_unit)->factor); /// \todo rewrite using Quantity class, so the standard code handles unit conversion } Glib::ustring Preferences::_extractString(Entry const &v) |
