From 651b367a2e01f918435d829394baff45537f6b91 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Thu, 24 Oct 2013 17:03:01 +0200 Subject: 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) --- src/document.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/document.cpp') 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(""))); -- cgit v1.2.3