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

Andrzej J.R. Hunt andrzej at ahunt.org
Tue Aug 20 13:41:09 PDT 2013


 connectivity/Library_firebird_sdbc.mk            |    2 
 connectivity/source/commontools/dbtools2.cxx     |   40 ++++++----
 connectivity/source/drivers/firebird/Catalog.cxx |   28 ++++++-
 connectivity/source/drivers/firebird/Table.cxx   |   63 +++++++++++++---
 connectivity/source/drivers/firebird/User.cxx    |   38 +++++++++
 connectivity/source/drivers/firebird/User.hxx    |   49 ++++++++++++
 connectivity/source/drivers/firebird/Users.cxx   |   90 +++++++++++++++++++++++
 connectivity/source/drivers/firebird/Users.hxx   |   65 ++++++++++++++++
 include/connectivity/dbtools.hxx                 |    3 
 9 files changed, 349 insertions(+), 29 deletions(-)

New commits:
commit e6c4e419d6bc3572b183ca8ed3f2b75417899fff
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Tue Aug 20 14:34:54 2013 +0100

    Implement changing nullable. (firebird-sdbc)
    
    Change-Id: I0aa745becbd8b3dae11917248205f46eb61c17de

diff --git a/connectivity/source/drivers/firebird/Table.cxx b/connectivity/source/drivers/firebird/Table.cxx
index 3f99917..2b30057 100644
--- a/connectivity/source/drivers/firebird/Table.cxx
+++ b/connectivity/source/drivers/firebird/Table.cxx
@@ -15,6 +15,8 @@
 #include <connectivity/TIndexes.hxx>
 #include <connectivity/TKeys.hxx>
 
+#include <com/sun/star/sdbc/ColumnValue.hpp>
+
 using namespace ::connectivity;
 using namespace ::connectivity::firebird;
 using namespace ::connectivity::sdbcx;
