diff options
author | David Tardon <dtardon@redhat.com> | 2014-10-14 15:36:26 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2014-10-14 17:56:23 +0200 |
commit | e19fb51d89fd8fa747594ba7aa3fdac67262f646 (patch) | |
tree | 2c0bb5296cda13f9231dd1114bfcfdc0ad2a4679 | |
parent | ad1f796b1dc710a02ade17c95e99d11412f1280a (diff) |
make sure the denominator is not 0
Change-Id: Ic32e0f354bb290ad77f1d7709bee89858e1889b7
-rw-r--r-- | svx/source/svdraw/svdview.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index e3a50cd0135e..19f9834cb14c 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <algorithm> + #include <editeng/eeitem.hxx> #include "svx/svdstr.hrc" @@ -478,8 +480,8 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co // account for FitToSize bool bFitToSize(pTextObj->IsFitToSize()); if (bFitToSize) { - boost::rational<long> aX(aTextRect.GetWidth()-1,aAnchor.GetWidth()-1); - boost::rational<long> aY(aTextRect.GetHeight()-1,aAnchor.GetHeight()-1); + boost::rational<long> aX(aTextRect.GetWidth()-1, std::max(aAnchor.GetWidth()-1, 1L)); + boost::rational<long> aY(aTextRect.GetHeight()-1, std::max(aAnchor.GetHeight()-1, 1L)); ResizePoint(aTemporaryTextRelativePosition,Point(),aX,aY); } // account for rotation |