diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2013-09-27 23:32:53 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2013-09-27 23:32:53 +0200 |
commit | 9fb9b057d65b07fcd037b31505561c5b3fe9939c (patch) | |
tree | aaac894769953320c0d07a5e06f712ef52f8b989 /filter | |
parent | 32095947489f10898c87a22162abdfdeaabda8fe (diff) |
cppcheck: avoid possible division by 0
Change-Id: I8ff8e72d0d25168da374d752a18210cf764ed311
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/graphicfilter/icgm/class4.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/filter/source/graphicfilter/icgm/class4.cxx b/filter/source/graphicfilter/icgm/class4.cxx index 8899d73a8951..71ccf320abba 100644 --- a/filter/source/graphicfilter/icgm/class4.cxx +++ b/filter/source/graphicfilter/icgm/class4.cxx @@ -371,11 +371,10 @@ void CGM::ImplDoClass4() double fG = 2.0 * ( fA * ( aEndingPoint.Y - aIntermediatePoint.Y ) - fB * ( aEndingPoint.X - aIntermediatePoint.X ) ); - aCenterPoint.X = ( fD * fE - fB * fF ) / fG; - aCenterPoint.Y = ( fA * fF - fC * fE ) / fG; - if ( fG != 0 ) { + aCenterPoint.X = ( fD * fE - fB * fF ) / fG; + aCenterPoint.Y = ( fA * fF - fC * fE ) / fG; double fStartAngle = ImplGetOrientation( aCenterPoint, aStartingPoint ); double fInterAngle = ImplGetOrientation( aCenterPoint, aIntermediatePoint ); double fEndAngle = ImplGetOrientation( aCenterPoint, aEndingPoint ); @@ -445,11 +444,10 @@ void CGM::ImplDoClass4() double fG = 2.0 * ( fA * ( aEndingPoint.Y - aIntermediatePoint.Y ) - fB * ( aEndingPoint.X - aIntermediatePoint.X ) ); - aCenterPoint.X = ( fD * fE - fB * fF ) / fG; - aCenterPoint.Y = ( fA * fF - fC * fE ) / fG; - if ( fG != 0 ) { + aCenterPoint.X = ( fD * fE - fB * fF ) / fG; + aCenterPoint.Y = ( fA * fF - fC * fE ) / fG; double fStartAngle = ImplGetOrientation( aCenterPoint, aStartingPoint ); double fInterAngle = ImplGetOrientation( aCenterPoint, aIntermediatePoint ); double fEndAngle = ImplGetOrientation( aCenterPoint, aEndingPoint ); |