diff options
Diffstat (limited to 'filter/source/pdf/pdfdecomposer.cxx')
-rw-r--r-- | filter/source/pdf/pdfdecomposer.cxx | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/filter/source/pdf/pdfdecomposer.cxx b/filter/source/pdf/pdfdecomposer.cxx index f861b4eaf86e..998f73dc1160 100644 --- a/filter/source/pdf/pdfdecomposer.cxx +++ b/filter/source/pdf/pdfdecomposer.cxx @@ -10,7 +10,7 @@ #include <vector> #include <basegfx/matrix/b2dhommatrixtools.hxx> -#include <cppuhelper/implbase2.hxx> +#include <cppuhelper/implbase.hxx> #include <cppuhelper/supportsservice.hxx> #include <drawinglayer/primitive2d/bitmapprimitive2d.hxx> #include <drawinglayer/primitive2d/Primitive2DContainer.hxx> @@ -32,8 +32,7 @@ using namespace css; namespace { /// Class to convert the PDF data into a XPrimitive2D (containing only a bitmap). -class XPdfDecomposer - : public ::cppu::WeakAggImplHelper2<graphic::XPdfDecomposer, lang::XServiceInfo> +class XPdfDecomposer : public ::cppu::WeakImplHelper<graphic::XPdfDecomposer, lang::XServiceInfo> { public: explicit XPdfDecomposer(uno::Reference<uno::XComponentContext> const& context); @@ -82,17 +81,16 @@ XPdfDecomposer::getDecomposition(const uno::Reference<util::XBinaryDataContainer BitmapEx aReplacement(aBitmaps[0]); // short form for scale and translate transformation - const Size aDPI( - Application::GetDefaultDevice()->LogicToPixel(Size(1, 1), MapMode(MapUnit::MapInch))); const Size aBitmapSize(aReplacement.GetSizePixel()); + // ImpGraphic::getPrefMapMode() requires mm100 for bitmaps rendered from vector graphic data. + const Size aMM100( + Application::GetDefaultDevice()->PixelToLogic(aBitmapSize, MapMode(MapUnit::Map100thMM))); const basegfx::B2DHomMatrix aBitmapTransform(basegfx::utils::createScaleTranslateB2DHomMatrix( - aBitmapSize.getWidth() * aDPI.getWidth(), aBitmapSize.getHeight() * aDPI.getHeight(), 0, - 0)); + aMM100.getWidth(), aMM100.getHeight(), 0, 0)); // create primitive return drawinglayer::primitive2d::Primitive2DContainer{ - new drawinglayer::primitive2d::BitmapPrimitive2D( - VCLUnoHelper::CreateVCLXBitmap(aReplacement), aBitmapTransform) + new drawinglayer::primitive2d::BitmapPrimitive2D(aReplacement, aBitmapTransform) } .toSequence(); } |