From a970dc423d59ea844bdb1af48d5d9419a5e2a287 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 13 Oct 2013 00:24:05 +0200 Subject: Units: stop newing Unit objects. pass around pointers to "undeletable" Unit objects in the UnitTable. I think we should move to using indexed units, and pass around the index of the unit in the unittable, or smth like that... ? (bzr r12679) --- src/extension/internal/emf-inout.cpp | 2 +- src/extension/internal/wmf-inout.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/extension/internal') diff --git a/src/extension/internal/emf-inout.cpp b/src/extension/internal/emf-inout.cpp index 90ab763e0..f1876c687 100644 --- a/src/extension/internal/emf-inout.cpp +++ b/src/extension/internal/emf-inout.cpp @@ -3504,7 +3504,7 @@ Emf::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri ) doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().quantity, doc->getHeight().quantity)); // Scale and translate objects - double scale = Inkscape::Util::Quantity::convert(1, "px", doc->getWidth().unit->abbr); + double scale = Inkscape::Util::Quantity::convert(1, "px", doc->getWidth().unit); ShapeEditor::blockSetItem(true); doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(0, SP_ACTIVE_DOCUMENT->getHeight().value("px"))); ShapeEditor::blockSetItem(false); diff --git a/src/extension/internal/wmf-inout.cpp b/src/extension/internal/wmf-inout.cpp index aab98dc87..d69d46f20 100644 --- a/src/extension/internal/wmf-inout.cpp +++ b/src/extension/internal/wmf-inout.cpp @@ -3192,7 +3192,7 @@ Wmf::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri ) doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().quantity, doc->getHeight().quantity)); // Scale and translate objects - double scale = Inkscape::Util::Quantity::convert(1, "px", doc->getWidth().unit->abbr); + double scale = Inkscape::Util::Quantity::convert(1, "px", doc->getWidth().unit); ShapeEditor::blockSetItem(true); doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(0, SP_ACTIVE_DOCUMENT->getHeight().value("px"))); ShapeEditor::blockSetItem(false); -- cgit v1.2.3