summaryrefslogtreecommitdiff
path: root/sd/source/ui/dlg/docprev.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-06-10 10:20:53 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-06-10 10:48:43 +0100
commitea93714e9427e6802e843c4585871aeef0a5e28d (patch)
tree758cf0af23f66b150ec12e749c726f45a8244a60 /sd/source/ui/dlg/docprev.cxx
parentd7cd613067dbc07eae0dd1aa5a4a72ae40090325 (diff)
coverity#735616 Division or modulo by float zero
Change-Id: I5aaad2cd80e6930cbca57b4df2bfee3a6989ca41
Diffstat (limited to 'sd/source/ui/dlg/docprev.cxx')
-rw-r--r--sd/source/ui/dlg/docprev.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx
index cd015cdbd285..c939d18e6436 100644
--- a/sd/source/ui/dlg/docprev.cxx
+++ b/sd/source/ui/dlg/docprev.cxx
@@ -90,9 +90,9 @@ void SdDocPreviewWin::CalcSizeAndPos( GDIMetaFile* pFile, Size& rSize, Point& rP
if( nHeight < 0 ) nHeight = 0;
double dRatio=((double)aTmpSize.Width())/aTmpSize.Height();
- double dRatioPreV=((double) nWidth ) / nHeight;
+ double dRatioPreV = nHeight ? (((double) nWidth ) / nHeight) : 0.0;
- if (dRatio>dRatioPreV)
+ if (dRatio > dRatioPreV)
{
rSize=Size(nWidth, (sal_uInt16)(nWidth/dRatio));
rPoint=Point( 0, (sal_uInt16)((nHeight-rSize.Height())/2));