[Libreoffice-commits] core.git: basic/source

Noel Grandin noel at peralex.com
Thu Feb 4 06:41:39 UTC 2016


 basic/source/classes/sbunoobj.cxx |    2 +-
 basic/source/sbx/sbxdate.cxx      |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 4fa4b9addfaa4291096cb6de5d98c6612c36757c
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Jan 27 11:07:06 2016 +0200

    loplugin:fpcomparison in basic/
    
    Change-Id: I76ffac6a0f0b1525c85d1995277d3ca22ef268e1
    Reviewed-on: https://gerrit.libreoffice.org/21869
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index da309e7..4a15411 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -1028,7 +1028,7 @@ Any sbxToUnoValueImpl( const SbxValue* pVar, bool bBlockConversionToSmallestType
             case TypeClass_DOUBLE:
             {
                 double d = pVar->GetDouble();
-                if( d == floor( d ) )
+                if( rtl::math::approxEqual(d, floor( d )) )
                 {
                     if( d >= -128 && d <= 127 )
                         aType = ::cppu::UnoType<sal_Int8>::get();
diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx
index ebe574d..b678f22 100644
--- a/basic/source/sbx/sbxdate.cxx
+++ b/basic/source/sbx/sbxdate.cxx
@@ -281,7 +281,7 @@ start:
             if( n <= -1.0 || n >= 1.0 )
             {
                 // Time only if != 00:00:00
-                if( floor( n ) == n )
+                if( rtl::math::approxEqual(floor( n ), n) )
                 {
                     switch( eDate )
                     {


More information about the Libreoffice-commits mailing list