[Libreoffice-commits] core.git: svx/source
Caolán McNamara
caolanm at redhat.com
Wed Oct 25 19:33:44 UTC 2017
svx/source/customshapes/EnhancedCustomShapeFontWork.cxx | 5 +++++
1 file changed, 5 insertions(+)
New commits:
commit db4d4bac22d73e93729261739cda06382883b8f8
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Oct 25 14:40:49 2017 +0100
ofz#3801 Divide-by-zero
Change-Id: Ibb2f3e5508899541bc201240a7e9d5f26c750fa5
Reviewed-on: https://gerrit.libreoffice.org/43843
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index dc5693d0ff71..9d4faa31e5aa 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -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();
More information about the Libreoffice-commits
mailing list