summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2014-10-14 15:43:23 +0200
committerDavid Tardon <dtardon@redhat.com>2014-10-14 17:56:24 +0200
commita3dc4db870ac3c08c480131ed18d144e42ec18b2 (patch)
tree2fb94413dd1d7193be81800d6452a186f9965437 /svx
parente19fb51d89fd8fa747594ba7aa3fdac67262f646 (diff)
make sure the denominator is not 0
Change-Id: Ia618379a8d33048b6716f22ad1e5dcbca0bbf307
Diffstat (limited to 'svx')
-rw-r--r--svx/source/unodraw/unoshape.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index c3d17a585557..3fb2591a5e16 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -1219,8 +1219,12 @@ void SAL_CALL SvxShape::setSize( const awt::Size& rSize )
if(mpObj->GetObjInventor() == SdrInventor && mpObj->GetObjIdentifier() == OBJ_MEASURE )
{
- boost::rational<long> aWdt(aLocalSize.Width(),aRect.Right()-aRect.Left());
- boost::rational<long> aHgt(aLocalSize.Height(),aRect.Bottom()-aRect.Top());
+ boost::rational<long> aWdt;
+ if (aRect.Right()-aRect.Left() > 0)
+ aWdt.assign(aLocalSize.Width(),aRect.Right()-aRect.Left());
+ boost::rational<long> aHgt;
+ if (aRect.Bottom()-aRect.Top() > 0)
+ aHgt.assign(aLocalSize.Height(),aRect.Bottom()-aRect.Top());
Point aPt = mpObj->GetSnapRect().TopLeft();
mpObj->Resize(aPt,aWdt,aHgt);
}