[Libreoffice-commits] core.git: filter/source
Caolán McNamara
caolanm at redhat.com
Tue Oct 31 15:34:47 UTC 2017
filter/source/graphicfilter/icgm/actimpr.cxx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit f550ed4db708bd892b75bead4731bd67d30a8949
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 31 08:57:01 2017 +0000
ofz#3932 Divide-by-zero
Change-Id: I912e082826f8433254edafe146bf5e746fdf914a
Reviewed-on: https://gerrit.libreoffice.org/44100
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/filter/source/graphicfilter/icgm/actimpr.cxx b/filter/source/graphicfilter/icgm/actimpr.cxx
index a5cff6dab0d6..155ad22208d9 100644
--- a/filter/source/graphicfilter/icgm/actimpr.cxx
+++ b/filter/source/graphicfilter/icgm/actimpr.cxx
@@ -755,7 +755,8 @@ void CGMImpressOutAct::DrawText( awt::Point const & rTextPos, awt::Size& rTextSi
maXShape->setSize( awt::Size( nWidth, nHeight ) );
double nX = mpCGM->pElement->nCharacterOrientation[ 2 ];
double nY = mpCGM->pElement->nCharacterOrientation[ 3 ];
- double nOrientation = acos( nX / sqrt( nX * nX + nY * nY ) ) * 57.29577951308;
+ double fSqrt = sqrt(nX * nX + nY * nY);
+ double nOrientation = fSqrt != 0.0 ? (acos(nX / fSqrt) * 57.29577951308) : 0.0;
if ( nY < 0 )
nOrientation = 360 - nOrientation;
More information about the Libreoffice-commits
mailing list