diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-06-10 10:20:53 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-10 10:48:43 +0100 |
commit | ea93714e9427e6802e843c4585871aeef0a5e28d (patch) | |
tree | 758cf0af23f66b150ec12e749c726f45a8244a60 /sd/source | |
parent | d7cd613067dbc07eae0dd1aa5a4a72ae40090325 (diff) |
coverity#735616 Division or modulo by float zero
Change-Id: I5aaad2cd80e6930cbca57b4df2bfee3a6989ca41
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/dlg/docprev.cxx | 4 |
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)); |