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

Tamas Bunth tamas.bunth at collabora.co.uk
Sun Mar 11 10:34:37 UTC 2018


 dbaccess/source/filter/hsqldb/hsqlimport.cxx     |   10 ++++++++--
 dbaccess/source/filter/hsqldb/rowinputbinary.cxx |    9 ++++++++-
 2 files changed, 16 insertions(+), 3 deletions(-)

New commits:
commit f9831de353742485b8241fb2bd8ca6b23e3c1c75
Author: Tamas Bunth <tamas.bunth at collabora.co.uk>
Date:   Sat Mar 10 23:40:43 2018 +0100

    dbahsql: import TIME columns
    
    Change-Id: I8863127a4de1bfc06b13d008e037db2a4e60f1e7
    Reviewed-on: https://gerrit.libreoffice.org/51059
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tamás Bunth <btomi96 at gmail.com>

diff --git a/dbaccess/source/filter/hsqldb/hsqlimport.cxx b/dbaccess/source/filter/hsqldb/hsqlimport.cxx
index cc806b313e9a..7f6426231b06 100644
--- a/dbaccess/source/filter/hsqldb/hsqlimport.cxx
+++ b/dbaccess/source/filter/hsqldb/hsqlimport.cxx
@@ -139,8 +139,8 @@ void lcl_setParams(const RowVector& row, Reference<XParameters>& xParam,
                 {
                     xParam->setDouble(i + 1, nVal);
                 }
-                break;
             }
+            break;
             case DataType::NUMERIC:
             case DataType::DECIMAL:
             {
@@ -157,8 +157,14 @@ void lcl_setParams(const RowVector& row, Reference<XParameters>& xParam,
                 // TODO
                 break;
             case DataType::TIME:
-                // TODO
+            {
+                css::util::Time time;
+                if (row.at(i) >>= time)
+                {
+                    xParam->setTime(i + 1, time);
+                }
                 break;
+            }
             case DataType::TIMESTAMP:
                 // TODO
                 break;
diff --git a/dbaccess/source/filter/hsqldb/rowinputbinary.cxx b/dbaccess/source/filter/hsqldb/rowinputbinary.cxx
index b657abd36d52..0bcd0109e304 100644
--- a/dbaccess/source/filter/hsqldb/rowinputbinary.cxx
+++ b/dbaccess/source/filter/hsqldb/rowinputbinary.cxx
@@ -21,6 +21,7 @@
 #include <com/sun/star/sdbc/DataType.hpp>
 #include <com/sun/star/io/WrongFormatException.hpp>
 #include <com/sun/star/io/XConnectable.hpp>
+#include <com/sun/star/util/Time.hpp>
 
 #include <unotools/ucbstreamhelper.hxx>
 #include <tools/stream.hxx>
@@ -300,7 +301,13 @@ std::vector<Any> HsqlRowInputStream::readOneRow(const ColumnTypeVector& nColType
             case DataType::DATE:
                 break;
             case DataType::TIME:
-                break;
+            {
+                sal_Int64 value = 0;
+                m_pStream->ReadInt64(value);
+                css::util::Time time((value % 1000) * 1000000, value / 1000, 0, 0, true);
+                aData.push_back(makeAny(time));
+            }
+            break;
             case DataType::TIMESTAMP:
                 break;
             case DataType::BOOLEAN:


More information about the Libreoffice-commits mailing list