diff options
author | Noel Grandin <noel@peralex.com> | 2016-01-25 13:33:39 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-01-28 06:44:39 +0000 |
commit | c06238f28209402a9cbcc2471dd713de0db0fb4b (patch) | |
tree | 664de4b72d51f792eff60b009a85d7c9597b0ca1 /svx/source/dialog | |
parent | 556ce647aacc635ea05bd6d6e030d93d341b5624 (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/source/dialog')
-rw-r--r-- | svx/source/dialog/framelink.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
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(); |