Kaydet (Commit) f69067fd authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1244939 Division or modulo by float zero

and

coverity#1244938 Division or modulo by float zero

Change-Id: I128b1ac10f514285152cf189af24885460c9c5ca
üst f089b4fb
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <editeng/outlobj.hxx> #include <editeng/outlobj.hxx>
#include <editeng/editobj.hxx> #include <editeng/editobj.hxx>
#include <editeng/editeng.hxx> #include <editeng/editeng.hxx>
#include <o3tl/numeric.hxx>
#include <svx/svdmodel.hxx> #include <svx/svdmodel.hxx>
#include <vector> #include <vector>
#include <numeric> #include <numeric>
...@@ -741,8 +742,12 @@ void FitTextOutlinesToShapeOutlines( const tools::PolyPolygon& aOutlines2d, FWDa ...@@ -741,8 +742,12 @@ void FitTextOutlinesToShapeOutlines( const tools::PolyPolygon& aOutlines2d, FWDa
InsertMissingOutlinePoints( rOutlinePoly, vDistances, rTextAreaBoundRect, aLocalPoly ); InsertMissingOutlinePoints( rOutlinePoly, vDistances, rTextAreaBoundRect, aLocalPoly );
InsertMissingOutlinePoints( rOutlinePoly2, vDistances2, rTextAreaBoundRect, aLocalPoly ); InsertMissingOutlinePoints( rOutlinePoly2, vDistances2, rTextAreaBoundRect, aLocalPoly );
sal_uInt16 j, _nPointCount = aLocalPoly.GetSize(); sal_uInt16 _nPointCount = aLocalPoly.GetSize();
for ( j = 0; j < _nPointCount; j++ ) if (_nPointCount)
{
if (!nWidth || !nHeight)
throw o3tl::divide_by_zero();
for (sal_uInt16 j = 0; j < _nPointCount; ++j)
{ {
Point& rPoint = aLocalPoly[ j ]; Point& rPoint = aLocalPoly[ j ];
rPoint.X() -= nLeft; rPoint.X() -= nLeft;
...@@ -758,6 +763,7 @@ void FitTextOutlinesToShapeOutlines( const tools::PolyPolygon& aOutlines2d, FWDa ...@@ -758,6 +763,7 @@ void FitTextOutlinesToShapeOutlines( const tools::PolyPolygon& aOutlines2d, FWDa
rPoint.X() = (sal_Int32)( fx1 + fWidth * fY ); rPoint.X() = (sal_Int32)( fx1 + fWidth * fY );
rPoint.Y() = (sal_Int32)( fy1 + fHeight* fY ); rPoint.Y() = (sal_Int32)( fy1 + fHeight* fY );
} }
}
// write back polygon // write back polygon
rPolyPoly[ i ] = aLocalPoly; rPolyPoly[ i ] = aLocalPoly;
......
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