[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - connectivity/source

Lionel Elie Mamane lionel at mamane.lu
Fri Jun 28 05:27:53 PDT 2013


 connectivity/source/commontools/dbconversion.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 82593374493c967bbb1ba15d005470d7f108ae87
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Thu Jun 27 08:51:02 2013 +0200

    fdo#66216 fix DBTypeConversion::toTime overflow
    
    Change-Id: I0aba2344afde94226cfbac5b3221e827e6774b3a
    Reviewed-on: https://gerrit.libreoffice.org/4565
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/connectivity/source/commontools/dbconversion.cxx b/connectivity/source/commontools/dbconversion.cxx
index 513a8b0..f777420 100644
--- a/connectivity/source/commontools/dbconversion.cxx
+++ b/connectivity/source/commontools/dbconversion.cxx
@@ -355,7 +355,7 @@ namespace dbtools
     Time DBTypeConversion::toTime(double dVal)
     {
         sal_Int32 nDays     = (sal_Int32)dVal;
-        sal_Int32 nNS = sal_Int32((dVal - (double)nDays) * fNanoSecondsPerDay + 0.5);
+        sal_Int64 nNS = static_cast<sal_Int64>((dVal - (double)nDays) * fNanoSecondsPerDay + 0.5);
 
         sal_Int16 nSign;
         if ( nNS < 0 )
@@ -369,7 +369,7 @@ namespace dbtools
         Time xRet;
         // normalize time
         // we have to sal_Int32 here because otherwise we get an overflow
-        sal_Int32 nNanoSeconds      = nNS;
+        sal_Int64 nNanoSeconds      = nNS;
         sal_Int32 nSeconds          = nNanoSeconds / nanoSecInSec;
         sal_Int32 nMinutes          = nSeconds / secInMin;
 


More information about the Libreoffice-commits mailing list