From c46cc5751b5af4ce180fca63f998fe7eb405f93c Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Thu, 29 May 2014 20:45:00 +0200 Subject: [PATCH] cppcheck: zerodiv Change-Id: I09e1c86bdda301c11700ffe05d4a3d83b7a1104d --- sd/source/ui/dlg/docprev.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx index cd015cdbd285..4c4293ce0f54 100644 --- a/sd/source/ui/dlg/docprev.cxx +++ b/sd/source/ui/dlg/docprev.cxx @@ -87,7 +87,7 @@ void SdDocPreviewWin::CalcSizeAndPos( GDIMetaFile* pFile, Size& rSize, Point& rP long nWidth = rSize.Width() - 2*FRAME; long nHeight = rSize.Height() - 2*FRAME; if( nWidth < 0 ) nWidth = 0; - if( nHeight < 0 ) nHeight = 0; + if( nHeight < 0 ) nHeight = 1; double dRatio=((double)aTmpSize.Width())/aTmpSize.Height(); double dRatioPreV=((double) nWidth ) / nHeight;