[Libreoffice-commits] core.git: 8 commits - connectivity/Library_firebird_sdbc.mk connectivity/source

Andrzej J.R. Hunt andrzej at ahunt.org
Mon Aug 12 09:23:41 PDT 2013


 connectivity/Library_firebird_sdbc.mk               |    1 
 connectivity/source/drivers/firebird/Catalog.cxx    |   67 ++++++++++++++++++++
 connectivity/source/drivers/firebird/Catalog.hxx    |   43 ++++++++++++
 connectivity/source/drivers/firebird/Connection.cxx |   27 +++++---
 connectivity/source/drivers/firebird/Connection.hxx |   26 ++++---
 connectivity/source/drivers/firebird/Driver.cxx     |   17 ++---
 connectivity/source/drivers/firebird/Table.cxx      |   21 +++---
 connectivity/source/drivers/firebird/Table.hxx      |    3 
 connectivity/source/drivers/firebird/Tables.cxx     |   28 ++++----
 connectivity/source/drivers/firebird/Tables.hxx     |    7 +-
 10 files changed, 184 insertions(+), 56 deletions(-)

New commits:
commit ec365165ba7f332df479422174899808e1ff4152
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Mon Aug 12 17:15:46 2013 +0100

    Implement refreshTables. (firebird-sdbc)
    
    Change-Id: Ie2fe0c92c3cb1eb0ae68cdea8ad709021a8d8392

diff --git a/connectivity/source/drivers/firebird/Catalog.cxx b/connectivity/source/drivers/firebird/Catalog.cxx
index 552889a..0f84c94 100644
--- a/connectivity/source/drivers/firebird/Catalog.cxx
+++ b/connectivity/source/drivers/firebird/Catalog.cxx
@@ -8,11 +8,15 @@
  */
 
 #include "Catalog.hxx"
+#include "Tables.hxx"
 
 using namespace ::connectivity::firebird;
 
+using namespace ::rtl;
+
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::sdbc;
+using namespace ::com::sun::star::uno;
 
 Catalog::Catalog(const uno::Reference< XConnection >& rConnection):
     OCatalog(rConnection),
@@ -23,8 +27,24 @@ Catalog::Catalog(const uno::Reference< XConnection >& rConnection):
 //----- OCatalog -------------------------------------------------------------
 void Catalog::refreshTables()
 {
-    // TODO: implement me.
-    // Sets m_pTables (OCatalog)
+    // TODO: set type -- currenty we also get system tables...
+    uno::Reference< XResultSet > xTables = m_xMetaData->getTables(Any(),
+                                                            "%",
+                                                            "%",
+                                                            Sequence< OUString >());
+
+    TStringVector aTableNames;
+
+    fillNames(xTables, aTableNames);
+
+    if (!m_pTables)
+        m_pTables = new Tables(m_xConnection->getMetaData(),
+                               *this,
+                               m_aMutex,
+                               aTableNames);
+    else
+        m_pTables->reFill(aTableNames);
+
 }
 
 void Catalog::refreshViews()
diff --git a/connectivity/source/drivers/firebird/Tables.cxx b/connectivity/source/drivers/firebird/Tables.cxx
index be3d231..8828b97 100644
--- a/connectivity/source/drivers/firebird/Tables.cxx
+++ b/connectivity/source/drivers/firebird/Tables.cxx
@@ -28,11 +28,12 @@ using namespace ::com::sun::star::uno;
 
 Tables::Tables(const uno::Reference< XDatabaseMetaData >& rMetaData,
                OWeakObject& rParent,
-               Mutex& rMutex) :
+               Mutex& rMutex,
+               TStringVector& rNames) :
     OCollection(rParent,
                 sal_True,
                 rMutex,
-                TStringVector(1, "TABLE")), // std::vector with 1 element
+                rNames),
     m_rMutex(rMutex),
     m_xMetaData(rMetaData)
 {
diff --git a/connectivity/source/drivers/firebird/Tables.hxx b/connectivity/source/drivers/firebird/Tables.hxx
index 2f21cd6..c025e1b 100644
--- a/connectivity/source/drivers/firebird/Tables.hxx
+++ b/connectivity/source/drivers/firebird/Tables.hxx
@@ -41,7 +41,8 @@ namespace connectivity
         public:
             Tables(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& rMetaData,
                    ::cppu::OWeakObject& rParent,
-                   ::osl::Mutex& rMutex);
+                   ::osl::Mutex& rMutex,
+                   ::connectivity::TStringVector& rNames);
 
             // TODO: we should also implement XDataDescriptorFactory, XRefreshable,
             // XAppend,  etc., but all are optional.