@@ -93,19 +95,20 @@ void SAL_CALL Table::alterColumnByName(const OUString& rColName,
     uno::Reference< XPropertySet > xColumn(m_pColumns->getByName(rColName), UNO_QUERY);
 
     // sdbcx::Descriptor
-    bool bNameChanged = xColumn->getPropertyValue("Name") != rDescriptor->getPropertyValue("Name");
+    const bool bNameChanged = xColumn->getPropertyValue("Name") != rDescriptor->getPropertyValue("Name");
     // sdbcx::ColumnDescriptor
-    bool bTypeChanged = xColumn->getPropertyValue("Type") != rDescriptor->getPropertyValue("Type");
-    bool bTypeNameChanged = xColumn->getPropertyValue("TypeName") != rDescriptor->getPropertyValue("TypeName");
-    bool bPrecisionChanged = xColumn->getPropertyValue("Precision") != rDescriptor->getPropertyValue("Precision");
-    bool bScaleChanged = xColumn->getPropertyValue("Scale") != rDescriptor->getPropertyValue("Scale");
-    bool bIsNullableChanged = xColumn->getPropertyValue("IsNullable") != rDescriptor->getPropertyValue("IsNullable");
-    bool bIsAutoIncrementChanged = xColumn->getPropertyValue("IsAutoIncrement") != rDescriptor->getPropertyValue("IsAutoIncrement");
+    const bool bTypeChanged = xColumn->getPropertyValue("Type") != rDescriptor->getPropertyValue("Type");
+    const bool bTypeNameChanged = xColumn->getPropertyValue("TypeName") != rDescriptor->getPropertyValue("TypeName");
+    const bool bPrecisionChanged = xColumn->getPropertyValue("Precision") != rDescriptor->getPropertyValue("Precision");
+    const bool bScaleChanged = xColumn->getPropertyValue("Scale") != rDescriptor->getPropertyValue("Scale");
+    const bool bIsNullableChanged = xColumn->getPropertyValue("IsNullable") != rDescriptor->getPropertyValue("IsNullable");
+    const bool bIsAutoIncrementChanged = xColumn->getPropertyValue("IsAutoIncrement") != rDescriptor->getPropertyValue("IsAutoIncrement");
     // TODO: remainder -- these are all "optional" so have to detect presence and change.
 
     bool bDefaultChanged = xColumn->getPropertyValue("DefaultValue")
                                      != rDescriptor->getPropertyValue("DefaultValue");
 
+    // TODO: quote identifiers as needed.
     if (bNameChanged)
     {
         OUString sNewTableName;
@@ -125,8 +128,50 @@ void SAL_CALL Table::alterColumnByName(const OUString& rColName,
         // possibly we have to wrap things in Util::evaluateStatusVector.
     }
 
-    if (bPrecisionChanged || bScaleChanged
-        || bIsNullableChanged || bIsAutoIncrementChanged)
+    if (bIsNullableChanged)
+    {
+        sal_Int32 nNullabble;
+        rDescriptor->getPropertyValue("IsNullable") >>= nNullabble;
+
+        if (nNullabble != ColumnValue::NULLABLE_UNKNOWN)
+        {
+
+            OUString sSql;
+            // Dirty hack: can't change null directly in sql, we have to fiddle
+            // the system tables manually.
+            if (nNullabble == ColumnValue::NULLABLE)
+            {
+                sSql = "UPDATE RDB$RELATION_FIELDS SET RDB$NULL_FLAG = NULL "
+                       "WHERE RDB$FIELD_NAME = '" + rColName + "' "
+                       "AND RDB$RELATION_NAME = '" + getName() + "'";
+            }
+            else if (nNullabble == ColumnValue::NO_NULLS)
+            {
+                // And if we are making NOT NULL then we have to make sure we have
+                // no nulls left in the column.
+                OUString sFillNulls("UPDATE \"" + getName() + "\" SET \""
+                                    + rColName + "\" = 0 "
+                                    "WHERE \"" + rColName + "\" IS NULL");
+                getConnection()->createStatement()->execute(sFillNulls);
+
+                sSql = "UPDATE RDB$RELATION_FIELDS SET RDB$NULL_FLAG = 1 "
+                       "WHERE RDB$FIELD_NAME = '" + rColName + "' "
+                       "AND RDB$RELATION_NAME = '" + getName() + "'";
+            }
+            getConnection()->createStatement()->execute(sSql);
+
+            // This is in essence a DDL statement which requires a commit
+            // to become visible in practice.
+            getConnection()->commit();
+            // TODO: confirm, do we really need this.
+        }
+        else
+        {
+            SAL_WARN("connectivity.firebird", "Attempting to set Nullable to NULLABLE_UNKNOWN");
+        }
+    }
+
+    if (bPrecisionChanged || bScaleChanged || bIsAutoIncrementChanged)
     {
         // TODO: changeType
     }
commit 84286f674bffaa2b9de44341a2f2700aa4352d86
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Tue Aug 20 14:07:37 2013 +0100

    Rearrange createStandardTypePart to not include extraneous parameters.
    
    We specifically only want the type identifier but not any autoincrement/
    nullabe parameters which have to be modified separately in some databases
    (e.g. firebird).
    
    Change-Id: I8b33bae8ce4aaf5f325c4156955140ad4fb17db7

diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx
index 055a3bd..bfa0750 100644
--- a/connectivity/source/commontools/dbtools2.cxx
+++ b/connectivity/source/commontools/dbtools2.cxx
@@ -60,7 +60,7 @@ namespace dbtools
     using namespace connectivity;
     using namespace comphelper;
 
-OUString createStandardTypePart(const Reference< XPropertySet >& xColProp,const Reference< XConnection>& _xConnection,ISQLStatementHelper* _pHelper,const OUString& _sCreatePattern)
+OUString createStandardTypePart(const Reference< XPropertySet >& xColProp,const Reference< XConnection>& _xConnection,const OUString& _sCreatePattern)
 {
 
     Reference<XDatabaseMetaData> xMetaData = _xConnection->getMetaData();
@@ -73,12 +73,11 @@ OUString createStandardTypePart(const Reference< XPropertySet >& xColProp,const
     sal_Int32       nScale      = 0;
 
     nDataType = nPrecision = nScale = 0;
-    sal_Bool bIsAutoIncrement = sal_False;
+
     xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_TYPENAME))           >>= sTypeName;
     xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_TYPE))               >>= nDataType;
     xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_PRECISION))          >>= nPrecision;
     xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCALE))              >>= nScale;
