Kaydet (Commit) 48966f93 authored tarafından Vladimir Glazounov's avatar Vladimir Glazounov

INTEGRATION: CWS vcl90 (1.40.54); FILE MERGED

2008/06/18 18:36:07 pl 1.40.54.2: RESYNC: (1.40-1.41); FILE MERGED
2008/06/03 16:02:18 pl 1.40.54.1: #i88744# catch a problem with the scale reduction trick
üst 60ec6e4a
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite * OpenOffice.org - a multi-platform office productivity suite
* *
* $RCSfile: outdev2.cxx,v $ * $RCSfile: outdev2.cxx,v $
* $Revision: 1.42 $ * $Revision: 1.43 $
* *
* This file is part of OpenOffice.org. * This file is part of OpenOffice.org.
* *
...@@ -680,6 +680,15 @@ void OutputDevice::ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize, ...@@ -680,6 +680,15 @@ void OutputDevice::ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
{ {
if( meOutDevType == OUTDEV_WINDOW || if( meOutDevType == OUTDEV_WINDOW ||
(meOutDevType == OUTDEV_VIRDEV && mpPDFWriter == 0 ) ) (meOutDevType == OUTDEV_VIRDEV && mpPDFWriter == 0 ) )
{
// #i81576# do the following trick only if there is overlap at all
// else the formulae don't work
// theoretically in this case we wouldn't need to draw the bitmap at all
// however there are some esoteric case where that is needed
if( aPosAry.mnDestX + aPosAry.mnDestWidth >= 0
&& aPosAry.mnDestX < mnOutWidth
&& aPosAry.mnDestY + aPosAry.mnDestHeight >= 0
&& aPosAry.mnDestY < mnOutHeight )
{ {
// reduce scaling to something reasonable taking into account the output size // reduce scaling to something reasonable taking into account the output size
if( aPosAry.mnDestWidth > 3*mnOutWidth && aPosAry.mnSrcWidth ) if( aPosAry.mnDestWidth > 3*mnOutWidth && aPosAry.mnSrcWidth )
...@@ -692,7 +701,7 @@ void OutputDevice::ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize, ...@@ -692,7 +701,7 @@ void OutputDevice::ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
} }
if( aPosAry.mnDestX < 0 ) if( aPosAry.mnDestX < 0 )
{ {
aPosAry.mnDestWidth = Max(long(0),aPosAry.mnDestWidth+aPosAry.mnDestX); aPosAry.mnDestWidth += aPosAry.mnDestX;
aPosAry.mnSrcX -= sal::static_int_cast<long>(aPosAry.mnDestX / nScaleX); aPosAry.mnSrcX -= sal::static_int_cast<long>(aPosAry.mnDestX / nScaleX);
aPosAry.mnDestX = 0; aPosAry.mnDestX = 0;
} }
...@@ -710,7 +719,7 @@ void OutputDevice::ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize, ...@@ -710,7 +719,7 @@ void OutputDevice::ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
} }
if( aPosAry.mnDestY < 0 ) if( aPosAry.mnDestY < 0 )
{ {
aPosAry.mnDestHeight = Max(long(0),aPosAry.mnDestHeight+aPosAry.mnDestY); aPosAry.mnDestHeight += aPosAry.mnDestY;
aPosAry.mnSrcY -= sal::static_int_cast<long>(aPosAry.mnDestY / nScaleY); aPosAry.mnSrcY -= sal::static_int_cast<long>(aPosAry.mnDestY / nScaleY);
aPosAry.mnDestY = 0; aPosAry.mnDestY = 0;
} }
...@@ -719,6 +728,7 @@ void OutputDevice::ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize, ...@@ -719,6 +728,7 @@ void OutputDevice::ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize,
} }
} }
} }
}
if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight ) if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight )
mpGraphics->DrawBitmap( &aPosAry, *aBmp.ImplGetImpBitmap()->ImplGetSalBitmap(), this ); mpGraphics->DrawBitmap( &aPosAry, *aBmp.ImplGetImpBitmap()->ImplGetSalBitmap(), this );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment