coverity#735616 Division or modulo by float zero
Change-Id: I5aaad2cd80e6930cbca57b4df2bfee3a6989ca41
This commit is contained in:
@@ -90,9 +90,9 @@ void SdDocPreviewWin::CalcSizeAndPos( GDIMetaFile* pFile, Size& rSize, Point& rP
|
|||||||
if( nHeight < 0 ) nHeight = 0;
|
if( nHeight < 0 ) nHeight = 0;
|
||||||
|
|
||||||
double dRatio=((double)aTmpSize.Width())/aTmpSize.Height();
|
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));
|
rSize=Size(nWidth, (sal_uInt16)(nWidth/dRatio));
|
||||||
rPoint=Point( 0, (sal_uInt16)((nHeight-rSize.Height())/2));
|
rPoint=Point( 0, (sal_uInt16)((nHeight-rSize.Height())/2));
|
||||||
|
Reference in New Issue
Block a user