commit 88d74f35c2ce7968fe3f57f34e25d09374164ecd
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Mon Aug 12 16:47:18 2013 +0100

    Create Catalog to deal with sdbcx details. (firebird-sdbc)
    
    Change-Id: I521db652157e6b6da79e70f3731b6eddfc2bab1d

diff --git a/connectivity/Library_firebird_sdbc.mk b/connectivity/Library_firebird_sdbc.mk
index 066d60ad..577c169 100644
--- a/connectivity/Library_firebird_sdbc.mk
+++ b/connectivity/Library_firebird_sdbc.mk
@@ -38,6 +38,7 @@ $(eval $(call gb_Library_set_componentfile,firebird_sdbc,connectivity/source/dri
 
 $(eval $(call gb_Library_add_exception_objects,firebird_sdbc,\
     connectivity/source/drivers/firebird/Blob \
+    connectivity/source/drivers/firebird/Catalog \
     connectivity/source/drivers/firebird/Columns \
     connectivity/source/drivers/firebird/Connection \
     connectivity/source/drivers/firebird/DatabaseMetaData \
diff --git a/connectivity/source/drivers/firebird/Catalog.cxx b/connectivity/source/drivers/firebird/Catalog.cxx
new file mode 100644
index 0000000..552889a
--- /dev/null
+++ b/connectivity/source/drivers/firebird/Catalog.cxx
@@ -0,0 +1,47 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "Catalog.hxx"
+
+using namespace ::connectivity::firebird;
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::sdbc;
+
+Catalog::Catalog(const uno::Reference< XConnection >& rConnection):
+    OCatalog(rConnection),
+    m_xConnection(rConnection)
+{
+}
+
+//----- OCatalog -------------------------------------------------------------
+void Catalog::refreshTables()
+{
+    // TODO: implement me.
+    // Sets m_pTables (OCatalog)
+}
+
+void Catalog::refreshViews()
+{
+    // TODO: implement me.
+    // Sets m_pViews (OCatalog)
+}
+
+//----- IRefreshableGroups ---------------------------------------------------
+void Catalog::refreshGroups()
+{
+    // TODO: implement me
+}
+
+//----- IRefreshableUsers ----------------------------------------------------
+void Catalog::refreshUsers()
+{
+    // TODO: implement me
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/connectivity/source/drivers/firebird/Catalog.hxx b/connectivity/source/drivers/firebird/Catalog.hxx
new file mode 100644
index 0000000..7281b79
--- /dev/null
+++ b/connectivity/source/drivers/firebird/Catalog.hxx
@@ -0,0 +1,43 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef CONNECTIVITY_FIREBIRD_CATALOG_HXX
+#define CONNECTIVITY_FIREBIRD_CATALOG_HXX
+
+#include <connectivity/sdbcx/VCatalog.hxx>
+
+namespace connectivity
+{
+    namespace firebird
+    {
+        class Catalog: public ::connectivity::sdbcx::OCatalog
+        {
+        protected:
+            ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >
+                m_xConnection;
+
+        public:
+            Catalog(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& rConnection);
+
+            // OCatalog
+            virtual void refreshTables();
+            virtual void refreshViews();
+
+            // IRefreshableGroups
+            virtual void refreshGroups();
+
+            // IRefreshableUsers
+            virtual void refreshUsers();
+        };
+    } // namespace firebird
+} // namespace connectivity
+
+#endif //CONNECTIVITY_FIREBIRD_CATALOG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx
index 9dbc87f..de795eb 100644
--- a/connectivity/source/drivers/firebird/Connection.cxx
+++ b/connectivity/source/drivers/firebird/Connection.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include "Catalog.hxx"
 #include "Connection.hxx"
 #include "DatabaseMetaData.hxx"
 #include "Driver.hxx"
@@ -67,6 +68,7 @@ using namespace ::com::sun::star::frame;
 using namespace ::com::sun::star::io;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::sdbc;
+using namespace ::com::sun::star::sdbcx;
 using namespace ::com::sun::star::uno;
 
 const OUString OConnection::sDBLocation( "firebird.fdb" );
@@ -86,7 +88,8 @@ OConnection::OConnection(FirebirdDriver*    _pDriver)
                          m_bReadOnly(sal_False),
                          m_aTransactionIsolation(TransactionIsolation::REPEATABLE_READ),
                          m_DBHandler(0),
-                         m_transactionHandle(0)
+                         m_transactionHandle(0),
+                         m_xCatalog(0)
 {
     SAL_INFO("connectivity.firebird", "OConnection().");
 
@@ -762,12 +765,22 @@ void OConnection::clearStatements()
     m_aStatements.clear();
 }
 
-//----- XTablesSupplier ------------------------------------------------------
-uno::Reference< XNameAccess > SAL_CALL OConnection::getTables()
-    throw (RuntimeException)
+uno::Reference< XTablesSupplier > OConnection::createCatalog()
 {
-    return new Tables(getMetaData(),
-                      *this,
-                      m_aMutex);
+    MutexGuard aGuard(m_aMutex);
+
+    // m_xCatalog is a weak reference. Reuse it if it still exists.
+    Reference< XTablesSupplier > xCatalog = m_xCatalog;
+    if (xCatalog.is())
+    {
+        return xCatalog;
+    }
+    else
+    {
+        xCatalog = new Catalog(this);
+        m_xCatalog = xCatalog;
+        return m_xCatalog;
+    }
+
 }
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/firebird/Connection.hxx b/connectivity/source/drivers/firebird/Connection.hxx
index d7a4f37..ca6fae6 100644
--- a/connectivity/source/drivers/firebird/Connection.hxx
+++ b/connectivity/source/drivers/firebird/Connection.hxx
@@ -27,7 +27,7 @@
 
 #include <connectivity/CommonTools.hxx>
 #include <connectivity/OSubComponent.hxx>
-#include <cppuhelper/compbase5.hxx>
+#include <cppuhelper/compbase4.hxx>
 #include <cppuhelper/weakref.hxx>
 #include <map>
 #include <OTypeInfo.hxx>
@@ -49,11 +49,10 @@ namespace connectivity
     namespace firebird
     {
 
-        typedef ::cppu::WeakComponentImplHelper5< ::com::sun::star::document::XDocumentEventListener,
+        typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::document::XDocumentEventListener,
                                                   ::com::sun::star::lang::XServiceInfo,
                                                   ::com::sun::star::sdbc::XConnection,
-                                                  ::com::sun::star::sdbc::XWarningsSupplier,
-                                                  ::com::sun::star::sdbcx::XTablesSupplier
+                                                  ::com::sun::star::sdbc::XWarningsSupplier
                                                 > OConnection_BASE;
 
         class OStatementCommonBase;
@@ -109,7 +108,10 @@ namespace connectivity
             isc_db_handle                           m_DBHandler;
             isc_tr_handle                           m_transactionHandle;
 
-            ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xEmbeddedStorage;
+            ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
+                m_xEmbeddedStorage;
+            ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbcx::XTablesSupplier>
+                m_xCatalog;
 
             void                    buildTypeInfo() throw( ::com::sun::star::sdbc::SQLException);
 
@@ -161,13 +163,6 @@ namespace connectivity
             // css.lang.XEventListener
             virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
 
-            // XTablesSupplier
-            virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
-                SAL_CALL getTables()
-                throw(::com::sun::star::uno::RuntimeException);
-
-
-
             inline ::rtl::OUString  getUserName()       const { return m_sUser; }
             inline isc_db_handle&    getDBHandle()       { return m_DBHandler; }
             inline FirebirdDriver*  getDriver()         const { return m_pDriver;}
@@ -185,6 +180,13 @@ namespace connectivity
             ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob>
                 createBlob(ISC_QUAD* pBlobID)
                 throw(::com::sun::star::sdbc::SQLException);
+
+            /**
+             * Create and/or connect to the sdbcx Catalog. This is completely
+             * unrelated to the SQL "Catalog".
+             */
+            virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier >
+                createCatalog();
         };
     }
 }
diff --git a/connectivity/source/drivers/firebird/Driver.cxx b/connectivity/source/drivers/firebird/Driver.cxx
index 41c31d2..2b9e656 100644
--- a/connectivity/source/drivers/firebird/Driver.cxx
+++ b/connectivity/source/drivers/firebird/Driver.cxx
@@ -174,7 +174,8 @@ uno::Reference< XTablesSupplier > SAL_CALL FirebirdDriver::getDataDefinitionByCo
                                     const uno::Reference< XConnection >& rConnection)
     throw(SQLException, RuntimeException)
 {
-    return uno::Reference< XTablesSupplier >(rConnection, UNO_QUERY);
+    OConnection* pConnection = static_cast< OConnection* >(rConnection.get());
+    return uno::Reference< XTablesSupplier >(pConnection->createCatalog(), UNO_QUERY);
 }
 
 uno::Reference< XTablesSupplier > SAL_CALL FirebirdDriver::getDataDefinitionByURL(
commit f400dac5a846007c9bf7529623732670b73c692e
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Mon Aug 12 15:44:48 2013 +0100

    Enable sdbcx retrieval. (firebird-sdbc)
    
    Note: this completely breaks the GUI editing of a db for now since
    the sdbcx portion of the driver is still non-functional.
    
    Change-Id: Ia4561dae1689fb66c87ac6ab154c02f27ecf211a

diff --git a/connectivity/source/drivers/firebird/Driver.cxx b/connectivity/source/drivers/firebird/Driver.cxx
index 7be842a..41c31d2 100644
--- a/connectivity/source/drivers/firebird/Driver.cxx
+++ b/connectivity/source/drivers/firebird/Driver.cxx
@@ -125,7 +125,7 @@ Reference< XConnection > SAL_CALL FirebirdDriver::connect(
        throw DisposedException();
 
     if ( ! acceptsURL(url) )
-        return NULL;
+        return NULL; // TODO: throw Exception?
 
     // create a new connection with the given properties and append it to our vector
     OConnection* pCon = new OConnection(this);
@@ -171,23 +171,19 @@ sal_Int32 SAL_CALL FirebirdDriver::getMinorVersion(  ) throw(RuntimeException)
 
 //----- XDataDefinitionSupplier
 uno::Reference< XTablesSupplier > SAL_CALL FirebirdDriver::getDataDefinitionByConnection(
-                                    const uno::Reference< XConnection >& rxConnection)
+                                    const uno::Reference< XConnection >& rConnection)
     throw(SQLException, RuntimeException)
 {
-    (void) rxConnection;
-    // TODO: IMPLEMENT ME
-    return 0;
+    return uno::Reference< XTablesSupplier >(rConnection, UNO_QUERY);
 }
 
 uno::Reference< XTablesSupplier > SAL_CALL FirebirdDriver::getDataDefinitionByURL(
-                    const OUString& rsURL,
+                    const OUString& rURL,
                     const uno::Sequence< PropertyValue >& rInfo)
     throw(SQLException, RuntimeException)
 {
-    (void) rsURL;
-    (void) rInfo;
-    // TODO: IMPLEMENT ME
-    return 0;
+    uno::Reference< XConnection > xConnection = connect(rURL, rInfo);
+    return getDataDefinitionByConnection(xConnection);
 }
 
 namespace connectivity
commit 64deb339a97c1977f363fa08fd2b7d9fcfe2e957
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Mon Aug 12 12:08:33 2013 +0100

    Implement getTables(). (firebird-sdbc)
    
    Change-Id: I6b13fe51547ac5a51a03bf9b55f8e684275652cb

diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx
index 63daf08..9dbc87f 100644
--- a/connectivity/source/drivers/firebird/Connection.cxx
+++ b/connectivity/source/drivers/firebird/Connection.cxx
@@ -766,8 +766,8 @@ void OConnection::clearStatements()
 uno::Reference< XNameAccess > SAL_CALL OConnection::getTables()
     throw (RuntimeException)
 {
-    // TODO: IMPLEMENT ME PROPERLY
-    //return new Tables();
-    return 0;
+    return new Tables(getMetaData(),
+                      *this,
+                      m_aMutex);
 }
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/firebird/Tables.cxx b/connectivity/source/drivers/firebird/Tables.cxx
index 607fdc3..be3d231 100644
--- a/connectivity/source/drivers/firebird/Tables.cxx
+++ b/connectivity/source/drivers/firebird/Tables.cxx
@@ -26,13 +26,15 @@ using namespace ::com::sun::star::sdbc;
 using namespace ::com::sun::star::uno;
 
 
-Tables::Tables(ODatabaseMetaData& xMetaData,
+Tables::Tables(const uno::Reference< XDatabaseMetaData >& rMetaData,
                OWeakObject& rParent,
-               Mutex& rMutex,
-               const TStringVector& rVector) :
-    OCollection(rParent, sal_True, rMutex, rVector),
+               Mutex& rMutex) :
+    OCollection(rParent,
+                sal_True,
+                rMutex,
+                TStringVector(1, "TABLE")), // std::vector with 1 element
     m_rMutex(rMutex),
-    m_xMetaData(xMetaData)
+    m_xMetaData(rMetaData)
 {
 }
 
@@ -47,10 +49,10 @@ ObjectType Tables::createObject(const OUString& rName)
 {
     // TODO: parse the name.
     // TODO: use table types
-    uno::Reference< XResultSet > xTables = m_xMetaData.getTables(Any(),
-                                                                 OUString(),
-                                                                 rName,
-                                                                 uno::Sequence< OUString >());
+    uno::Reference< XResultSet > xTables = m_xMetaData->getTables(Any(),
+                                                                  OUString(),
+                                                                  rName,
+                                                                  uno::Sequence< OUString >());
 
     if (!xTables.is())
         throw RuntimeException();
@@ -62,7 +64,7 @@ ObjectType Tables::createObject(const OUString& rName)
 
     ObjectType xRet(new Table(this,
                               m_rMutex,
-                              m_xMetaData.getConnection(),
+                              m_xMetaData->getConnection(),
                               xRow->getString(3), // Name
                               xRow->getString(4), // Type
                               xRow->getString(5))); // Description / Remarks / Comments
diff --git a/connectivity/source/drivers/firebird/Tables.hxx b/connectivity/source/drivers/firebird/Tables.hxx
index 8128fb4..2f21cd6 100644
--- a/connectivity/source/drivers/firebird/Tables.hxx
+++ b/connectivity/source/drivers/firebird/Tables.hxx
@@ -35,13 +35,13 @@ namespace connectivity
             virtual ::connectivity::sdbcx::ObjectType createObject(
                                                 const ::rtl::OUString& rName);
 
-            ODatabaseMetaData& m_xMetaData;
+            ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >
+                m_xMetaData;
 
         public:
-            Tables(ODatabaseMetaData& xMetaData,
+            Tables(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& rMetaData,
                    ::cppu::OWeakObject& rParent,
-                   ::osl::Mutex& rMutex,
-                   const ::connectivity::TStringVector& rVector);
+                   ::osl::Mutex& rMutex);
 
             // TODO: we should also implement XDataDescriptorFactory, XRefreshable,
             // XAppend,  etc., but all are optional.
commit 6878fa8a9cba2d484f5fad264188c5a825fc5315
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Mon Aug 12 10:51:05 2013 +0100

    Use correct data in Tables::createObject. (firebird-sdbc)
    
    Change-Id: I01a55a15fdb88bf0910afabb6763829c979e35fa

diff --git a/connectivity/source/drivers/firebird/Tables.cxx b/connectivity/source/drivers/firebird/Tables.cxx
index a0f70cf..607fdc3 100644
--- a/connectivity/source/drivers/firebird/Tables.cxx
+++ b/connectivity/source/drivers/firebird/Tables.cxx
@@ -63,9 +63,9 @@ ObjectType Tables::createObject(const OUString& rName)
     ObjectType xRet(new Table(this,
                               m_rMutex,
                               m_xMetaData.getConnection(),
-                              rName,
-                              "", // TODO: Type
-                              "")); // TODO: Description
+                              xRow->getString(3), // Name
+                              xRow->getString(4), // Type
+                              xRow->getString(5))); // Description / Remarks / Comments
 
     if (xTables->next())
         throw RuntimeException(); // Only one table should be returned
commit 893a8a6f1183d8af2fe6be68457ecfe3f6ad8155
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Mon Aug 12 10:47:34 2013 +0100

    Remove unneeded field. (firebird-sdbc)
    
    This can be retrieved as needed from DatabaseMetaData.
    
    Change-Id: I0324b7c087e6d7357437a9d6bc94340605066172

diff --git a/connectivity/source/drivers/firebird/Table.cxx b/connectivity/source/drivers/firebird/Table.cxx
index 0c0c753..7624eee 100644
--- a/connectivity/source/drivers/firebird/Table.cxx
+++ b/connectivity/source/drivers/firebird/Table.cxx
@@ -28,8 +28,7 @@ Table::Table(Tables* pTables,
              const uno::Reference< XConnection >& rConnection,
              const OUString& rName,
              const OUString& rType,
-             const OUString& rDescription,
-             sal_Int32 nPrivileges):
+             const OUString& rDescription):
     OTableHelper(pTables,
                  rConnection,
                  sal_True,
@@ -40,7 +39,6 @@ Table::Table(Tables* pTables,
                  ""),
     m_rMutex(rMutex)
 {
-    (void) nPrivileges;
 }
 
 //----- OTableHelper ---------------------------------------------------------
diff --git a/connectivity/source/drivers/firebird/Table.hxx b/connectivity/source/drivers/firebird/Table.hxx
index e7ed569..0ea4695 100644
--- a/connectivity/source/drivers/firebird/Table.hxx
+++ b/connectivity/source/drivers/firebird/Table.hxx
@@ -30,8 +30,7 @@ namespace connectivity
                   const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,
                   const ::rtl::OUString& rName,
                   const ::rtl::OUString& rType,
-                  const ::rtl::OUString& rDescription,
-                  sal_Int32 _nPrivileges);
+                  const ::rtl::OUString& rDescription);
 
             // OTableHelper
             virtual ::connectivity::sdbcx::OCollection* createColumns(
diff --git a/connectivity/source/drivers/firebird/Tables.cxx b/connectivity/source/drivers/firebird/Tables.cxx
index af8dd9b..a0f70cf 100644
--- a/connectivity/source/drivers/firebird/Tables.cxx
+++ b/connectivity/source/drivers/firebird/Tables.cxx
@@ -65,8 +65,7 @@ ObjectType Tables::createObject(const OUString& rName)
                               m_xMetaData.getConnection(),
                               rName,
                               "", // TODO: Type
-                              "", // TODO: Description
-                              0)); // TODO: privileges
+                              "")); // TODO: Description
 
     if (xTables->next())
         throw RuntimeException(); // Only one table should be returned
