[Libreoffice-commits] .: connectivity/source

Caolán McNamara caolan at kemper.freedesktop.org
Wed Oct 5 04:01:39 PDT 2011


 connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx |    2 +-
 connectivity/source/drivers/odbcbase/OResultSet.cxx                 |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 9bb187006a42ee8b0dcb6fe47407752c7873f41b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Oct 5 12:01:10 2011 +0100

    Resolves: fdo#34309 odbc fractional seconds are in billionths

diff --git a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
index 6df4f2c..b198310 100644
--- a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx
@@ -471,7 +471,7 @@ sal_Int16 SAL_CALL ODatabaseMetaDataResultSet::getShort( sal_Int32 columnIndex )
         OTools::getValue(m_pConnection,m_aStatementHandle,columnIndex,m_pConnection->useOldDateFormat() ? SQL_C_TIMESTAMP : SQL_C_TYPE_TIMESTAMP,m_bWasNull,**this,&aTime,sizeof aTime);
     else
         m_bWasNull = sal_True;
-    return DateTime((sal_uInt16)aTime.fraction*1000,aTime.second,aTime.minute,aTime.hour,aTime.day,aTime.month,aTime.year);
+    return DateTime((sal_uInt16)aTime.fraction/ODBC_FRACTION_UNITS_PER_HSECOND,aTime.second,aTime.minute,aTime.hour,aTime.day,aTime.month,aTime.year);
 }
 // -------------------------------------------------------------------------
 
diff --git a/connectivity/source/drivers/odbcbase/OResultSet.cxx b/connectivity/source/drivers/odbcbase/OResultSet.cxx
index 3c13671..219db7d 100644
--- a/connectivity/source/drivers/odbcbase/OResultSet.cxx
+++ b/connectivity/source/drivers/odbcbase/OResultSet.cxx
@@ -653,7 +653,7 @@ DateTime SAL_CALL OResultSet::getTimestamp( sal_Int32 columnIndex ) throw(SQLExc
         &aTime,sizeof aTime);
     return (&aValue == &m_aEmptyValue)
             ?
-            DateTime(static_cast<sal_uInt16>(aTime.fraction*1000),aTime.second,aTime.minute,aTime.hour,aTime.day,aTime.month,aTime.year)
+            DateTime(static_cast<sal_uInt16>(aTime.fraction/ODBC_FRACTION_UNITS_PER_HSECOND),aTime.second,aTime.minute,aTime.hour,aTime.day,aTime.month,aTime.year)
             :
             (DateTime)aValue;
 }


More information about the Libreoffice-commits mailing list