User: vg      
Date: 2007/01/15 05:33:05

Modified:
   dba/connectivity/source/commontools/dbconversion.cxx

Log:
 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

File Changes:

Directory: /dba/connectivity/source/commontools/
================================================

File [changed]: dbconversion.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/dbconversion.cxx?r1=1.27&r2=1.28
Delta lines:  +9 -3
-------------------
--- dbconversion.cxx    17 Sep 2006 02:02:17 -0000      1.27
+++ dbconversion.cxx    15 Jan 2007 13:33:03 -0000      1.28
@@ -484,7 +484,7 @@
         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 @@
                 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);
     }
 
 //.........................................................................




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to