summaryrefslogtreecommitdiff
path: root/emfio
diff options
context:
space:
mode:
Diffstat (limited to 'emfio')
-rw-r--r--emfio/source/reader/emfreader.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx
index 08df186dd4ae..7411efc56b3b 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -1470,10 +1470,12 @@ namespace emfio
ReadDIB(aBitmap, aTmp, true);
// test if it is sensible to crop
- if ( ( cxSrc > 0 ) && ( cySrc > 0 ) &&
- ( xSrc >= 0 ) && ( ySrc >= 0 ) &&
- ( xSrc + cxSrc <= aBitmap.GetSizePixel().Width() ) &&
- ( ySrc + cySrc <= aBitmap.GetSizePixel().Height() ) )
+ if ( (cxSrc > 0) && (cySrc > 0) &&
+ (xSrc >= 0) && (ySrc >= 0) &&
+ (aBitmap.GetSizePixel().Width() >= cxSrc) &&
+ (xSrc <= aBitmap.GetSizePixel().Width() - cxSrc) &&
+ (aBitmap.GetSizePixel().Height() >= cySrc) &&
+ (ySrc <= aBitmap.GetSizePixel().Height() - cySrc) )
{
tools::Rectangle aCropRect( Point( xSrc, ySrc ), Size( cxSrc, cySrc ) );
aBitmap.Crop( aCropRect );