diff options
author | Radek Doulik <rodo@novell.com> | 2013-04-29 00:00:00 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-06-11 17:40:43 +0100 |
commit | 3553fa71b695c6c354872a77747ac4eb4bbff364 (patch) | |
tree | f5080ae6266009993d2cc0b006a77d94dad694ac /vcl/source | |
parent | 8f50adc18112877214495e723976f18fa41cc18d (diff) |
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 <michael.meeks@suse.com>
Conflicts:
vcl/source/gdi/gdimtf.cxx
Change-Id: I998c9535bde32fc9f452d61d7cb7609c95f5528d
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/gdi/gdimtf.cxx | 15 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl2.cxx | 2 |
2 files changed, 10 insertions, 7 deletions
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 42ed63c0cd31..172b477f7b76 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 beee4613e3c7..8579168a2c07 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 ); |