diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2013-10-24 15:03:01 +0000 |
|---|---|---|
| committer | Johan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl> | 2013-10-24 15:03:01 +0000 |
| commit | 651b367a2e01f918435d829394baff45537f6b91 (patch) | |
| tree | a99fb20cf0acd5fb91cd11833258a9aa222d4d3a /src/document.cpp | |
| parent | fix crash bug 1237676 (diff) | |
| download | inkscape-651b367a2e01f918435d829394baff45537f6b91.tar.gz inkscape-651b367a2e01f918435d829394baff45537f6b91.zip | |
fix bug "some of the locale-based templates cause objects to be resized when default units are changed" #1236257
Fixed bugs:
- https://launchpad.net/bugs/1236257
(bzr r12717)
Diffstat (limited to 'src/document.cpp')
| -rw-r--r-- | src/document.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/document.cpp b/src/document.cpp index 4a3d40308..782eb22f3 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -558,6 +558,13 @@ SPDocument *SPDocument::doUnref() return NULL; } +/// guaranteed not to return nullptr +Inkscape::Util::Unit const* SPDocument::getDefaultUnit() +{ + SPNamedView const* nv = sp_document_namedview(this, NULL); + return nv ? nv->getDefaultUnit() : unit_table.getUnit("pt"); +} + Inkscape::Util::Quantity SPDocument::getWidth() const { g_return_val_if_fail(this->priv != NULL, Inkscape::Util::Quantity(0.0, unit_table.getUnit(""))); |
