diff options
-rw-r--r-- | emfio/source/reader/emfreader.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx index cfcb6e3feea5..bcd8b7a83855 100644 --- a/emfio/source/reader/emfreader.cxx +++ b/emfio/source/reader/emfreader.cxx @@ -1413,14 +1413,17 @@ 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 ); } + maBmpSaveList.emplace_back(new BSaveStruct(aBitmap, aRect, dwRop)); } } |