summaryrefslogtreecommitdiff
path: root/sd/source/ui/dlg/docprev.cxx
diff options
context:
space:
mode:
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));