-    xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT))    >>= bIsAutoIncrement;
 
     OUStringBuffer aSql;
 
@@ -163,18 +162,6 @@ OUString createStandardTypePart(const Reference< XPropertySet >& xColProp,const
         aSql.append(sPostFix);
     } // if ( aDefault.getLength() )
 
-    if(::comphelper::getINT32(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISNULLABLE))) == ColumnValue::NO_NULLS)
-        aSql.append(OUString(" NOT NULL"));
-
-    if ( bIsAutoIncrement && !sAutoIncrementValue.isEmpty())
-    {
-        aSql.appendAscii(" ");
-        aSql.append(sAutoIncrementValue);
-    }
-
-    if ( _pHelper )
-        _pHelper->addComment(xColProp,aSql);
-
     return aSql.makeStringAndClear();
 }
 
@@ -184,12 +171,33 @@ OUString createStandardColumnPart(const Reference< XPropertySet >& xColProp,cons
 
     ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
 
+    sal_Bool bIsAutoIncrement = sal_False;
+    xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT))    >>= bIsAutoIncrement;
+
     const OUString sQuoteString = xMetaData->getIdentifierQuoteString();
     OUStringBuffer aSql = ::dbtools::quoteName(sQuoteString,::comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME))));
 
+    // check if the user enter a specific string to create autoincrement values
+    OUString sAutoIncrementValue;
+    Reference<XPropertySetInfo> xPropInfo = xColProp->getPropertySetInfo();
+    if ( xPropInfo.is() && xPropInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_AUTOINCREMENTCREATION)) )
+        xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_AUTOINCREMENTCREATION)) >>= sAutoIncrementValue;
+
     aSql.appendAscii(" ");
 
-    aSql.append(createStandardTypePart(xColProp, _xConnection, _pHelper, _sCreatePattern));
+    aSql.append(createStandardTypePart(xColProp, _xConnection, _sCreatePattern));
+
+    if(::comphelper::getINT32(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISNULLABLE))) == ColumnValue::NO_NULLS)
+        aSql.append(OUString(" NOT NULL"));
+
+    if ( bIsAutoIncrement && !sAutoIncrementValue.isEmpty())
+    {
+        aSql.appendAscii(" ");
+        aSql.append(sAutoIncrementValue);
+    }
+
+    if ( _pHelper )
+        _pHelper->addComment(xColProp,aSql);
 
     return aSql.makeStringAndClear();
 }
diff --git a/include/connectivity/dbtools.hxx b/include/connectivity/dbtools.hxx
index 8064355..e584e35 100644
--- a/include/connectivity/dbtools.hxx
+++ b/include/connectivity/dbtools.hxx
@@ -652,13 +652,10 @@ namespace dbtools
             The descriptor of the column.
         @param  _xConnection
             The connection.
