diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-06-12 19:54:12 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-07-15 11:01:29 +0200 |
commit | b93d0cadb79f6652dec4d29ef20813f1d57cc708 (patch) | |
tree | f1b2d1ddaeb81c8d777dbf86c2b731e33b80085a | |
parent | 600a2aa24085cb972686b46061f9045785208a9e (diff) |
emfplus: use size of image of metafile fallback
Change-Id: I0de82e0e431c0ce4527a909c2f98194f465ace8d
-rw-r--r-- | emfio/source/emfuno/xemfparser.cxx | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/emfio/source/emfuno/xemfparser.cxx b/emfio/source/emfuno/xemfparser.cxx index 6fb27aadde23..3b6e9ad731fa 100644 --- a/emfio/source/emfuno/xemfparser.cxx +++ b/emfio/source/emfuno/xemfparser.cxx @@ -31,6 +31,7 @@ #include <basegfx/polygon/b2dpolygontools.hxx> #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> +#include <vcl/svapp.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> #include <vcl/wmf.hxx> #include <unotools/ucbstreamhelper.hxx> @@ -128,10 +129,22 @@ namespace emfio if (pStream && ConvertWMFToGDIMetaFile(*pStream, aMtf, nullptr, nullptr)) { + + Size aSize(aMtf.GetPrefSize()); + + if (aMtf.GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel) + { + aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, MapUnit::Map100thMM); + } + else + { + aSize = OutputDevice::LogicToLogic(aSize, aMtf.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)); + } + const basegfx::B2DHomMatrix aMetafileTransform( - basegfx::tools::createScaleTranslateB2DHomMatrix( - 5000.0, 5000.0, - 1000.0, 1000.0)); + basegfx::tools::createScaleB2DHomMatrix( + aSize.Width(), + aSize.Height())); aRetval.push_back( new drawinglayer::primitive2d::MetafilePrimitive2D( |