From 26bd210ccd6033cf5d06a2de35047757d8f7a6e7 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 20 Jan 2015 15:14:58 +0000 Subject: Related: ooo#34420-1.sxi concealed divide by zero on this and about 30 other documents where the NaN result is cast back to a long, giving rise to an assert in vcl/source/outdev/map.cxx:391 of long int ImplLogicToPixel(long int, long int, long int, long int, long int): Assertion `std::abs(n) < std::numeric_limits::max() / nMapNum / nDPI' failed. Change-Id: Ia87e4ee6bbf0f10b7eba513e9a5ba3c42440d181 --- sd/source/ui/view/outlview.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index c7e150882862..48402965674f 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -1723,8 +1723,11 @@ IMPL_LINK(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo) Size aOutSize( 2000, nBulletHeight ); const float fImageHeight = ((float)aOutSize.Height() * (float)4) / (float)7; - const float fImageRatio = (float)aImageSize.Height() / (float)aImageSize.Width(); - aImageSize.Width() = (long)( fImageRatio * fImageHeight ); + if (aImageSize.Width() != 0) + { + const float fImageRatio = (float)aImageSize.Height() / (float)aImageSize.Width(); + aImageSize.Width() = (long)( fImageRatio * fImageHeight ); + } aImageSize.Height() = (long)( fImageHeight ); Point aImagePos( pInfo->mrStartPos ); -- cgit