From 19cda6c79c6e2f2c77a6ec25fcd28e4c1bea5268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 12 Feb 2014 09:50:32 +0000 Subject: [PATCH] coverity#1103661 Division or modulo by zero Change-Id: I1506e4e0b1dccac1e9f3dc3094268eaa89d3f6be --- svx/source/dialog/connctrl.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx index 7ed4c8644eb2..677cba81cb2f 100644 --- a/svx/source/dialog/connctrl.cxx +++ b/svx/source/dialog/connctrl.cxx @@ -77,10 +77,12 @@ void SvxXConnectionPreview::AdaptSize() // Adapt size if( pObjList ) { - SetMapMode( MAP_100TH_MM ); - - OutputDevice* pOD = pView->GetFirstOutputDevice(); // GetWin( 0 ); Rectangle aRect = pObjList->GetAllObjBoundRect(); + if (aRect.GetHeight() == 0 || aRect.GetHeight() == 0) + return; + + SetMapMode( MAP_100TH_MM ); + OutputDevice* pOD = pView->GetFirstOutputDevice(); // GetWin( 0 ); MapMode aMapMode = GetMapMode(); aMapMode.SetMapUnit( pOD->GetMapMode().GetMapUnit() );