diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2016-06-01 19:13:32 +0000 |
|---|---|---|
| committer | tavmjong-free <tavmjong@free.fr> | 2016-06-01 19:13:32 +0000 |
| commit | de91fb305ef9afbead53d70421db60f3fb7d8a4c (patch) | |
| tree | 9692258376e403ae7a5e175bc78d2c1159a44f39 | |
| parent | Replace two instances of getSVGUnit() by getDocumentScale(). (diff) | |
| download | inkscape-de91fb305ef9afbead53d70421db60f3fb7d8a4c.tar.gz inkscape-de91fb305ef9afbead53d70421db60f3fb7d8a4c.zip | |
Remove last use of getSVGUnit() and remove all remnants of this abomination.
(bzr r14939)
| -rw-r--r-- | src/document.cpp | 9 | ||||
| -rw-r--r-- | src/document.h | 1 | ||||
| -rw-r--r-- | src/extension/internal/emf-print.cpp | 2 | ||||
| -rw-r--r-- | src/sp-namedview.cpp | 6 | ||||
| -rw-r--r-- | src/sp-namedview.h | 1 |
5 files changed, 1 insertions, 18 deletions
diff --git a/src/document.cpp b/src/document.cpp index 2500a5cee..e9388893e 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -589,15 +589,6 @@ Inkscape::Util::Unit const* SPDocument::getDisplayUnit() const return nv ? nv->getDisplayUnit() : unit_table.getUnit("px"); } -/// guaranteed not to return nullptr -// returns 'px' units as default, like legacy Inkscape -// THIS SHOULD NOT BE USED... INSTEAD USE DOCUMENT SCALE -Inkscape::Util::Unit const& SPDocument::getSVGUnit() const -{ - SPNamedView const* nv = sp_document_namedview(this, NULL); - return nv ? nv->getSVGUnit() : *unit_table.getUnit("px"); -} - /// Sets document scale (by changing viewBox) void SPDocument::setDocumentScale( double scaleX, double scaleY ) { diff --git a/src/document.h b/src/document.h index 653e9d0db..e95042155 100644 --- a/src/document.h +++ b/src/document.h @@ -243,7 +243,6 @@ public: SPDocument *doRef(); SPDocument *doUnref(); Inkscape::Util::Unit const* getDisplayUnit() const; - Inkscape::Util::Unit const& getSVGUnit() const; void setDocumentScale( const double scaleX, const double scaleY ); void setDocumentScale( const double scale ); Geom::Scale getDocumentScale() const; diff --git a/src/extension/internal/emf-print.cpp b/src/extension/internal/emf-print.cpp index 1c85182ae..9f3b5475f 100644 --- a/src/extension/internal/emf-print.cpp +++ b/src/extension/internal/emf-print.cpp @@ -144,7 +144,7 @@ unsigned int PrintEmf::begin(Inkscape::Extension::Print *mod, SPDocument *doc) // width and height in px _width = doc->getWidth().value("px"); _height = doc->getHeight().value("px"); - _doc_unit_scale = Inkscape::Util::Quantity::convert(1, &doc->getSVGUnit(), "px"); + _doc_unit_scale = doc->getDocumentScale()[Geom::X]; // initialize a few global variables hbrush = hbrushOld = hpen = 0; diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index 9598a14ec..65d8b26c8 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -1155,12 +1155,6 @@ Inkscape::Util::Unit const * SPNamedView::getDisplayUnit() const return display_units ? display_units : unit_table.getUnit("px"); } -Inkscape::Util::Unit const & SPNamedView::getSVGUnit() const -{ - assert(svg_units); - return *svg_units; -} - /** * Returns the first grid it could find that isEnabled(). Returns NULL, if none is enabled */ diff --git a/src/sp-namedview.h b/src/sp-namedview.h index 3d63f2b97..ca85153b4 100644 --- a/src/sp-namedview.h +++ b/src/sp-namedview.h @@ -90,7 +90,6 @@ public: unsigned int getViewCount(); std::vector<SPDesktop *> const getViewList() const; Inkscape::Util::Unit const * getDisplayUnit() const; - Inkscape::Util::Unit const & getSVGUnit() const; void translateGuides(Geom::Translate const &translation); void translateGrids(Geom::Translate const &translation); |
