diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-03-25 14:28:21 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-03-25 14:53:29 +0100 |
commit | 793fd21a4da5a442cc7130ae04628ffe3181ea6c (patch) | |
tree | 7393bc1dc5e43ad55d7922e0a1ee541c2a5dda90 /connectivity | |
parent | 21fb34bbb48393d6e631355f1124e5baa2759fcc (diff) |
loplugin:unusedmethods
Change-Id: I42cd6d52bd6c0759fa0a8b1b91bbf1af7eb70ba8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132117
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/Library_mysqlc.mk | 1 | ||||
-rw-r--r-- | connectivity/source/drivers/mysqlc/mysqlc_tables.cxx | 57 | ||||
-rw-r--r-- | connectivity/source/drivers/mysqlc/mysqlc_tables.hxx | 4 | ||||
-rw-r--r-- | connectivity/source/drivers/mysqlc/mysqlc_users.cxx | 71 | ||||
-rw-r--r-- | connectivity/source/drivers/mysqlc/mysqlc_users.hxx | 47 | ||||
-rw-r--r-- | connectivity/source/drivers/mysqlc/mysqlc_views.cxx | 7 | ||||
-rw-r--r-- | connectivity/source/drivers/mysqlc/mysqlc_views.hxx | 2 |
7 files changed, 0 insertions, 189 deletions
diff --git a/connectivity/Library_mysqlc.mk b/connectivity/Library_mysqlc.mk index af46fb9ba137..afc8f19b86cf 100644 --- a/connectivity/Library_mysqlc.mk +++ b/connectivity/Library_mysqlc.mk @@ -68,7 +68,6 @@ $(eval $(call gb_Library_add_exception_objects,mysqlc,\ connectivity/source/drivers/mysqlc/mysqlc_tables \ connectivity/source/drivers/mysqlc/mysqlc_types \ connectivity/source/drivers/mysqlc/mysqlc_user \ - connectivity/source/drivers/mysqlc/mysqlc_users \ connectivity/source/drivers/mysqlc/mysqlc_view \ connectivity/source/drivers/mysqlc/mysqlc_views \ )) diff --git a/connectivity/source/drivers/mysqlc/mysqlc_tables.cxx b/connectivity/source/drivers/mysqlc/mysqlc_tables.cxx index ee82134086e9..06218403f3fb 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_tables.cxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_tables.cxx @@ -87,63 +87,6 @@ connectivity::sdbcx::ObjectType connectivity::mysqlc::Tables::createObject(const return xRet; } -OUString connectivity::mysqlc::Tables::createStandardColumnPart( - const css::uno::Reference<css::beans::XPropertySet>& xColProp, - const css::uno::Reference<css::sdbc::XConnection>& _xConnection) -{ - css::uno::Reference<css::sdbc::XDatabaseMetaData> xMetaData = _xConnection->getMetaData(); - - ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap(); - - bool bIsAutoIncrement = 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; - css::uno::Reference<css::beans::XPropertySetInfo> xPropInfo = xColProp->getPropertySetInfo(); - - if (xPropInfo.is() - && xPropInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_AUTOINCREMENTCREATION))) - xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_AUTOINCREMENTCREATION)) - >>= sAutoIncrementValue; - - aSql.append(" "); - - aSql.append(dbtools::createStandardTypePart(xColProp, _xConnection)); - // Add character set for (VAR)BINARY (fix) types: - // (VAR) BINARY is distinguished from other CHAR types by its character set. - // Octets is a special character set for binary data. - if (xPropInfo.is() && xPropInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_TYPE))) - { - sal_Int32 aType = 0; - xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_TYPE)) >>= aType; - if (aType == css::sdbc::DataType::BINARY || aType == css::sdbc::DataType::VARBINARY) - { - aSql.append(" "); - aSql.append("CHARACTER SET OCTETS"); - } - } - - if (bIsAutoIncrement && !sAutoIncrementValue.isEmpty()) - { - aSql.append(" "); - aSql.append(sAutoIncrementValue); - } - // AutoIncrement "IDENTITY" is implicitly "NOT NULL" - else if (::comphelper::getINT32( - xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISNULLABLE))) - == css::sdbc::ColumnValue::NO_NULLS) - aSql.append(" NOT NULL"); - - return aSql.makeStringAndClear(); -} - css::uno::Reference<css::beans::XPropertySet> connectivity::mysqlc::Tables::createDescriptor() { // There is some internal magic so that the same class can be used as either diff --git a/connectivity/source/drivers/mysqlc/mysqlc_tables.hxx b/connectivity/source/drivers/mysqlc/mysqlc_tables.hxx index 2ee2ab9b96da..2d3c4c74533d 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_tables.hxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_tables.hxx @@ -24,10 +24,6 @@ class Tables : public ::connectivity::sdbcx::OCollection protected: css::uno::Reference<css::sdbc::XDatabaseMetaData> m_xMetaData; - static OUString createStandardColumnPart( - const css::uno::Reference<css::beans::XPropertySet>& xColProp, - const css::uno::Reference<com::sun::star::sdbc::XConnection>& _xConnection); - // OCollection virtual void impl_refresh() override; virtual ::connectivity::sdbcx::ObjectType createObject(const OUString& rName) override; diff --git a/connectivity/source/drivers/mysqlc/mysqlc_users.cxx b/connectivity/source/drivers/mysqlc/mysqlc_users.cxx deleted file mode 100644 index 41fce5c395cd..000000000000 --- a/connectivity/source/drivers/mysqlc/mysqlc_users.cxx +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ -/* - * 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 "mysqlc_user.hxx" -#include "mysqlc_users.hxx" - -using namespace ::connectivity; -using namespace ::connectivity::mysqlc; -using namespace ::connectivity::sdbcx; -using namespace ::cppu; -using namespace ::osl; -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, ::std::vector<OUString> const& rNames) - : OCollection(rParent, true, rMutex, rNames) - , m_xMetaData(rMetaData) -{ -} - -//----- OCollection ----------------------------------------------------------- -void Users::impl_refresh() -{ - // TODO: IMPLEMENT ME -} - -ObjectType Users::createObject(const OUString& rName) -{ - return new User(m_xMetaData->getConnection(), rName); -} - -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>&) -{ - // TODO: set sSql as appropriate - m_xMetaData->getConnection()->createStatement()->execute(OUString()); - - return createObject(rName); -} - -//----- XDrop ----------------------------------------------------------------- -void Users::dropObject(sal_Int32 nPosition, const OUString&) -{ - uno::Reference<XPropertySet> xUser(getObject(nPosition)); - - if (!ODescriptor::isNew(xUser)) - { - // TODO: drop me - } -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/connectivity/source/drivers/mysqlc/mysqlc_users.hxx b/connectivity/source/drivers/mysqlc/mysqlc_users.hxx deleted file mode 100644 index 15b5cf6b43f7..000000000000 --- a/connectivity/source/drivers/mysqlc/mysqlc_users.hxx +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ -/* - * 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/. - */ - -#pragma once - -#include <connectivity/sdbcx/VCollection.hxx> -#include <com/sun/star/sdbc/XDatabaseMetaData.hpp> - -namespace connectivity::mysqlc -{ -/** -* This implements com.sun.star.sdbcx.Container. -*/ -class Users : public ::connectivity::sdbcx::OCollection -{ - css::uno::Reference<css::sdbc::XDatabaseMetaData> m_xMetaData; - -protected: - // OCollection - virtual void impl_refresh() override; - virtual ::connectivity::sdbcx::ObjectType createObject(const OUString& rName) override; - virtual css::uno::Reference<css::beans::XPropertySet> createDescriptor() override; - virtual ::connectivity::sdbcx::ObjectType - appendObject(const OUString& rName, - const css::uno::Reference<css::beans::XPropertySet>& rDescriptor) override; - -public: - Users(const css::uno::Reference<css::sdbc::XDatabaseMetaData>& rMetaData, - ::cppu::OWeakObject& rParent, ::osl::Mutex& rMutex, - ::std::vector<OUString> const& rNames); - - // TODO: we should also implement XDataDescriptorFactory, XRefreshable, - // XAppend, etc., but all are optional. - - // XDrop - virtual void dropObject(sal_Int32 nPosition, const OUString& rName) override; -}; - -} // namespace connectivity::mysqlc - -/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/connectivity/source/drivers/mysqlc/mysqlc_views.cxx b/connectivity/source/drivers/mysqlc/mysqlc_views.cxx index c9bf0658652d..f10e30034efe 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_views.cxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_views.cxx @@ -84,13 +84,6 @@ void connectivity::mysqlc::Views::dropObject(sal_Int32 _nPos, const OUString& /* } } -void connectivity::mysqlc::Views::dropByNameImpl(const OUString& elementName) -{ - m_bInDrop = true; - connectivity::sdbcx::OCollection::dropByName(elementName); - m_bInDrop = false; -} - void connectivity::mysqlc::Views::createView( const css::uno::Reference<css::beans::XPropertySet>& descriptor) { diff --git a/connectivity/source/drivers/mysqlc/mysqlc_views.hxx b/connectivity/source/drivers/mysqlc/mysqlc_views.hxx index 2924111284bf..2177fdc2e3e3 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_views.hxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_views.hxx @@ -45,8 +45,6 @@ public: // XDrop virtual void dropObject(sal_Int32 _nPos, const OUString& _sElementName) override; - - void dropByNameImpl(const OUString& elementName); }; } |