vcl/inc/vcl/gdimtf.hxx | 2 +- vcl/source/gdi/gdimtf.cxx | 15 +++++++++------ vcl/source/gdi/pdfwriter_impl2.cxx | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-)
New commits: commit 3553fa71b695c6c354872a77747ac4eb4bbff364 Author: Radek Doulik <[email protected]> Date: Mon Apr 29 00:00:00 2013 +0200 Fix bnc#795857 Use correct sizes for EMF+ bitmap rendering Fix pdf export wrong size issues for embedded EMF+ images. (cherry picked from commit 4c676625d4016d428e9becd5512b7cfc8b0c4b24) Conflicts: vcl/inc/vcl/gdimtf.hxx vcl/source/gdi/gdimtf.cxx Signed-off-by: Michael Meeks <[email protected]> Conflicts: vcl/source/gdi/gdimtf.cxx Change-Id: I998c9535bde32fc9f452d61d7cb7609c95f5528d diff --git a/vcl/inc/vcl/gdimtf.hxx b/vcl/inc/vcl/gdimtf.hxx index ecefb90..90fce69 100644 --- a/vcl/inc/vcl/gdimtf.hxx +++ b/vcl/inc/vcl/gdimtf.hxx @@ -124,7 +124,7 @@ private: const OutputDevice& rMapDev, const PolyPolygon& rPolyPoly, const Gradient& rGrad ); - SAL_DLLPRIVATE bool ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rDestSize ); + SAL_DLLPRIVATE bool ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rLogicDestSize ); SAL_DLLPRIVATE void ImplDelegate2PluggableRenderer( const MetaCommentAction* pAct, OutputDevice* pOut ); diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 42ed63c..172b477 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -399,7 +399,7 @@ void GDIMetaFile::Play( OutputDevice* pOut, size_t nPos ) OSL_TRACE("GDIMetaFile::Play on device of size: %d x %d", pOut->GetOutputSizePixel().Width(), pOut->GetOutputSizePixel().Height()); - if( !ImplPlayWithRenderer( pOut, Point(0,0), pOut->GetOutputSizePixel() ) ) { + if( !ImplPlayWithRenderer( pOut, Point(0,0), pOut->GetOutputSize() ) ) { size_t i = 0; for( size_t nCurPos = nCurrentActionElement; nCurPos < nPos; nCurPos++ ) { @@ -428,13 +428,13 @@ void GDIMetaFile::Play( OutputDevice* pOut, size_t nPos ) } } -// ------------------------------------------------------------------------ - -bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rDestSize ) +bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rLogicDestSize ) { if (!bUseCanvas) return false; + Size rDestSize( pOut->LogicToPixel( rLogicDestSize ) ); + const Window* win = dynamic_cast <Window*> ( pOut ); if (!win) @@ -500,7 +500,10 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S Bitmap aMask( pSalMask ); AlphaMask aAlphaMask( aMask ); BitmapEx aBitmapEx( aBitmap, aAlphaMask ); - pOut->DrawBitmapEx( rPos, aBitmapEx ); + if ( pOut->GetMapMode() == MAP_PIXEL ) + pOut->DrawBitmapEx( rPos, aBitmapEx ); + else + pOut->DrawBitmapEx( rPos, rLogicDestSize, aBitmapEx ); return true; } @@ -606,7 +609,7 @@ void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos, { GDIMetaFile* pMtf = pOut->GetConnectMetaFile(); - if( ImplPlayWithRenderer( pOut, rPos, aDestSize ) ) + if( ImplPlayWithRenderer( pOut, rPos, rSize ) ) return; Size aTmpPrefSize( pOut->LogicToPixel( GetPrefSize(), aDrawMap ) ); diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index beee461..8579168 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -769,7 +769,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa const MetaBmpAction* pA = (const MetaBmpAction*) pAction; BitmapEx aBitmapEx( pA->GetBitmap() ); Size aSize( OutputDevice::LogicToLogic( aBitmapEx.GetPrefSize(), - aBitmapEx.GetPrefMapMode(), pDummyVDev->GetMapMode() ) ); + aBitmapEx.GetPrefMapMode(), pDummyVDev->GetMapMode() ) ); if( ! ( aSize.Width() && aSize.Height() ) ) aSize = pDummyVDev->PixelToLogic( aBitmapEx.GetSizePixel() ); implWriteBitmapEx( pA->GetPoint(), aSize, aBitmapEx, pDummyVDev, i_rContext ); _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
