[Libreoffice-commits] core.git: sw/source
Noel Grandin
noel at peralex.com
Wed Jan 27 06:44:23 PST 2016
sw/source/core/layout/paintfrm.cxx | 10 +++++-----
sw/source/filter/html/htmlforw.cxx | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
New commits:
commit dd7cc8bfe9375ef6e9a3a0bb6e828455443b4f19
Author: Noel Grandin <noel at peralex.com>
Date: Mon Jan 25 13:33:30 2016 +0200
loplugin:fpcomparison in sw/
Change-Id: Icce2ecee0c47fbbddb4fca72d724cbc770b52606
Reviewed-on: https://gerrit.libreoffice.org/21776
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index c982844..07d0bc0 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -545,9 +545,9 @@ lcl_TryMergeBorderLine(BorderLinePrimitive2D const& rThis,
double otherWidth = rOther.getEnd().getX() - rOther.getStart().getX();
// check for same orientation, same line width, same style and matching colors
if ( ((thisHeight > thisWidth) == (otherHeight > otherWidth))
- && (rThis.getLeftWidth() == rOther.getLeftWidth())
- && (rThis.getDistance() == rOther.getDistance())
- && (rThis.getRightWidth() == rOther.getRightWidth())
+ && (rtl::math::approxEqual(rThis.getLeftWidth(), rOther.getLeftWidth()))
+ && (rtl::math::approxEqual(rThis.getDistance(), rOther.getDistance()))
+ && (rtl::math::approxEqual(rThis.getRightWidth(), rOther.getRightWidth()))
&& (rThis.getStyle() == rOther.getStyle())
&& (rThis.getRGBColorLeft() == rOther.getRGBColorLeft())
&& (rThis.getRGBColorRight() == rOther.getRGBColorRight())
@@ -558,7 +558,7 @@ lcl_TryMergeBorderLine(BorderLinePrimitive2D const& rThis,
int nRet = 0;
if (thisHeight > thisWidth) // vertical line
{
- if (rThis.getStart().getX() == rOther.getStart().getX())
+ if (rtl::math::approxEqual(rThis.getStart().getX(), rOther.getStart().getX()))
{
assert(rThis.getEnd().getX() == rOther.getEnd().getX());
nRet = lcl_TryMergeLines(
@@ -569,7 +569,7 @@ lcl_TryMergeBorderLine(BorderLinePrimitive2D const& rThis,
}
else // horizontal line
{
- if (rThis.getStart().getY() == rOther.getStart().getY())
+ if (rtl::math::approxEqual(rThis.getStart().getY(), rOther.getStart().getY()))
{
assert(rThis.getEnd().getY() == rOther.getEnd().getY());
nRet = lcl_TryMergeLines(
diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx
index 4479c53..7b61ea1 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -1064,7 +1064,7 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt,
{
float nHeight = *static_cast<float const *>(aTmp.getValue());
- if( nHeight > 0 && (!bEdit || nHeight != 10.) )
+ if( nHeight > 0 && (!bEdit || !rtl::math::approxEqual(nHeight, 10.0)) )
aItemSet.Put( SvxFontHeightItem( sal_Int16(nHeight * 20.), 100, RES_CHRATR_FONTSIZE ) );
}
}
More information about the Libreoffice-commits
mailing list