summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-01-25 13:33:39 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-01-28 06:44:39 +0000
commitc06238f28209402a9cbcc2471dd713de0db0fb4b (patch)
tree664de4b72d51f792eff60b009a85d7c9597b0ca1 /svx
parent556ce647aacc635ea05bd6d6e030d93d341b5624 (diff)
loplugin:fpcomparison in svx/
Change-Id: I636dcdd51389f31eeb14cd1eb9a82a89599d3eea Reviewed-on: https://gerrit.libreoffice.org/21777 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFontWork.cxx2
-rw-r--r--svx/source/dialog/framelink.cxx16
-rw-r--r--svx/source/toolbars/extrusionbar.cxx8
3 files changed, 13 insertions, 13 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index 55d95ee29c69..0e33369408e3 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -616,7 +616,7 @@ void GetPoint( const tools::Polygon& rPoly, const std::vector< double >& rDistan
const Point& rPt = rPoly[ nIdx ];
fx1 = rPt.X();
fy1 = rPt.Y();
- if ( nIdx && ( aIter != rDistances.end() ) && ( *aIter != fX ) )
+ if ( nIdx && ( aIter != rDistances.end() ) && !rtl::math::approxEqual( *aIter, fX ) )
{
nIdx = sal::static_int_cast<sal_uInt16>( std::distance( rDistances.begin(), aIter ) );
double fDist0 = *( aIter - 1 );
diff --git a/svx/source/dialog/framelink.cxx b/svx/source/dialog/framelink.cxx
index 43bb94ac824b..3938701e9967 100644
--- a/svx/source/dialog/framelink.cxx
+++ b/svx/source/dialog/framelink.cxx
@@ -371,7 +371,7 @@ void lclLinkLeftEnd_Single(
// both vertical frame borders are double
if( rLFromT.Secn() && rLFromB.Secn() )
{
- rResult.mnOffs1 = (!rLFromTR.Secn() && !rLFromBR.Secn() && (rLFromT.GetWidth() == rLFromB.GetWidth())) ?
+ rResult.mnOffs1 = (!rLFromTR.Secn() && !rLFromBR.Secn() && rtl::math::approxEqual(rLFromT.GetWidth(), rLFromB.GetWidth())) ?
// don't overdraw vertical borders with equal width
lclGetBehindEnd( rLFromT ) :
// take leftmost start of both secondary lines (#46488#)
@@ -379,14 +379,14 @@ void lclLinkLeftEnd_Single(
}
// single border with equal width coming from left
- else if( !rLFromL.Secn() && (rLFromL.Prim() == rBorder.Prim()) )
+ else if( !rLFromL.Secn() && rtl::math::approxEqual(rLFromL.Prim(), rBorder.Prim()) )
// draw to connection point
rResult.mnOffs1 = 0;
// single border coming from left
else if( !rLFromL.Secn() && rLFromL.Prim() )
{
- if( rLFromL.Prim() == rBorder.Prim() )
+ if( rtl::math::approxEqual(rLFromL.Prim(), rBorder.Prim()) )
// draw to reference position, if from left has equal width
rResult.mnOffs1 = 0;
else
@@ -400,7 +400,7 @@ void lclLinkLeftEnd_Single(
// no border coming from left
else if( !rLFromL.Prim() )
// don't overdraw vertical borders with equal width
- rResult.mnOffs1 = (rLFromT.GetWidth() == rLFromB.GetWidth()) ?
+ rResult.mnOffs1 = rtl::math::approxEqual(rLFromT.GetWidth(), rLFromB.GetWidth()) ?
lclGetBehindEnd( rLFromT ) :
std::min( lclGetBeg( rLFromT ), lclGetBeg( rLFromB ) );
@@ -457,7 +457,7 @@ void lclLinkLeftEnd_Prim(
// double frame border coming from left (from top is not double)
else if( rLFromL.Secn() )
// do not overdraw single frame border coming from top
- rResult.mnOffs1 = (rLFromL.GetWidth() == rBorder.GetWidth()) ?
+ rResult.mnOffs1 = rtl::math::approxEqual(rLFromL.GetWidth(), rBorder.GetWidth()) ?
0 : lclGetBehindEnd( rLFromT );
// double frame border coming from bottom (from top and from left are not double)
@@ -500,7 +500,7 @@ void lclLinkLeftEnd_Gap(
if ( rLFromT.Secn() )
rResult.mnOffs1 = lclGetDistBeg( rLFromT );
else if ( rLFromL.Secn( ) )
- rResult.mnOffs1 = ( rLFromL.GetWidth() == rBorder.GetWidth() )?
+ rResult.mnOffs1 = rtl::math::approxEqual( rLFromL.GetWidth(), rBorder.GetWidth() ) ?
0 : lclGetBehindEnd( rLFromT );
else if ( rLFromB.Secn( ) )
rResult.mnOffs1 = lclGetDistBeg( rLFromB );
@@ -1284,13 +1284,13 @@ bool operator<( const Style& rL, const Style& rR )
// different total widths -> rL<rR, if rL is thinner
double nLW = rL.GetWidth();
double nRW = rR.GetWidth();
- if( nLW != nRW ) return nLW < nRW;
+ if( !rtl::math::approxEqual(nLW, nRW) ) return nLW < nRW;
// one line double, the other single -> rL<rR, if rL is single
if( (rL.Secn() == 0) != (rR.Secn() == 0) ) return rL.Secn() == 0;
// both lines double with different distances -> rL<rR, if distance of rL greater
- if( (rL.Secn() && rR.Secn()) && (rL.Dist() != rR.Dist()) ) return rL.Dist() > rR.Dist();
+ if( (rL.Secn() && rR.Secn()) && !rtl::math::approxEqual(rL.Dist(), rR.Dist()) ) return rL.Dist() > rR.Dist();
// both lines single and 1 unit thick, only one is dotted -> rL<rR, if rL is dotted
if( (nLW == 1) && (rL.Type() != rR.Type()) ) return rL.Type();
diff --git a/svx/source/toolbars/extrusionbar.cxx b/svx/source/toolbars/extrusionbar.cxx
index b364f051daa4..de176d908742 100644
--- a/svx/source/toolbars/extrusionbar.cxx
+++ b/svx/source/toolbars/extrusionbar.cxx
@@ -748,16 +748,16 @@ void getExtrusionDirectionState( SdrView* pSdrView, SfxItemSet& rSet )
}
}
- if( fFinalSkewAngle == -1.0 )
+ if( rtl::math::approxEqual(fFinalSkewAngle, -1.0) )
{
fFinalSkewAngle = fSkewAngle;
}
- else if( fSkewAngle != fFinalSkewAngle )
+ else if( !rtl::math::approxEqual(fSkewAngle, fFinalSkewAngle) )
{
fFinalSkewAngle = -1.0;
}
- if( fFinalSkewAngle == -1.0 )
+ if( rtl::math::approxEqual(fFinalSkewAngle, -1.0) )
break;
}
}
@@ -956,7 +956,7 @@ void getExtrusionDepthState( SdrView* pSdrView, SfxItemSet& rSet )
{
fFinalDepth = fDepth;
}
- else if( fFinalDepth != fDepth )
+ else if( !rtl::math::approxEqual(fFinalDepth, fDepth) )
{
fFinalDepth = -1;
break;