diff options
Diffstat (limited to 'oox/source/drawingml/fillproperties.cxx')
-rw-r--r-- | oox/source/drawingml/fillproperties.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index 21c7d84d1309..f10be4556610 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -98,7 +98,15 @@ void lclCalculateCropPercentage(uno::Reference<graphic::XGraphic> const & xGraph sal_Int32 nScaledHeight = aBitmapEx.GetSizePixel().Height(); sal_Int32 nOrigWidth = (nScaledWidth * (100000 - aFillRect.X1 - aFillRect.X2)) / 100000; + if (nOrigWidth == 0) + { + nOrigWidth = 1; + } sal_Int32 nOrigHeight = (nScaledHeight * (100000 - aFillRect.Y1 - aFillRect.Y2)) / 100000; + if (nOrigHeight == 0) + { + nOrigHeight = 1; + } sal_Int32 nLeftPercentage = nScaledWidth * aFillRect.X1 / nOrigWidth; sal_Int32 nRightPercentage = nScaledWidth * aFillRect.X2 / nOrigWidth; |