diff options
Diffstat (limited to 'cppcanvas/source/mtfrenderer/emfplus.cxx')
-rw-r--r-- | cppcanvas/source/mtfrenderer/emfplus.cxx | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index 30090a96cf14..dfb7c34e70fa 100644 --- a/cppcanvas/source/mtfrenderer/emfplus.cxx +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -1417,20 +1417,24 @@ namespace cppcanvas aBmp.Crop( aCropRect ); - ActionSharedPtr pBmpAction ( - internal::BitmapActionFactory::createBitmapAction ( - aBmp, - rState.mapModeTransform * Map (x1, y1), - rState.mapModeTransform * MapSize(x2 - x1, y3 - y1), - rCanvas, - rState)); - - if( pBmpAction ) { - maActions.push_back( MtfAction( pBmpAction, - rFactoryParms.mrCurrActionIndex ) ); - - rFactoryParms.mrCurrActionIndex += pBmpAction->getActionCount()-1; - } + Size aSize( aBmp.GetSizePixel() ); + if( aSize.Width() > 0 && aSize.Height() > 0 ) { + ActionSharedPtr pBmpAction ( + internal::BitmapActionFactory::createBitmapAction ( + aBmp, + rState.mapModeTransform * Map (x1, y1), + rState.mapModeTransform * MapSize(x2 - x1, y3 - y1), + rCanvas, + rState)); + + if( pBmpAction ) { + maActions.push_back( MtfAction( pBmpAction, + rFactoryParms.mrCurrActionIndex ) ); + + rFactoryParms.mrCurrActionIndex += pBmpAction->getActionCount()-1; + } + } else + EMFP_DEBUG (printf ("EMF+ warning: empty bitmap\n")); } else { EMFP_DEBUG (printf ("EMF+ DrawImagePoints TODO (fixme)\n")); } |