Kaydet (Commit) e19fb51d authored tarafından David Tardon's avatar David Tardon

make sure the denominator is not 0

Change-Id: Ic32e0f354bb290ad77f1d7709bee89858e1889b7
üst ad1f796b
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <algorithm>
#include <editeng/eeitem.hxx> #include <editeng/eeitem.hxx>
#include "svx/svdstr.hrc" #include "svx/svdstr.hrc"
...@@ -478,8 +480,8 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co ...@@ -478,8 +480,8 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co
// account for FitToSize // account for FitToSize
bool bFitToSize(pTextObj->IsFitToSize()); bool bFitToSize(pTextObj->IsFitToSize());
if (bFitToSize) { if (bFitToSize) {
boost::rational<long> aX(aTextRect.GetWidth()-1,aAnchor.GetWidth()-1); boost::rational<long> aX(aTextRect.GetWidth()-1, std::max(aAnchor.GetWidth()-1, 1L));
boost::rational<long> aY(aTextRect.GetHeight()-1,aAnchor.GetHeight()-1); boost::rational<long> aY(aTextRect.GetHeight()-1, std::max(aAnchor.GetHeight()-1, 1L));
ResizePoint(aTemporaryTextRelativePosition,Point(),aX,aY); ResizePoint(aTemporaryTextRelativePosition,Point(),aX,aY);
} }
// account for rotation // account for rotation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment