diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-02-27 11:56:16 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-02-27 12:58:52 +0000 |
commit | 95ab91d0fb172f8c7692cb043dfd6b079f319601 (patch) | |
tree | 713b84dec1ec918db1451ee05bf05641142e416c /svx/source/dialog/connctrl.cxx | |
parent | 1f8c2a2e5c8bda6e6e35a868e5ac7afdc7d32317 (diff) |
coverity#1103661 Division or modulo by zero
Change-Id: Iebcd567b79b77c456b347d5fae6331072ad38a9f
Diffstat (limited to 'svx/source/dialog/connctrl.cxx')
-rw-r--r-- | svx/source/dialog/connctrl.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx index 050ac45158cc..ef36f72aabd8 100644 --- a/svx/source/dialog/connctrl.cxx +++ b/svx/source/dialog/connctrl.cxx @@ -78,12 +78,10 @@ void SvxXConnectionPreview::AdaptSize() // Adapt size if( pObjList ) { - Rectangle aRect = pObjList->GetAllObjBoundRect(); - if (aRect.GetHeight() == 0 || aRect.GetHeight() == 0) - return; - SetMapMode( MAP_100TH_MM ); + OutputDevice* pOD = pView->GetFirstOutputDevice(); // GetWin( 0 ); + Rectangle aRect = pObjList->GetAllObjBoundRect(); MapMode aMapMode = GetMapMode(); aMapMode.SetMapUnit( pOD->GetMapMode().GetMapUnit() ); @@ -95,7 +93,11 @@ void SvxXConnectionPreview::AdaptSize() const Size aWinSize = PixelToLogic( GetOutputSizePixel(), aDisplayMap ); const long nWidth = aWinSize.Width(); const long nHeight = aWinSize.Height(); + if (aRect.GetHeight() == 0) + return; double fRectWH = (double) aRect.GetWidth() / aRect.GetHeight(); + if (nHeight == 0) + return; double fWinWH = (double) nWidth / nHeight; // Adapt bitmap to Thumb size (not here!) |