diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2007-01-15 12:33:03 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2007-01-15 12:33:03 +0000 |
commit | 8ddaee02474a70c8b664eca1d2fc17c2c3027085 (patch) | |
tree | 6aa9abdcf8c8c4efa46361b7521e200c2219acb4 /connectivity | |
parent | 02b5c60e797e5da4ac49a8e6a3fa7fd7f23657de (diff) |
INTEGRATION: CWS dba22b (1.27.50); FILE MERGED
2007/01/03 12:57:57 oj 1.27.50.1: #i73065# convert nanos in hundredths of second
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/commontools/dbconversion.cxx | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/connectivity/source/commontools/dbconversion.cxx b/connectivity/source/commontools/dbconversion.cxx index ed6435934989..f24d9a86444e 100644 --- a/connectivity/source/commontools/dbconversion.cxx +++ b/connectivity/source/commontools/dbconversion.cxx @@ -4,9 +4,9 @@ * * $RCSfile: dbconversion.cxx,v $ * - * $Revision: 1.27 $ + * $Revision: 1.28 $ * - * last change: $Author: obo $ $Date: 2006-09-17 02:02:17 $ + * last change: $Author: vg $ $Date: 2007-01-15 13:33:03 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -484,7 +484,7 @@ namespace dbtools sal_uInt16 nHour = 0, nMinute = 0, nSecond = 0, - nNano = 0; + nHundredthSeconds = 0; nHour = (sal_uInt16)_sSQLString.getToken(0,sTimeSep,nIndex).toInt32(); if(nIndex != -1) { @@ -495,10 +495,16 @@ namespace dbtools nIndex = 0; ::rtl::OUString sNano(_sSQLString.getToken(1,'.',nIndex)); if ( sNano.getLength() ) - nNano = (sal_uInt16)sNano.toInt32(); + { + // our time struct only supports hundredth seconds + sNano = sNano.copy(0,::std::min<sal_Int32>(sNano.getLength(),2)); + const static ::rtl::OUString s_Zeros(RTL_CONSTASCII_USTRINGPARAM("00")); + sNano += s_Zeros.copy(0,s_Zeros.getLength() - sNano.getLength()); + nHundredthSeconds = static_cast<sal_uInt16>(sNano.toInt32()); + } } } - return Time(nNano,nSecond,nMinute,nHour); + return Time(nHundredthSeconds,nSecond,nMinute,nHour); } //......................................................................... |