diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2014-11-24 21:38:54 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2014-11-24 21:38:54 +0000 |
| commit | 5497de6e39d4fc31a6824eb9f9e638635de4521b (patch) | |
| tree | d1e5d867d3b9f618846bdfe65e147b23df8ed58a /src/document.cpp | |
| parent | Fixing bend from clipboard to trunk 0.92 (diff) | |
| parent | Fix a bug in pen/cil modes triangle in/out (diff) | |
| download | inkscape-5497de6e39d4fc31a6824eb9f9e638635de4521b.tar.gz inkscape-5497de6e39d4fc31a6824eb9f9e638635de4521b.zip | |
update to trunk
(bzr r12588.1.37)
Diffstat (limited to 'src/document.cpp')
| -rw-r--r-- | src/document.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/document.cpp b/src/document.cpp index f5269eab3..3715d8e6e 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -599,6 +599,14 @@ Inkscape::Util::Unit const* SPDocument::getDefaultUnit() const return nv ? nv->getDefaultUnit() : unit_table.getUnit("pt"); } +/// guaranteed not to return nullptr +// returns 'px' units as default, like legacy Inkscape +Inkscape::Util::Unit const& SPDocument::getSVGUnit() const +{ + SPNamedView const* nv = sp_document_namedview(this, NULL); + return nv ? nv->getSVGUnit() : *unit_table.getUnit("px"); +} + Inkscape::Util::Quantity SPDocument::getWidth() const { g_return_val_if_fail(this->priv != NULL, Inkscape::Util::Quantity(0.0, unit_table.getUnit(""))); |
