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

ofz#3801 Divide-by-zero

Change-Id: Ibb2f3e5508899541bc201240a7e9d5f26c750fa5
Reviewed-on: https://gerrit.libreoffice.org/43843Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 933b66c1
......@@ -691,6 +691,11 @@ void FitTextOutlinesToShapeOutlines( const tools::PolyPolygon& aOutlines2d, FWDa
double fAngle = atan2( -fvx, -fvy );
double fL = hypot( fvx, fvy );
if (fL == 0.0)
{
SAL_WARN("svx", "FitTextOutlinesToShapeOutlines div-by-zero, abandon fit");
break;
}
fvx = fvx / fL;
fvy = fvy / fL;
fL = aTextAreaIter->aBoundRect.GetHeight() / 2.0 + aTextAreaIter->aBoundRect.Top() - aParagraphIter->aBoundRect.Center().Y();
......
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