commit c33f9afcadf350ea9f9a82b57f52ee08998ef653
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Mon Aug 12 10:25:05 2013 +0100

    Add getIndexes. (firebird-sdbc)
    
    Change-Id: I939c8033b6813754ee62092e3cab39ded853501e

diff --git a/connectivity/source/drivers/firebird/Table.cxx b/connectivity/source/drivers/firebird/Table.cxx
index 7138916..0c0c753 100644
--- a/connectivity/source/drivers/firebird/Table.cxx
+++ b/connectivity/source/drivers/firebird/Table.cxx
@@ -10,6 +10,7 @@
 #include "Columns.hxx"
 #include "Table.hxx"
 
+#include <connectivity/TIndexes.hxx>
 #include <connectivity/TKeys.hxx>
 
 using namespace ::connectivity;
@@ -61,9 +62,9 @@ OCollection* Table::createKeys(const TStringVector& rNames)
 
 OCollection* Table::createIndexes(const TStringVector& rNames)
 {
-    (void) rNames;
-    // TODO: IMPLEMENT ME
-    return 0;
+    return new OIndexesHelper(this,
+                              m_rMutex,
+                              rNames);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
commit 2997e7d253419ae7cd545e9d0a4a5fe205c5a156
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Mon Aug 12 10:15:53 2013 +0100

    Add getKeys() using OKeysHelper (firebird-sdbc).
    
    Change-Id: I5a885cec81d9abcd0b1fc18d0dcd98c292999a51

diff --git a/connectivity/source/drivers/firebird/Table.cxx b/connectivity/source/drivers/firebird/Table.cxx
index fe14352..7138916 100644
--- a/connectivity/source/drivers/firebird/Table.cxx
+++ b/connectivity/source/drivers/firebird/Table.cxx
@@ -10,6 +10,8 @@
 #include "Columns.hxx"
 #include "Table.hxx"
 
+#include <connectivity/TKeys.hxx>
+
 using namespace ::connectivity;
 using namespace ::connectivity::firebird;
 using namespace ::connectivity::sdbcx;
@@ -50,9 +52,11 @@ OCollection* Table::createColumns(const TStringVector& rNames)
 
 OCollection* Table::createKeys(const TStringVector& rNames)
 {
-    (void) rNames;
-    // TODO: IMPLEMENT ME
-    return 0;
+    // TODO: maybe add a wrapper here in case we the OKeysHelper isn't
+    // fully FB compatible.
+    return new OKeysHelper(this,
+                           m_rMutex,
+                           rNames);
 }
 
 OCollection* Table::createIndexes(const TStringVector& rNames)


More information about the Libreoffice-commits mailing list