coverity#735616 Division or modulo by float zero

Change-Id: I5aaad2cd80e6930cbca57b4df2bfee3a6989ca41
This commit is contained in:
Caolán McNamara
2014-06-10 10:20:53 +01:00
parent d7cd613067
commit ea93714e94

View File

@@ -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));