-        @param  _pHelper
-            Allow to add special SQL constructs.
     */
     OOO_DLLPUBLIC_DBTOOLS
     OUString createStandardTypePart(     const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor
                                                 ,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection
-                                                ,ISQLStatementHelper* _pHelper = NULL
                                                 ,const OUString& _sCreatePattern = OUString());
 
     /** creates the standard sql statement for the column part of a create table statement.
commit 4eaca49a5ae7a70b18688b0ebb5ee6bb51f03927
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Tue Aug 20 08:18:57 2013 +0100

    Simplify Users.createObject. (firebird-sdbc)
    
    Unnecessary relic of Tables.
    
    Change-Id: I8d36f2ad3b3dc877ba64e063415922895c1c25d9

diff --git a/connectivity/source/drivers/firebird/Users.cxx b/connectivity/source/drivers/firebird/Users.cxx
index 75073a7..5f19765 100644
--- a/connectivity/source/drivers/firebird/Users.cxx
+++ b/connectivity/source/drivers/firebird/Users.cxx
@@ -51,27 +51,7 @@ void Users::impl_refresh()
 
 ObjectType Users::createObject(const OUString& rName)
 {
-    (void) rName;
-    // TODO: set query string
-    OUString sSql;
-    uno::Reference< XResultSet > xUsers = m_xMetaData->getConnection()
-                                            ->createStatement()->executeQuery(sSql);
-
-    if (!xUsers.is())
-        throw RuntimeException();
-
-    uno::Reference< XRow > xRow(xUsers,UNO_QUERY);
-
-    if (!xRow.is() || !xUsers->next())
-        throw RuntimeException();
-
-    ObjectType xRet(new User(m_xMetaData->getConnection(),
-                              xRow->getString(1))); // Name
-
-    if (xUsers->next())
-        throw RuntimeException(); // Only one user should be returned
-
-    return xRet;
+    return new User(m_xMetaData->getConnection(), rName);
 }
 
 uno::Reference< XPropertySet > Users::createDescriptor()
commit 38bc9693cc253d26b11f9a262f26f2cd373d50f9
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Tue Aug 20 08:16:03 2013 +0100

    Implement Catalog::refreshUsers. (firebird-sdbc)
    
    Change-Id: I54ca18b36c19d5a13efd8a194b59f0d8aebbac4c

diff --git a/connectivity/source/drivers/firebird/Catalog.cxx b/connectivity/source/drivers/firebird/Catalog.cxx
index 4a0700d..dbbfaa3 100644
--- a/connectivity/source/drivers/firebird/Catalog.cxx
+++ b/connectivity/source/drivers/firebird/Catalog.cxx
@@ -9,6 +9,7 @@
 
 #include "Catalog.hxx"
 #include "Tables.hxx"
+#include "Users.hxx"
 
 using namespace ::connectivity::firebird;
 
@@ -37,6 +38,9 @@ void Catalog::refreshTables()
                                                             "%",
                                                             aTypes);
 
+    if (!xTables.is())
+        return;
+
     TStringVector aTableNames;
 
     fillNames(xTables, aTableNames);
@@ -66,6 +70,28 @@ void Catalog::refreshGroups()
 //----- IRefreshableUsers ----------------------------------------------------
 void Catalog::refreshUsers()
 {
-    // TODO: implement me
+    OUString sSql("SELECT DISTINCT RDB$USER FROM RDB$USER_PRIVILEGES");
+
+    uno::Reference< XResultSet > xUsers = m_xMetaData->getConnection()
+                                            ->createStatement()->executeQuery(sSql);
+
+    if (!xUsers.is())
+        return;
+
+    TStringVector aUserNames;
+
+    uno::Reference< XRow > xRow(xUsers,UNO_QUERY);
+    while (xUsers->next())
+    {
+        aUserNames.push_back(xRow->getString(1));
+    }
+
+    if (!m_pUsers)
+        m_pUsers = new Users(m_xConnection->getMetaData(),
+                             *this,
+                             m_aMutex,
+                             aUserNames);
+    else
+        m_pUsers->reFill(aUserNames);
 }
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
commit 6b184f638d5027eab0166a11506c59fa6194dd62
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Mon Aug 19 13:58:55 2013 +0100

    Add skeleton sdbcx Users/User implementation. (firebird-sdbc)
    
    Change-Id: I8a64f9776a618691fa61aa0e71067a0eb6176811

diff --git a/connectivity/Library_firebird_sdbc.mk b/connectivity/Library_firebird_sdbc.mk
index 577c169..1f78608 100644
--- a/connectivity/Library_firebird_sdbc.mk
+++ b/connectivity/Library_firebird_sdbc.mk
@@ -51,6 +51,8 @@ $(eval $(call gb_Library_add_exception_objects,firebird_sdbc,\
     connectivity/source/drivers/firebird/StatementCommonBase \
     connectivity/source/drivers/firebird/Table \
     connectivity/source/drivers/firebird/Tables \
+    connectivity/source/drivers/firebird/User \
+    connectivity/source/drivers/firebird/Users \
     connectivity/source/drivers/firebird/Util \
 ))
 
diff --git a/connectivity/source/drivers/firebird/User.cxx b/connectivity/source/drivers/firebird/User.cxx
new file mode 100644
index 0000000..885ecff
--- /dev/null
+++ b/connectivity/source/drivers/firebird/User.cxx
@@ -0,0 +1,38 @@
+/* -*- 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 "User.hxx"
+
+using namespace ::connectivity;
+using namespace ::connectivity::firebird;
+using namespace  ::connectivity::sdbcx;
+
+using namespace ::rtl;
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::sdbc;
+
+User::User(const uno::Reference< XConnection >& rConnection):
+    OUser(sal_True) // Case Sensitive
+{
+    (void) rConnection;
+}
+
+User::User(const uno::Reference< XConnection >& rConnection, const OUString& rName):
+    OUser(rName,
+          sal_True) // Case Sensitive
+{
+    (void) rConnection;
+}
+
+//----- IRefreshableGroups ----------------------------------------------------
+void User::refreshGroups()
+{
+    // TODO: implement.
+}
\ No newline at end of file
diff --git a/connectivity/source/drivers/firebird/User.hxx b/connectivity/source/drivers/firebird/User.hxx
new file mode 100644
index 0000000..8ae8bd4
--- /dev/null
+++ b/connectivity/source/drivers/firebird/User.hxx
@@ -0,0 +1,49 @@
+/* -*- 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_USER_HXX
+#define CONNECTIVITY_FIREBIRD_USER_HXX
+
+#include <connectivity/sdbcx/VUser.hxx>
+
+#include <com/sun/star/sdbc/XConnection.hpp>
+
+namespace connectivity
+{
+    namespace firebird
+    {
+
+        /**
+         * This implements com.sun.star.sdbcx.Container.
+         */
+        class User: public ::connectivity::sdbcx::OUser
+        {
+
+        public:
+            /**
+             * Create a "new" descriptor, which isn't yet in the database.
+             */
+            User(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& rConnection);
+            /**
+             * For a user that already exists in the db.
+             */
+            User(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& rConnection,
+                 const ::rtl::OUString& rName);
+
+            // IRefreshableGroups::
+            virtual void refreshGroups();
+        };
+
+    } // namespace firebird
+} // namespace connectivity
+
+
+#endif // CONNECTIVITY_FIREBIRD_USER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/connectivity/source/drivers/firebird/Users.cxx b/connectivity/source/drivers/firebird/Users.cxx
new file mode 100644
index 0000000..75073a7
--- /dev/null
+++ b/connectivity/source/drivers/firebird/Users.cxx
@@ -0,0 +1,110 @@
+/* -*- 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 "User.hxx"
+#include "Users.hxx"
+
+#include <connectivity/dbtools.hxx>
+
+#include <com/sun/star/sdbc/XRow.hpp>
+
+using namespace ::connectivity;
+using namespace ::connectivity::firebird;
+using namespace ::connectivity::sdbcx;
+using namespace ::cppu;
+using namespace ::osl;
+using namespace ::rtl;
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::sdbc;
+using namespace ::com::sun::star::uno;
+
+
+Users::Users(const uno::Reference< XDatabaseMetaData >& rMetaData,
+             OWeakObject& rParent,
+             Mutex& rMutex,
+             TStringVector& rNames) :
+    OCollection(rParent,
+                sal_True,
+                rMutex,
+                rNames),
+    m_rMutex(rMutex),
+    m_xMetaData(rMetaData)
+{
+}
+
+//----- OCollection -----------------------------------------------------------
+void Users::impl_refresh()
+    throw(RuntimeException)
+{
+    // TODO: IMPLEMENT ME
+}
+
+ObjectType Users::createObject(const OUString& rName)
+{
+    (void) rName;
+    // TODO: set query string
+    OUString sSql;
+    uno::Reference< XResultSet > xUsers = m_xMetaData->getConnection()
+                                            ->createStatement()->executeQuery(sSql);
+
+    if (!xUsers.is())
+        throw RuntimeException();
+
+    uno::Reference< XRow > xRow(xUsers,UNO_QUERY);
+
+    if (!xRow.is() || !xUsers->next())
+        throw RuntimeException();
+
+    ObjectType xRet(new User(m_xMetaData->getConnection(),
+                              xRow->getString(1))); // Name
+
+    if (xUsers->next())
+        throw RuntimeException(); // Only one user should be returned
+
+    return xRet;
+}
+
+uno::Reference< XPropertySet > Users::createDescriptor()
+{
+    // There is some internal magic so that the same class can be used as either
+    // a descriptor or as a normal user. See VUser.cxx for the details. In our
+    // case we just need to ensure we use the correct constructor.
+    return new User(m_xMetaData->getConnection());
+}
+
+//----- XAppend ---------------------------------------------------------------
+ObjectType Users::appendObject(const OUString& rName,
+                                const uno::Reference< XPropertySet >& rDescriptor)
+{
+    // TODO: set sSql as appropriate
+    (void) rName;
+    (void) rDescriptor;
+    OUString sSql;
+    m_xMetaData->getConnection()->createStatement()->execute(sSql);
+
+    return createObject(rName);
+}
+
+//----- XDrop -----------------------------------------------------------------
+void Users::dropObject(sal_Int32 nPosition, const OUString sName)
+{
+    uno::Reference< XPropertySet > xUser(getObject(nPosition));
+
+    if (!ODescriptor::isNew(xUser))
+    {
+        (void) sName;
+        // TODO: drop me
+    }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/connectivity/source/drivers/firebird/Users.hxx b/connectivity/source/drivers/firebird/Users.hxx
new file mode 100644
index 0000000..12f2ef3
--- /dev/null
+++ b/connectivity/source/drivers/firebird/Users.hxx
@@ -0,0 +1,65 @@
+/* -*- 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_USERS_HXX
+#define CONNECTIVITY_FIREBIRD_USERS_HXX
+
+#include "DatabaseMetaData.hxx"
+
+#include <connectivity/sdbcx/VCollection.hxx>
+
+namespace connectivity
+{
+    namespace firebird
+    {
+
+        /**
+         * This implements com.sun.star.sdbcx.Container.
+         */
+        class Users: public ::connectivity::sdbcx::OCollection
+        {
+        private:
+            ::osl::Mutex& m_rMutex;
+
+        protected:
+            ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >
+                m_xMetaData;
+
+            // OCollection
+            virtual void impl_refresh()
+                throw(::com::sun::star::uno::RuntimeException);
+            virtual ::connectivity::sdbcx::ObjectType createObject(
+                                                const ::rtl::OUString& rName);
+            virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
+                    createDescriptor();
+            virtual ::connectivity::sdbcx::ObjectType appendObject(
+                        const OUString& rName,
+                        const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rDescriptor);
+
+        public:
+            Users(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& rMetaData,
+                  ::cppu::OWeakObject& rParent,
+                  ::osl::Mutex& rMutex,
+                  ::connectivity::TStringVector& rNames);
+
+            // TODO: we should also implement XDataDescriptorFactory, XRefreshable,
+            // XAppend,  etc., but all are optional.
+
+            // XDrop
+            virtual void dropObject(sal_Int32 nPosition, const ::rtl::OUString rName);
+
+        };
+
+    } // namespace firebird
+} // namespace connectivity
+
+
+#endif // CONNECTIVITY_FIREBIRD_USERS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file


More information about the Libreoffice-commits mailing list