summaryrefslogtreecommitdiffstats
path: root/src/preferences.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2011-11-27 13:49:30 +0000
committerJohan Engelen <goejendaagh@zonnet.nl>2011-11-27 13:49:30 +0000
commit02287189426c0d3e7873e2dd58d2af92068607ba (patch)
tree0418fab70bfdfc1af73bdfcc4c813a126101af1b /src/preferences.cpp
parentsmall clean up in axonometric grid code (diff)
downloadinkscape-02287189426c0d3e7873e2dd58d2af92068607ba.tar.gz
inkscape-02287189426c0d3e7873e2dd58d2af92068607ba.zip
preferences read out: when no unit is specified, assume it is in the requested units
Fixed bugs: - https://launchpad.net/bugs/799848 (bzr r10752)
Diffstat (limited to 'src/preferences.cpp')
-rw-r--r--src/preferences.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/preferences.cpp b/src/preferences.cpp
index 2a3019d28..4615fd6e1 100644
--- a/src/preferences.cpp
+++ b/src/preferences.cpp
@@ -770,7 +770,12 @@ double Preferences::_extractDouble(Entry const &v, Glib::ustring const &requeste
double val = _extractDouble(v);
Glib::ustring unit = _extractUnit(v);
- return val * (unit_table.getUnit(unit).factor / unit_table.getUnit(requested_unit).factor);
+ 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);
+ }
}
Glib::ustring Preferences::_extractString(Entry const &v)