diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-06-13 15:48:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-06-13 18:11:03 +0200 |
commit | 0f01b42e73af0e0baa57a353554a53d936c4f5e2 (patch) | |
tree | d928509c347cb0651cb040b4d99dde72417f515e /connectivity/source/drivers | |
parent | 646c6ddd91a98afddf914e3889cb269fc814c060 (diff) |
clang-tidy modernize-pass-by-value in connectivity
Change-Id: I1f1b609254c7f8cfba14c248167f81b51684d8e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135727
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source/drivers')
55 files changed, 218 insertions, 181 deletions
diff --git a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx index bdff15cafa82..bbf3b408ae01 100644 --- a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx +++ b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx @@ -116,13 +116,13 @@ Reference< XResultSet > ODbaseDatabaseMetaData::impl_getTypeInfo_throw( ) aRow[13] = new ORowSetValueDecorator(OUString("B")); aRows.push_back(aRow); - aRow[11] = new ORowSetValueDecorator(true); + aRow[11] = new ORowSetValueDecorator(ORowSetValue(true)); aRow[13] = new ORowSetValueDecorator(OUString("Y")); aRows.push_back(aRow); aRow[1] = new ORowSetValueDecorator(OUString("TIMESTAMP")); aRow[2] = new ORowSetValueDecorator(DataType::TIMESTAMP); - aRow[11] = new ORowSetValueDecorator(false); + aRow[11] = new ORowSetValueDecorator(ORowSetValue(false)); aRow[13] = new ORowSetValueDecorator(OUString("T")); aRows.push_back(aRow); @@ -291,7 +291,7 @@ Reference< XResultSet > SAL_CALL ODbaseDatabaseMetaData::getIndexInfo( if(unique && !getBOOL(xIndex->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISUNIQUE)))) continue; - aRow[4] = new ORowSetValueDecorator(getBOOL(xIndex->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISUNIQUE)))); + aRow[4] = new ORowSetValueDecorator(ORowSetValue(getBOOL(xIndex->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISUNIQUE))))); aRow[6] = new ORowSetValueDecorator(*pBegin); auto pIndex = comphelper::getFromUnoTunnel<ODbaseIndex>(xIndex); diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx index 3ac8b806499b..d091335f5495 100644 --- a/connectivity/source/drivers/dbase/dindexnode.cxx +++ b/connectivity/source/drivers/dbase/dindexnode.cxx @@ -26,6 +26,7 @@ #include <algorithm> #include <memory> +#include <utility> using namespace connectivity; @@ -38,10 +39,10 @@ ONDXKey::ONDXKey() { } -ONDXKey::ONDXKey(const ORowSetValue& rVal, sal_Int32 eType, sal_uInt32 nRec) +ONDXKey::ONDXKey(ORowSetValue aVal, sal_Int32 eType, sal_uInt32 nRec) : ONDXKey_BASE(eType) , nRecord(nRec) - , xValue(rVal) + , xValue(std::move(aVal)) { } diff --git a/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx b/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx index a2ce922ff193..338d4e397d3f 100644 --- a/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx +++ b/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx @@ -21,14 +21,15 @@ #include "NDatabaseMetaData.hxx" #include <connectivity/dbexception.hxx> #include <strings.hrc> +#include <utility> using namespace connectivity::evoab; using namespace com::sun::star::uno; using namespace com::sun::star::lang; using namespace com::sun::star::sdbc; -OEvoabResultSetMetaData::OEvoabResultSetMetaData(const OUString& _aTableName) - : m_aTableName(_aTableName) +OEvoabResultSetMetaData::OEvoabResultSetMetaData(OUString _aTableName) + : m_aTableName(std::move(_aTableName)) { } diff --git a/connectivity/source/drivers/evoab2/NResultSetMetaData.hxx b/connectivity/source/drivers/evoab2/NResultSetMetaData.hxx index 66fffb984e4f..e79d347b1c4d 100644 --- a/connectivity/source/drivers/evoab2/NResultSetMetaData.hxx +++ b/connectivity/source/drivers/evoab2/NResultSetMetaData.hxx @@ -40,7 +40,7 @@ namespace connectivity::evoab protected: virtual ~OEvoabResultSetMetaData() override; public: - explicit OEvoabResultSetMetaData(const OUString& _aTableName); + explicit OEvoabResultSetMetaData(OUString _aTableName); /// @throws css::sdbc::SQLException void setEvoabFields(const ::rtl::Reference<connectivity::OSQLColumns> &xColumns); sal_uInt32 fieldAtColumn(sal_Int32 columnIndex) const diff --git a/connectivity/source/drivers/evoab2/NTables.hxx b/connectivity/source/drivers/evoab2/NTables.hxx index 7e200ff6aee2..e5d454729431 100644 --- a/connectivity/source/drivers/evoab2/NTables.hxx +++ b/connectivity/source/drivers/evoab2/NTables.hxx @@ -20,6 +20,7 @@ #include <connectivity/sdbcx/VCollection.hxx> #include <com/sun/star/sdbc/XDatabaseMetaData.hpp> +#include <utility> namespace connectivity::evoab { @@ -30,11 +31,11 @@ namespace connectivity::evoab virtual sdbcx::ObjectType createObject(const OUString& _rName) override; virtual void impl_refresh() override; public: - OEvoabTables(const css::uno::Reference< css::sdbc::XDatabaseMetaData >& _rMetaData, + OEvoabTables(css::uno::Reference< css::sdbc::XDatabaseMetaData > _xMetaData, ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, const ::std::vector< OUString> &_rVector) : sdbcx::OCollection(_rParent,true,_rMutex,_rVector), - m_xMetaData(_rMetaData) + m_xMetaData(std::move(_xMetaData)) {} virtual void disposing() override; }; diff --git a/connectivity/source/drivers/file/FDriver.cxx b/connectivity/source/drivers/file/FDriver.cxx index 4b6d45fe7420..b24c4e67a532 100644 --- a/connectivity/source/drivers/file/FDriver.cxx +++ b/connectivity/source/drivers/file/FDriver.cxx @@ -26,6 +26,7 @@ #include <connectivity/dbexception.hxx> #include <strings.hrc> #include <resource/sharedresources.hxx> +#include <utility> using namespace connectivity::file; @@ -36,9 +37,9 @@ using namespace com::sun::star::sdbc; using namespace com::sun::star::sdbcx; using namespace com::sun::star::container; -OFileDriver::OFileDriver(const css::uno::Reference< css::uno::XComponentContext >& _rxContext) +OFileDriver::OFileDriver(css::uno::Reference< css::uno::XComponentContext > _xContext) : ODriver_BASE(m_aMutex) - ,m_xContext(_rxContext) + ,m_xContext(std::move(_xContext)) { } diff --git a/connectivity/source/drivers/file/FResultSetMetaData.cxx b/connectivity/source/drivers/file/FResultSetMetaData.cxx index fdc944043d2a..b9fdcc4c4cba 100644 --- a/connectivity/source/drivers/file/FResultSetMetaData.cxx +++ b/connectivity/source/drivers/file/FResultSetMetaData.cxx @@ -23,6 +23,7 @@ #include <connectivity/dbexception.hxx> #include <comphelper/types.hxx> #include <o3tl/safeint.hxx> +#include <utility> using namespace ::comphelper; @@ -37,9 +38,9 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; -OResultSetMetaData::OResultSetMetaData(const ::rtl::Reference<connectivity::OSQLColumns>& _rxColumns,const OUString& _aTableName,OFileTable* _pTable) - :m_aTableName(_aTableName) - ,m_xColumns(_rxColumns) +OResultSetMetaData::OResultSetMetaData(::rtl::Reference<connectivity::OSQLColumns> _xColumns, OUString _aTableName, OFileTable* _pTable) + :m_aTableName(std::move(_aTableName)) + ,m_xColumns(std::move(_xColumns)) ,m_pTable(_pTable) { } diff --git a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx index cfee4f41b81d..37c2ffe72c3d 100644 --- a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx +++ b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx @@ -821,14 +821,14 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo() // Common data aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue(); // Literal quote marks aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue(); // Literal quote marks - aRow[7] = new ORowSetValueDecorator(true); // Nullable - aRow[8] = new ORowSetValueDecorator(true); // Case sensitive - aRow[10] = new ORowSetValueDecorator(false); // Is unsigned + aRow[7] = new ORowSetValueDecorator(ORowSetValue(true)); // Nullable + aRow[8] = new ORowSetValueDecorator(ORowSetValue(true)); // Case sensitive + aRow[10] = new ORowSetValueDecorator(ORowSetValue(false)); // Is unsigned // FIXED_PREC_SCALE: docs state "can it be a money value? " however // in reality this causes Base to treat all numbers as money formatted // by default which is wrong (and formatting as money value is still // possible for all values). - aRow[11] = new ORowSetValueDecorator(false); + aRow[11] = new ORowSetValueDecorator(ORowSetValue(false)); // Localised Type Name -- TODO: implement (but can be null): aRow[13] = new ORowSetValueDecorator(); aRow[16] = new ORowSetValueDecorator(); // Unused @@ -842,7 +842,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo() aRow[6] = new ORowSetValueDecorator(OUString("length")); // Create Params aRow[9] = new ORowSetValueDecorator( sal_Int16(ColumnSearch::FULL)); // Searchable - aRow[12] = new ORowSetValueDecorator(false); // Autoincrement + aRow[12] = new ORowSetValueDecorator(ORowSetValue(false)); // Autoincrement aRow[14] = ODatabaseMetaDataResultSet::get0Value(); // Minimum scale aRow[15] = ODatabaseMetaDataResultSet::get0Value(); // Max scale tmp.push_back(aRow); @@ -854,7 +854,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo() aRow[6] = new ORowSetValueDecorator(OUString("length")); // Create Params aRow[9] = new ORowSetValueDecorator( sal_Int16(ColumnSearch::FULL)); // Searchable - aRow[12] = new ORowSetValueDecorator(false); // Autoincrement + aRow[12] = new ORowSetValueDecorator(ORowSetValue(false)); // Autoincrement aRow[14] = ODatabaseMetaDataResultSet::get0Value(); // Minimum scale aRow[15] = ODatabaseMetaDataResultSet::get0Value(); // Max scale tmp.push_back(aRow); @@ -888,7 +888,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo() aRow[6] = new ORowSetValueDecorator(); // Create Params aRow[9] = new ORowSetValueDecorator( sal_Int16(ColumnSearch::FULL)); // Searchable - aRow[12] = new ORowSetValueDecorator(false); // Autoincrement + aRow[12] = new ORowSetValueDecorator(ORowSetValue(false)); // Autoincrement aRow[14] = ODatabaseMetaDataResultSet::get0Value(); // Minimum scale aRow[15] = ODatabaseMetaDataResultSet::get0Value(); // Max scale tmp.push_back(aRow); @@ -904,7 +904,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo() aRow[6] = new ORowSetValueDecorator(); // Create Params aRow[9] = new ORowSetValueDecorator( sal_Int16(ColumnSearch::FULL)); // Searchable - aRow[12] = new ORowSetValueDecorator(true); // Autoincrement + aRow[12] = new ORowSetValueDecorator(ORowSetValue(true)); // Autoincrement aRow[14] = ODatabaseMetaDataResultSet::get0Value(); // Minimum scale aRow[15] = ODatabaseMetaDataResultSet::get0Value(); // Max scale } @@ -928,7 +928,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo() { aRow[9] = new ORowSetValueDecorator( sal_Int16(ColumnSearch::FULL)); // Searchable - aRow[12] = new ORowSetValueDecorator(true); // Autoincrement + aRow[12] = new ORowSetValueDecorator(ORowSetValue(true)); // Autoincrement } aRow[6] = new ORowSetValueDecorator(OUString("PRECISION,SCALE")); // Create params @@ -972,7 +972,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo() aRow[6] = new ORowSetValueDecorator(); // Create Params aRow[9] = new ORowSetValueDecorator( sal_Int16(ColumnSearch::FULL)); // Searchable - aRow[12] = new ORowSetValueDecorator(false); // Autoincrement + aRow[12] = new ORowSetValueDecorator(ORowSetValue(false)); // Autoincrement aRow[14] = ODatabaseMetaDataResultSet::get0Value(); // Minimum scale aRow[15] = ODatabaseMetaDataResultSet::get0Value(); // Max scale tmp.push_back(aRow); @@ -984,7 +984,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo() aRow[6] = new ORowSetValueDecorator(); // Create Params aRow[9] = new ORowSetValueDecorator( sal_Int16(ColumnSearch::FULL)); // Searchable - aRow[12] = new ORowSetValueDecorator(false); // Autoincrement + aRow[12] = new ORowSetValueDecorator(ORowSetValue(false)); // Autoincrement aRow[14] = ODatabaseMetaDataResultSet::get0Value(); // Minimum scale aRow[15] = ODatabaseMetaDataResultSet::get0Value(); // Max scale tmp.push_back(aRow); @@ -996,7 +996,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo() aRow[6] = new ORowSetValueDecorator(); // Create Params aRow[9] = new ORowSetValueDecorator( sal_Int16(ColumnSearch::FULL)); // Searchable - aRow[12] = new ORowSetValueDecorator(false); // Autoincrement + aRow[12] = new ORowSetValueDecorator(ORowSetValue(false)); // Autoincrement aRow[14] = ODatabaseMetaDataResultSet::get0Value(); // Minimum scale aRow[15] = ODatabaseMetaDataResultSet::get0Value(); // Max scale tmp.push_back(aRow); @@ -1008,7 +1008,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo() aRow[6] = new ORowSetValueDecorator(); // Create Params aRow[9] = new ORowSetValueDecorator( sal_Int16(ColumnSearch::NONE)); // Searchable - aRow[12] = new ORowSetValueDecorator(false); // Autoincrement + aRow[12] = new ORowSetValueDecorator(ORowSetValue(false)); // Autoincrement aRow[14] = ODatabaseMetaDataResultSet::get0Value(); // Minimum scale aRow[15] = ODatabaseMetaDataResultSet::get0Value(); // Max scale tmp.push_back(aRow); @@ -1020,7 +1020,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo() aRow[6] = new ORowSetValueDecorator(); // Create Params aRow[9] = new ORowSetValueDecorator( sal_Int16(ColumnSearch::BASIC)); // Searchable - aRow[12] = new ORowSetValueDecorator(false); // Autoincrement + aRow[12] = new ORowSetValueDecorator(ORowSetValue(false)); // Autoincrement aRow[14] = ODatabaseMetaDataResultSet::get0Value(); // Minimum scale aRow[15] = ODatabaseMetaDataResultSet::get0Value(); // Max scale tmp.push_back(aRow); @@ -1680,7 +1680,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getIndexInfo( } // 4. NON_UNIQUE -- i.e. specifically negate here. - aCurrentRow[4] = new ORowSetValueDecorator(xRow->getShort(5) == 0); + aCurrentRow[4] = new ORowSetValueDecorator(ORowSetValue(xRow->getShort(5) == 0)); // 6. INDEX NAME aCurrentRow[6] = new ORowSetValueDecorator(sanitizeIdentifier(xRow->getString(4))); @@ -1773,7 +1773,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges( aRow[4] = new ORowSetValueDecorator(sanitizeIdentifier(xRow->getString(2))); // 4. GRANTOR aRow[5] = new ORowSetValueDecorator(sanitizeIdentifier(xRow->getString(3))); // 5. GRANTEE aRow[6] = new ORowSetValueDecorator(xRow->getString(4)); // 6. Privilege - aRow[7] = new ORowSetValueDecorator(bool(xRow->getBoolean(5))); // 7. Is Grantable + aRow[7] = new ORowSetValueDecorator(ORowSetValue(bool(xRow->getBoolean(5)))); // 7. Is Grantable aResults.push_back(aRow); } diff --git a/connectivity/source/drivers/firebird/Tables.hxx b/connectivity/source/drivers/firebird/Tables.hxx index 7d84edb2084a..ada1827097a5 100644 --- a/connectivity/source/drivers/firebird/Tables.hxx +++ b/connectivity/source/drivers/firebird/Tables.hxx @@ -13,6 +13,7 @@ #include <com/sun/star/sdbc/XDatabaseMetaData.hpp> #include <connectivity/sdbcx/VCollection.hxx> +#include <utility> namespace connectivity::firebird { @@ -40,10 +41,10 @@ namespace connectivity::firebird const css::uno::Reference< css::beans::XPropertySet >& rDescriptor) override; public: - Tables(const css::uno::Reference< css::sdbc::XDatabaseMetaData >& rMetaData, + Tables(css::uno::Reference< css::sdbc::XDatabaseMetaData > xMetaData, ::cppu::OWeakObject& rParent, ::osl::Mutex& rMutex, - ::std::vector< OUString> const & rNames) : sdbcx::OCollection(rParent, true, rMutex, rNames), m_xMetaData(rMetaData) {} + ::std::vector< OUString> const & rNames) : sdbcx::OCollection(rParent, true, rMutex, rNames), m_xMetaData(std::move(xMetaData)) {} // TODO: we should also implement XDataDescriptorFactory, XRefreshable, // XAppend, etc., but all are optional. diff --git a/connectivity/source/drivers/firebird/Util.hxx b/connectivity/source/drivers/firebird/Util.hxx index bf1a172ed2c8..bfbfb62c22fc 100644 --- a/connectivity/source/drivers/firebird/Util.hxx +++ b/connectivity/source/drivers/firebird/Util.hxx @@ -14,6 +14,7 @@ #include <rtl/ustring.hxx> #include <com/sun/star/uno/XInterface.hpp> +#include <utility> namespace connectivity::firebird { @@ -57,16 +58,16 @@ public: * */ explicit ColumnTypeInfo( short aType, short aSubType = 0, - short nScale = 0, const OUString& sCharset = OUString() ) + short nScale = 0, OUString sCharset = OUString() ) : m_aType(aType) , m_aSubType(aSubType) , m_nScale(nScale) - , m_sCharsetName(sCharset) {} - explicit ColumnTypeInfo( short aType, const OUString& sCharset ) + , m_sCharsetName(std::move(sCharset)) {} + explicit ColumnTypeInfo( short aType, OUString sCharset ) : m_aType(aType) , m_aSubType(0) , m_nScale(0) - , m_sCharsetName(sCharset) {} + , m_sCharsetName(std::move(sCharset)) {} short getType() const { return m_aType; } short getSubType() const { return m_aSubType; } short getScale() const { return m_nScale; } diff --git a/connectivity/source/drivers/hsqldb/HUser.cxx b/connectivity/source/drivers/hsqldb/HUser.cxx index 2ed0c06262ff..f493e282a2b1 100644 --- a/connectivity/source/drivers/hsqldb/HUser.cxx +++ b/connectivity/source/drivers/hsqldb/HUser.cxx @@ -27,6 +27,7 @@ #include <com/sun/star/sdbcx/PrivilegeObject.hpp> #include <TConnection.hxx> #include <strings.hrc> +#include <utility> using namespace connectivity; using namespace connectivity::hsqldb; @@ -37,16 +38,16 @@ using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; -OHSQLUser::OHSQLUser( const css::uno::Reference< css::sdbc::XConnection >& _xConnection) : connectivity::sdbcx::OUser(true) - ,m_xConnection(_xConnection) +OHSQLUser::OHSQLUser( css::uno::Reference< css::sdbc::XConnection > _xConnection) : connectivity::sdbcx::OUser(true) + ,m_xConnection(std::move(_xConnection)) { construct(); } -OHSQLUser::OHSQLUser( const css::uno::Reference< css::sdbc::XConnection >& _xConnection, +OHSQLUser::OHSQLUser( css::uno::Reference< css::sdbc::XConnection > _xConnection, const OUString& Name ) : connectivity::sdbcx::OUser(Name,true) - ,m_xConnection(_xConnection) + ,m_xConnection(std::move(_xConnection)) { construct(); } diff --git a/connectivity/source/drivers/hsqldb/HUsers.cxx b/connectivity/source/drivers/hsqldb/HUsers.cxx index 9fe31e58eb01..12959833331e 100644 --- a/connectivity/source/drivers/hsqldb/HUsers.cxx +++ b/connectivity/source/drivers/hsqldb/HUsers.cxx @@ -23,6 +23,7 @@ #include <comphelper/types.hxx> #include <connectivity/dbtools.hxx> #include <TConnection.hxx> +#include <utility> using namespace ::comphelper; using namespace connectivity; @@ -36,10 +37,10 @@ using namespace ::com::sun::star::lang; OUsers::OUsers( ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, const ::std::vector< OUString> &_rVector, - const css::uno::Reference< css::sdbc::XConnection >& _xConnection, + css::uno::Reference< css::sdbc::XConnection > _xConnection, connectivity::sdbcx::IRefreshableUsers* _pParent) : sdbcx::OCollection(_rParent, true, _rMutex, _rVector) - ,m_xConnection(_xConnection) + ,m_xConnection(std::move(_xConnection)) ,m_pParent(_pParent) { } diff --git a/connectivity/source/drivers/jdbc/JConnection.cxx b/connectivity/source/drivers/jdbc/JConnection.cxx index 19391e60edac..cff6f8f4e45b 100644 --- a/connectivity/source/drivers/jdbc/JConnection.cxx +++ b/connectivity/source/drivers/jdbc/JConnection.cxx @@ -43,6 +43,7 @@ #include <unotools/confignode.hxx> #include <strings.hxx> +#include <utility> #include <vector> #include <memory> @@ -58,8 +59,8 @@ namespace { struct ClassMapEntry { ClassMapEntry( - OUString const & theClassPath, OUString const & theClassName): - classPath(theClassPath), className(theClassName), classLoader(nullptr), + OUString theClassPath, OUString theClassName): + classPath(std::move(theClassPath)), className(std::move(theClassName)), classLoader(nullptr), classObject(nullptr) {} OUString classPath; diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx index 18d95cdbdb81..804c8ccc66d8 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx +++ b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx @@ -18,6 +18,8 @@ */ +#include <utility> + #include "MNSProfileDiscover.hxx" #include "MNSFolders.hxx" #include "MNSINIParser.hxx" @@ -28,10 +30,10 @@ namespace connectivity::mozab { } - ProfileStruct::ProfileStruct(const OUString& aProfileName, - const OUString& aProfilePath) - : profileName(aProfileName) - , profilePath(aProfilePath) + ProfileStruct::ProfileStruct(OUString aProfileName, + OUString aProfilePath) + : profileName(std::move(aProfileName)) + , profilePath(std::move(aProfilePath)) { } diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx index a5f271183b27..132ac06c003c 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx +++ b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx @@ -37,7 +37,7 @@ namespace connectivity::mozab { public: ProfileStruct(); - ProfileStruct(const OUString& aProfileName, const OUString &aProfilePath); + ProfileStruct(OUString aProfileName, OUString aProfilePath); const OUString& getProfileName() const { return profileName;} const OUString& getProfilePath() const; private: diff --git a/connectivity/source/drivers/mysql_jdbc/YUser.cxx b/connectivity/source/drivers/mysql_jdbc/YUser.cxx index b683fe2b2757..ec3a6265967f 100644 --- a/connectivity/source/drivers/mysql_jdbc/YUser.cxx +++ b/connectivity/source/drivers/mysql_jdbc/YUser.cxx @@ -27,6 +27,7 @@ #include <TConnection.hxx> #include <strings.hrc> #include <comphelper/types.hxx> +#include <utility> using namespace connectivity; using namespace connectivity::mysql; @@ -37,17 +38,17 @@ using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; -OMySQLUser::OMySQLUser(const css::uno::Reference<css::sdbc::XConnection>& _xConnection) +OMySQLUser::OMySQLUser(css::uno::Reference<css::sdbc::XConnection> _xConnection) : connectivity::sdbcx::OUser(true) - , m_xConnection(_xConnection) + , m_xConnection(std::move(_xConnection)) { construct(); } -OMySQLUser::OMySQLUser(const css::uno::Reference<css::sdbc::XConnection>& _xConnection, +OMySQLUser::OMySQLUser(css::uno::Reference<css::sdbc::XConnection> _xConnection, const OUString& Name) : connectivity::sdbcx::OUser(Name, true) - , m_xConnection(_xConnection) + , m_xConnection(std::move(_xConnection)) { construct(); } diff --git a/connectivity/source/drivers/mysql_jdbc/YUsers.cxx b/connectivity/source/drivers/mysql_jdbc/YUsers.cxx index ed33cb0e2d7c..eba995a91044 100644 --- a/connectivity/source/drivers/mysql_jdbc/YUsers.cxx +++ b/connectivity/source/drivers/mysql_jdbc/YUsers.cxx @@ -23,6 +23,7 @@ #include <comphelper/types.hxx> #include <connectivity/dbtools.hxx> #include <TConnection.hxx> +#include <utility> using namespace ::comphelper; using namespace connectivity; @@ -35,10 +36,10 @@ using namespace ::com::sun::star::lang; OUsers::OUsers(::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, const ::std::vector<OUString>& _rVector, - const css::uno::Reference<css::sdbc::XConnection>& _xConnection, + css::uno::Reference<css::sdbc::XConnection> _xConnection, connectivity::sdbcx::IRefreshableUsers* _pParent) : sdbcx::OCollection(_rParent, true, _rMutex, _rVector) - , m_xConnection(_xConnection) + , m_xConnection(std::move(_xConnection)) , m_pParent(_pParent) { } diff --git a/connectivity/source/drivers/mysqlc/mysqlc_tables.hxx b/connectivity/source/drivers/mysqlc/mysqlc_tables.hxx index 2d3c4c74533d..8b05c5afaf9f 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_tables.hxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_tables.hxx @@ -12,6 +12,7 @@ #include <com/sun/star/sdbc/XDatabaseMetaData.hpp> #include <connectivity/sdbcx/VCollection.hxx> +#include <utility> namespace connectivity::mysqlc { @@ -38,11 +39,11 @@ protected: virtual void dropObject(sal_Int32 nPosition, const OUString& rName) override; public: - Tables(const css::uno::Reference<css::sdbc::XDatabaseMetaData>& rMetaData, + Tables(css::uno::Reference<css::sdbc::XDatabaseMetaData> xMetaData, ::cppu::OWeakObject& rParent, ::osl::Mutex& rMutex, ::std::vector<OUString> const& rNames) : sdbcx::OCollection(rParent, true, rMutex, rNames) - , m_xMetaData(rMetaData) + , m_xMetaData(std::move(xMetaData)) { } diff --git a/connectivity/source/drivers/mysqlc/mysqlc_user.cxx b/connectivity/source/drivers/mysqlc/mysqlc_user.cxx index 65470be59b86..c1cdc1e537af 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_user.cxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_user.cxx @@ -7,6 +7,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <utility> + #include "mysqlc_user.hxx" using namespace ::connectivity; @@ -16,16 +18,16 @@ using namespace ::connectivity::sdbcx; using namespace ::com::sun::star; using namespace ::com::sun::star::sdbc; -User::User(const css::uno::Reference<css::sdbc::XConnection>& rConnection) +User::User(css::uno::Reference<css::sdbc::XConnection> xConnection) : OUser(true) // Case Sensitive - , m_xConnection(rConnection) + , m_xConnection(std::move(xConnection)) { } -User::User(const css::uno::Reference<css::sdbc::XConnection>& rConnection, const OUString& rName) +User::User(css::uno::Reference<css::sdbc::XConnection> xConnection, const OUString& rName) : OUser(rName, true) // Case Sensitive - , m_xConnection(rConnection) + , m_xConnection(std::move(xConnection)) { } diff --git a/connectivity/source/drivers/mysqlc/mysqlc_user.hxx b/connectivity/source/drivers/mysqlc/mysqlc_user.hxx index e9e37e3fac47..aad2baa214d3 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_user.hxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_user.hxx @@ -25,11 +25,11 @@ public: /** * Create a "new" descriptor, which isn't yet in the database. */ - User(const css::uno::Reference<css::sdbc::XConnection>& rConnection); + User(css::uno::Reference<css::sdbc::XConnection> xConnection); /** * For a user that already exists in the db. */ - User(const css::uno::Reference<css::sdbc::XConnection>& rConnection, const OUString& rName); + User(css::uno::Reference<css::sdbc::XConnection> xConnection, const OUString& rName); // XAuthorizable virtual void SAL_CALL changePassword(const OUString&, const OUString& newPassword) override; diff --git a/connectivity/source/drivers/odbc/ODriver.cxx b/connectivity/source/drivers/odbc/ODriver.cxx index df7b3fd206b8..cf3c5596aad4 100644 --- a/connectivity/source/drivers/odbc/ODriver.cxx +++ b/connectivity/source/drivers/odbc/ODriver.cxx @@ -24,6 +24,7 @@ #include <cppuhelper/supportsservice.hxx> #include <strings.hrc> #include <resource/sharedresources.hxx> +#include <utility> using namespace connectivity::odbc; using namespace com::sun::star::uno; @@ -31,9 +32,9 @@ using namespace com::sun::star::lang; using namespace com::sun::star::beans; using namespace com::sun::star::sdbc; -ODBCDriver::ODBCDriver(const css::uno::Reference< css::uno::XComponentContext >& _rxContext) +ODBCDriver::ODBCDriver(css::uno::Reference< css::uno::XComponentContext > _xContext) :ODriver_BASE(m_aMutex) - ,m_xContext(_rxContext) + ,m_xContext(std::move(_xContext)) ,m_pDriverHandle(SQL_NULL_HANDLE) { } diff --git a/connectivity/source/drivers/postgresql/pq_array.hxx b/connectivity/source/drivers/postgresql/pq_array.hxx index b847d646a913..589fe063d234 100644 --- a/connectivity/source/drivers/postgresql/pq_array.hxx +++ b/connectivity/source/drivers/postgresql/pq_array.hxx @@ -39,6 +39,7 @@ #include <com/sun/star/sdbc/XArray.hpp> #include "pq_connection.hxx" +#include <utility> #include <vector> namespace pq_sdbc_driver @@ -53,14 +54,14 @@ class Array : public cppu::WeakImplHelper< css::sdbc::XArray > public: Array( - const rtl::Reference< comphelper::RefCountedMutex > & mutex, + rtl::Reference< comphelper::RefCountedMutex > mutex, std::vector< css::uno::Any > && data, - const css::uno::Reference< css::uno::XInterface > & owner, - const css::uno::Reference< css::script::XTypeConverter > &tc) : + css::uno::Reference< css::uno::XInterface > owner, + css::uno::Reference< css::script::XTypeConverter > tc) : m_data( std::move(data) ), - m_owner( owner ), - m_tc( tc ), - m_xMutex( mutex ) + m_owner(std::move( owner )), + m_tc(std::move( tc )), + m_xMutex(std::move( mutex )) {} public: // XArray diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx b/connectivity/source/drivers/postgresql/pq_connection.cxx index 6661a97d5669..422d97f76e22 100644 --- a/connectivity/source/drivers/postgresql/pq_connection.cxx +++ b/connectivity/source/drivers/postgresql/pq_connection.cxx @@ -34,6 +34,7 @@ * ************************************************************************/ +#include <utility> #include <vector> #include <string.h> @@ -96,8 +97,8 @@ class ClosableReference : public cppu::WeakImplHelper< css::uno::XReference > rtl::Reference<Connection> m_conn; ::rtl::ByteSequence m_id; public: - ClosableReference( const ::rtl::ByteSequence & id , Connection *that ) - : m_conn( that ), m_id( id ) + ClosableReference( ::rtl::ByteSequence id , Connection *that ) + : m_conn( that ), m_id(std::move( id )) { } @@ -115,9 +116,9 @@ public: Connection::Connection( const rtl::Reference< comphelper::RefCountedMutex > &refMutex, - const css::uno::Reference< css::uno::XComponentContext > & ctx ) + css::uno::Reference< css::uno::XComponentContext > ctx ) : ConnectionBase( refMutex->GetMutex() ), - m_ctx( ctx ) , + m_ctx(std::move( ctx )) , m_xMutex( refMutex ) { } diff --git a/connectivity/source/drivers/postgresql/pq_connection.hxx b/connectivity/source/drivers/postgresql/pq_connection.hxx index f30483f70938..2bba070a7273 100644 --- a/connectivity/source/drivers/postgresql/pq_connection.hxx +++ b/connectivity/source/drivers/postgresql/pq_connection.hxx @@ -134,7 +134,7 @@ private: public: Connection( const rtl::Reference< comphelper::RefCountedMutex > &refMutex, - const css::uno::Reference< css::uno::XComponentContext > & ctx ); + css::uno::Reference< css::uno::XComponentContext > ctx ); virtual ~Connection( ) override; diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx index 7da57d1b675c..99f82a1c3957 100644 --- a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx +++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx @@ -84,6 +84,7 @@ #include <com/sun/star/sdbc/IndexType.hpp> #include <com/sun/star/sdbc/ColumnValue.hpp> #include <com/sun/star/sdbc/ColumnSearch.hpp> +#include <utility> using ::osl::MutexGuard; @@ -114,12 +115,12 @@ namespace pq_sdbc_driver #define DEFERRABILITY_NONE 7 DatabaseMetaData::DatabaseMetaData( - const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, - const css::uno::Reference< css::sdbc::XConnection > & origin, + ::rtl::Reference< comphelper::RefCountedMutex > refMutex, + css::uno::Reference< css::sdbc::XConnection > origin, ConnectionSettings *pSettings ) - : m_xMutex( refMutex ), + : m_xMutex(std::move( refMutex )), m_pSettings( pSettings ), - m_origin( origin ), + m_origin(std::move( origin )), m_getIntSetting_stmt ( m_origin->prepareStatement("SELECT setting FROM pg_catalog.pg_settings WHERE name=?") ) { init_getReferences_stmt(); @@ -1364,9 +1365,9 @@ namespace { { DatabaseTypeDescription() {} - DatabaseTypeDescription( const OUString &name, const OUString & type ) : - typeName( name ), - typeType( type ) + DatabaseTypeDescription( OUString name, OUString type ) : + typeName(std::move( name )), + typeType(std::move( type )) {} DatabaseTypeDescription( const DatabaseTypeDescription &source ) : typeName( source.typeName ), diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.hxx b/connectivity/source/drivers/postgresql/pq_databasemetadata.hxx index 134f72cf0186..4e8b717a96b2 100644 --- a/connectivity/source/drivers/postgresql/pq_databasemetadata.hxx +++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.hxx @@ -74,8 +74,8 @@ class DatabaseMetaData : public: DatabaseMetaData( - const ::rtl::Reference< comphelper::RefCountedMutex > & reMutex, - const css::uno::Reference< css::sdbc::XConnection > & origin, + ::rtl::Reference< comphelper::RefCountedMutex > reMutex, + css::uno::Reference< css::sdbc::XConnection > origin, ConnectionSettings *pSettings ); diff --git a/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.cxx b/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.cxx index a75897ccb211..216a25220355 100644 --- a/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.cxx +++ b/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.cxx @@ -38,6 +38,7 @@ #include <com/sun/star/sdbc/SQLException.hpp> #include <cppuhelper/typeprovider.hxx> #include <cppuhelper/queryinterface.hxx> +#include <utility> using com::sun::star::uno::Sequence; @@ -58,9 +59,9 @@ FakedUpdateableResultSet::FakedUpdateableResultSet( PGresult *result, const OUString &schema, const OUString &table, - const OUString &aReason ) + OUString aReason ) : ResultSet( mutex, owner, pSettings, result, schema, table ), - m_aReason( aReason ) + m_aReason(std::move( aReason )) {} diff --git a/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.hxx b/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.hxx index c2907aeb0290..44e7dc9bcf13 100644 --- a/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.hxx +++ b/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.hxx @@ -61,7 +61,7 @@ public: PGresult *result, const OUString &schema, const OUString &table, - const OUString &aReason ); + OUString aReason ); public: // XInterface virtual void SAL_CALL acquire() noexcept override { ResultSet::acquire(); } diff --git a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx index 2f31b4226c08..dd30a39317ec 100644 --- a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx +++ b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx @@ -57,6 +57,7 @@ #include <string_view> #include <connectivity/dbconversion.hxx> +#include <utility> using osl::MutexGuard; @@ -149,12 +150,12 @@ PreparedStatement::PreparedStatement( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< XConnection > & conn, struct ConnectionSettings *pSettings, - const OString & stmt ) + OString stmt ) : PreparedStatement_BASE(refMutex->GetMutex()) , OPropertySetHelper(PreparedStatement_BASE::rBHelper) , m_connection(conn) , m_pSettings(pSettings) - , m_stmt(stmt) + , m_stmt(std::move(stmt)) , m_xMutex(refMutex) , m_multipleResultAvailable(false) , m_multipleResultUpdateCount(0) diff --git a/connectivity/source/drivers/postgresql/pq_preparedstatement.hxx b/connectivity/source/drivers/postgresql/pq_preparedstatement.hxx index 4755efbe0368..ed81420cec7d 100644 --- a/connectivity/source/drivers/postgresql/pq_preparedstatement.hxx +++ b/connectivity/source/drivers/postgresql/pq_preparedstatement.hxx @@ -98,7 +98,7 @@ public: PreparedStatement( const rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection> & con, struct ConnectionSettings *pSettings, - const OString &stmt ); + OString stmt ); virtual ~PreparedStatement() override; public: // XInterface diff --git a/connectivity/source/drivers/postgresql/pq_resultset.cxx b/connectivity/source/drivers/postgresql/pq_resultset.cxx index 556bae92d5be..0058041c87b5 100644 --- a/connectivity/source/drivers/postgresql/pq_resultset.cxx +++ b/connectivity/source/drivers/postgresql/pq_resultset.cxx @@ -44,6 +44,7 @@ #include <com/sun/star/sdbc/ResultSetType.hpp> #include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/sdbc/SQLException.hpp> +#include <utility> using osl::MutexGuard; @@ -79,14 +80,14 @@ ResultSet::ResultSet( const ::rtl::Reference< comphelper::RefCountedMutex > & re const Reference< XInterface > & owner, ConnectionSettings **ppSettings, PGresult * result, - const OUString &schema, - const OUString &table) + OUString schema, + OUString table) : BaseResultSet( refMutex, owner, PQntuples( result ), PQnfields( result ),(*ppSettings)->tc ), m_result( result ), - m_schema( schema ), - m_table( table ), + m_schema(std::move( schema )), + m_table(std::move( table )), m_ppSettings( ppSettings ) { // LEM TODO: shouldn't these things be inherited from the statement or something like that? diff --git a/connectivity/source/drivers/postgresql/pq_resultset.hxx b/connectivity/source/drivers/postgresql/pq_resultset.hxx index 340e34b70c3b..cf2888bf5b93 100644 --- a/connectivity/source/drivers/postgresql/pq_resultset.hxx +++ b/connectivity/source/drivers/postgresql/pq_resultset.hxx @@ -72,8 +72,8 @@ public: const css::uno::Reference< css::uno::XInterface > &owner, ConnectionSettings **pSettings, PGresult *result, - const OUString &schema, - const OUString &table ); + OUString schema, + OUString table ); virtual ~ResultSet() override; public: // XCloseable diff --git a/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx b/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx index fbe10f82dacb..0b12f3a73d77 100644 --- a/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx +++ b/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx @@ -46,6 +46,7 @@ #include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/sdbc/SQLException.hpp> #include <com/sun/star/sdbc/XRow.hpp> +#include <utility> #include <string.h> @@ -113,18 +114,18 @@ static void extractPrecisionAndScale( sal_Int32 atttypmod, sal_Int32 *precision, } ResultSetMetaData::ResultSetMetaData( - const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, - const css::uno::Reference< css::sdbc::XResultSet > & origin, + ::rtl::Reference< comphelper::RefCountedMutex > refMutex, + css::uno::Reference< css::sdbc::XResultSet > origin, ResultSet * pResultSet, ConnectionSettings **ppSettings, PGresult const *pResult, - const OUString &schemaName, - const OUString &tableName ) : - m_xMutex( refMutex ), + OUString schemaName, + OUString tableName ) : + m_xMutex(std::move( refMutex )), m_ppSettings( ppSettings ), - m_origin( origin ), - m_tableName( tableName ), - m_schemaName( schemaName ), + m_origin(std::move( origin )), + m_tableName(std::move( tableName )), + m_schemaName(std::move( schemaName )), m_colDesc( PQnfields( pResult ) ), m_pResultSet( pResultSet ), m_checkedForTable( false ), diff --git a/connectivity/source/drivers/postgresql/pq_resultsetmetadata.hxx b/connectivity/source/drivers/postgresql/pq_resultsetmetadata.hxx index 67e34d44d257..71c98190ba2b 100644 --- a/connectivity/source/drivers/postgresql/pq_resultsetmetadata.hxx +++ b/connectivity/source/drivers/postgresql/pq_resultsetmetadata.hxx @@ -89,13 +89,13 @@ class ResultSetMetaData : public: ResultSetMetaData( - const ::rtl::Reference< comphelper::RefCountedMutex > & reMutex, - const css::uno::Reference< css::sdbc::XResultSet > & origin, + ::rtl::Reference< comphelper::RefCountedMutex > reMutex, + css::uno::Reference< css::sdbc::XResultSet > origin, ResultSet *pResultSet, ConnectionSettings **pSettings, PGresult const *pResult, - const OUString &schemaName, - const OUString &tableName ); + OUString schemaName, + OUString tableName ); public: // Methods diff --git a/connectivity/source/drivers/postgresql/pq_statics.cxx b/connectivity/source/drivers/postgresql/pq_statics.cxx index ec3d0d8ac587..f69556202240 100644 --- a/connectivity/source/drivers/postgresql/pq_statics.cxx +++ b/connectivity/source/drivers/postgresql/pq_statics.cxx @@ -37,6 +37,7 @@ #include "pq_statics.hxx" #include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> +#include <utility> using com::sun::star::uno::Sequence; using com::sun::star::uno::Any; @@ -68,8 +69,8 @@ struct BaseTypeDef { const char * typeName; sal_Int32 value; }; struct PropertyDef { - PropertyDef( const OUString &str, const Type &t ) - : name( str ) , type( t ) {} + PropertyDef( OUString str, const Type &t ) + : name(std::move( str )) , type( t ) {} OUString name; css::uno::Type type; }; diff --git a/connectivity/source/drivers/postgresql/pq_statics.hxx b/connectivity/source/drivers/postgresql/pq_statics.hxx index b5a868d6c691..4e745e4086ee 100644 --- a/connectivity/source/drivers/postgresql/pq_statics.hxx +++ b/connectivity/source/drivers/postgresql/pq_statics.hxx @@ -37,6 +37,7 @@ #pragma once #include <unordered_map> +#include <utility> #include <vector> #include <com/sun/star/uno/Any.hxx> @@ -50,20 +51,20 @@ namespace pq_sdbc_driver struct ColumnMetaData { ColumnMetaData( - const OUString &_columnName, - const OUString &_tableName, - const OUString &_schemaTableName, - const OUString &_typeName, + OUString _columnName, + OUString _tableName, + OUString _schemaTableName, + OUString _typeName, sal_Int32 _type, sal_Int32 _precision, sal_Int32 _scale, bool _isCurrency, bool _isNullable, bool _isAutoIncrement ) : - columnName( _columnName ), - tableName( _tableName ), - schemaTableName( _schemaTableName ), - typeName( _typeName ), + columnName(std::move( _columnName )), + tableName(std::move( _tableName )), + schemaTableName(std::move( _schemaTableName )), + typeName(std::move( _typeName )), type( _type ), precision( _precision ), scale( _scale ), diff --git a/connectivity/source/drivers/postgresql/pq_updateableresultset.hxx b/connectivity/source/drivers/postgresql/pq_updateableresultset.hxx index 1beeadc31e98..52cb513a5856 100644 --- a/connectivity/source/drivers/postgresql/pq_updateableresultset.hxx +++ b/connectivity/source/drivers/postgresql/pq_updateableresultset.hxx @@ -44,6 +44,7 @@ #include <com/sun/star/sdbc/ResultSetType.hpp> #include <com/sun/star/sdbc/XResultSetUpdate.hpp> #include <com/sun/star/sdbc/XRowUpdate.hpp> +#include <utility> namespace pq_sdbc_driver { @@ -78,13 +79,13 @@ private: std::vector< OUString >&& colNames, std::vector< std::vector< css::uno::Any > >&& data, ConnectionSettings **ppSettings, - const OUString &schema, - const OUString &table, + OUString schema, + OUString table, std::vector< OUString >&& primaryKey) : SequenceResultSet( mutex, owner, std::move(colNames), std::move(data), (*ppSettings)->tc ), m_ppSettings( ppSettings ), - m_schema( schema ), - m_table( table ), + m_schema(std::move( schema )), + m_table(std::move( table )), m_primaryKey( std::move(primaryKey) ), m_insertRow( false ) { diff --git a/connectivity/source/drivers/postgresql/pq_xbase.cxx b/connectivity/source/drivers/postgresql/pq_xbase.cxx index 5dbe6e98b5ab..001046aa52fa 100644 --- a/connectivity/source/drivers/postgresql/pq_xbase.cxx +++ b/connectivity/source/drivers/postgresql/pq_xbase.cxx @@ -36,6 +36,7 @@ #include <cppuhelper/supportsservice.hxx> #include <comphelper/sequence.hxx> +#include <utility> #include "pq_statics.hxx" #include "pq_tools.hxx" @@ -56,18 +57,18 @@ namespace pq_sdbc_driver { ReflectionBase::ReflectionBase( - const OUString &implName, + OUString implName, const css::uno::Sequence< OUString > &supportedServices, const ::rtl::Reference< comphelper::RefCountedMutex >& refMutex, - const css::uno::Reference< css::sdbc::XConnection > &conn, + css::uno::Reference< css::sdbc::XConnection > conn, ConnectionSettings *pSettings, cppu::IPropertyArrayHelper & props /* must survive this object !*/ ) : ReflectionBase_BASE( refMutex->GetMutex() ), OPropertySetHelper( ReflectionBase_BASE::rBHelper ), - m_implName( implName ), + m_implName(std::move( implName )), m_supportedServices( supportedServices ), m_xMutex( refMutex ), - m_conn( conn ), + m_conn(std::move( conn )), m_pSettings( pSettings ), m_propsDesc( props ), m_values( props.getProperties().getLength() ) diff --git a/connectivity/source/drivers/postgresql/pq_xbase.hxx b/connectivity/source/drivers/postgresql/pq_xbase.hxx index 3cd16bc70ee2..e4ca16fd5e6a 100644 --- a/connectivity/source/drivers/postgresql/pq_xbase.hxx +++ b/connectivity/source/drivers/postgresql/pq_xbase.hxx @@ -65,10 +65,10 @@ protected: std::vector< css::uno::Any > m_values; public: ReflectionBase( - const OUString &implName, + OUString implName, const css::uno::Sequence< OUString > &supportedServices, const ::rtl::Reference< comphelper::RefCountedMutex >& refMutex, - const css::uno::Reference< css::sdbc::XConnection > &conn, + css::uno::Reference< css::sdbc::XConnection > conn, ConnectionSettings *pSettings, cppu::IPropertyArrayHelper & props /* must survive this object !*/ ); diff --git a/connectivity/source/drivers/postgresql/pq_xcolumns.cxx b/connectivity/source/drivers/postgresql/pq_xcolumns.cxx index f1d3c0a53e88..0c0a80c44809 100644 --- a/connectivity/source/drivers/postgresql/pq_xcolumns.cxx +++ b/connectivity/source/drivers/postgresql/pq_xcolumns.cxx @@ -50,6 +50,7 @@ #include <com/sun/star/sdbc/ColumnValue.hpp> #include <cppuhelper/exc_hlp.hxx> +#include <utility> #include "pq_xcolumns.hxx" #include "pq_xcolumn.hxx" @@ -109,11 +110,11 @@ Columns::Columns( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, - const OUString &schemaName, - const OUString &tableName) + OUString schemaName, + OUString tableName) : Container( refMutex, origin, pSettings, "COLUMN" ), - m_schemaName( schemaName ), - m_tableName( tableName ) + m_schemaName(std::move( schemaName )), + m_tableName(std::move( tableName )) {} Columns::~Columns() diff --git a/connectivity/source/drivers/postgresql/pq_xcolumns.hxx b/connectivity/source/drivers/postgresql/pq_xcolumns.hxx index aa91a9754218..8ff8fcfbd95c 100644 --- a/connectivity/source/drivers/postgresql/pq_xcolumns.hxx +++ b/connectivity/source/drivers/postgresql/pq_xcolumns.hxx @@ -80,8 +80,8 @@ private: const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, - const OUString &schemaName, - const OUString &tableName); + OUString schemaName, + OUString tableName); virtual ~Columns() override; diff --git a/connectivity/source/drivers/postgresql/pq_xcontainer.cxx b/connectivity/source/drivers/postgresql/pq_xcontainer.cxx index fea88b682cdb..5c0567b2dc3a 100644 --- a/connectivity/source/drivers/postgresql/pq_xcontainer.cxx +++ b/connectivity/source/drivers/postgresql/pq_xcontainer.cxx @@ -38,6 +38,7 @@ #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <cppuhelper/implbase.hxx> #include <o3tl/safeint.hxx> +#include <utility> #include "pq_xcontainer.hxx" #include "pq_statics.hxx" @@ -136,14 +137,14 @@ public: Container::Container( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, - const css::uno::Reference< css::sdbc::XConnection > & origin, + css::uno::Reference< css::sdbc::XConnection > origin, ConnectionSettings *pSettings, - const OUString &type) + OUString type) : ContainerBase( refMutex->GetMutex() ), m_xMutex( refMutex ), m_pSettings( pSettings ), - m_origin( origin ), - m_type( type ) + m_origin(std::move( origin )), + m_type(std::move( type )) { } diff --git a/connectivity/source/drivers/postgresql/pq_xcontainer.hxx b/connectivity/source/drivers/postgresql/pq_xcontainer.hxx index fd9d432bfad3..4b6c190b0a59 100644 --- a/connectivity/source/drivers/postgresql/pq_xcontainer.hxx +++ b/connectivity/source/drivers/postgresql/pq_xcontainer.hxx @@ -117,9 +117,9 @@ protected: public: Container( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, - const css::uno::Reference< css::sdbc::XConnection > & origin, + css::uno::Reference< css::sdbc::XConnection > origin, ConnectionSettings *pSettings, - const OUString & type // for exception messages + OUString type // for exception messages ); public: // XIndexAccess diff --git a/connectivity/source/drivers/postgresql/pq_xindex.cxx b/connectivity/source/drivers/postgresql/pq_xindex.cxx index 5a96eeeb119d..4753b5fd4e3c 100644 --- a/connectivity/source/drivers/postgresql/pq_xindex.cxx +++ b/connectivity/source/drivers/postgresql/pq_xindex.cxx @@ -37,6 +37,7 @@ #include <cppuhelper/typeprovider.hxx> #include <cppuhelper/queryinterface.hxx> #include <rtl/ref.hxx> +#include <utility> #include "pq_xindex.hxx" #include "pq_xindexcolumns.hxx" @@ -58,8 +59,8 @@ namespace pq_sdbc_driver Index::Index( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings, - const OUString & schemaName, - const OUString & tableName ) + OUString schemaName, + OUString tableName ) : ReflectionBase( getStatics().refl.index.implName, getStatics().refl.index.serviceNames, @@ -67,8 +68,8 @@ Index::Index( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, connection, pSettings, * getStatics().refl.index.pProps ), - m_schemaName( schemaName ), - m_tableName( tableName ) + m_schemaName(std::move( schemaName )), + m_tableName(std::move( tableName )) {} Reference< XPropertySet > Index::createDataDescriptor( ) diff --git a/connectivity/source/drivers/postgresql/pq_xindex.hxx b/connectivity/source/drivers/postgresql/pq_xindex.hxx index 46275ad3aafa..8ccf45660467 100644 --- a/connectivity/source/drivers/postgresql/pq_xindex.hxx +++ b/connectivity/source/drivers/postgresql/pq_xindex.hxx @@ -61,8 +61,8 @@ public: Index( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings, - const OUString &schemaName, - const OUString &tableName); + OUString schemaName, + OUString tableName); public: // XInterface virtual void SAL_CALL acquire() noexcept override { ReflectionBase::acquire(); } diff --git a/connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx b/connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx index 841ea98054d9..2bca00e13b77 100644 --- a/connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx +++ b/connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx @@ -37,6 +37,7 @@ #include <sal/log.hxx> #include <string_view> +#include <utility> #include <vector> #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> @@ -72,14 +73,14 @@ IndexColumns::IndexColumns( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, - const OUString &schemaName, - const OUString &tableName, - const OUString &indexName, + OUString schemaName, + OUString tableName, + OUString indexName, const css::uno::Sequence< OUString > &columns ) : Container( refMutex, origin, pSettings, "INDEX_COLUMN" ), - m_schemaName( schemaName ), - m_tableName( tableName ), - m_indexName( indexName ), + m_schemaName(std::move( schemaName )), + m_tableName(std::move( tableName )), + m_indexName(std::move( indexName )), m_columns( columns ) {} diff --git a/connectivity/source/drivers/postgresql/pq_xindexcolumns.hxx b/connectivity/source/drivers/postgresql/pq_xindexcolumns.hxx index eaaa709e671a..a838d5d66908 100644 --- a/connectivity/source/drivers/postgresql/pq_xindexcolumns.hxx +++ b/connectivity/source/drivers/postgresql/pq_xindexcolumns.hxx @@ -63,9 +63,9 @@ private: const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, - const OUString &schemaName, - const OUString &tableName, - const OUString &indexName, + OUString schemaName, + OUString tableName, + OUString indexName, const css::uno::Sequence< OUString > &columns ); virtual ~IndexColumns() override; diff --git a/connectivity/source/drivers/postgresql/pq_xindexes.cxx b/connectivity/source/drivers/postgresql/pq_xindexes.cxx index ef1e7116a1b0..79f0939c1aba 100644 --- a/connectivity/source/drivers/postgresql/pq_xindexes.cxx +++ b/connectivity/source/drivers/postgresql/pq_xindexes.cxx @@ -44,6 +44,7 @@ #include <com/sun/star/sdbc/XParameters.hpp> #include <cppuhelper/exc_hlp.hxx> #include <o3tl/safeint.hxx> +#include <utility> #include "pq_xindexes.hxx" #include "pq_xindex.hxx" @@ -78,11 +79,11 @@ Indexes::Indexes( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, - const OUString &schemaName, - const OUString &tableName) + OUString schemaName, + OUString tableName) : Container( refMutex, origin, pSettings, getStatics().KEY ), - m_schemaName( schemaName ), - m_tableName( tableName ) + m_schemaName(std::move( schemaName )), + m_tableName(std::move( tableName )) { } diff --git a/connectivity/source/drivers/postgresql/pq_xindexes.hxx b/connectivity/source/drivers/postgresql/pq_xindexes.hxx index c2e81f61751f..536d17b96198 100644 --- a/connectivity/source/drivers/postgresql/pq_xindexes.hxx +++ b/connectivity/source/drivers/postgresql/pq_xindexes.hxx @@ -58,8 +58,8 @@ private: const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, - const OUString &schemaName, - const OUString &tableName); + OUString schemaName, + OUString tableName); virtual ~Indexes() override; diff --git a/connectivity/source/drivers/postgresql/pq_xkey.cxx b/connectivity/source/drivers/postgresql/pq_xkey.cxx index e2777824568f..81d1f7a86eb6 100644 --- a/connectivity/source/drivers/postgresql/pq_xkey.cxx +++ b/connectivity/source/drivers/postgresql/pq_xkey.cxx @@ -37,6 +37,7 @@ #include <cppuhelper/typeprovider.hxx> #include <cppuhelper/queryinterface.hxx> #include <rtl/ref.hxx> +#include <utility> #include "pq_xkey.hxx" #include "pq_xkeycolumns.hxx" @@ -57,8 +58,8 @@ namespace pq_sdbc_driver Key::Key( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings, - const OUString & schemaName, - const OUString & tableName ) + OUString schemaName, + OUString tableName ) : ReflectionBase( getStatics().refl.key.implName, getStatics().refl.key.serviceNames, @@ -66,8 +67,8 @@ Key::Key( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, connection, pSettings, * getStatics().refl.key.pProps ), - m_schemaName( schemaName ), - m_tableName( tableName ) + m_schemaName(std::move( schemaName )), + m_tableName(std::move( tableName )) {} Reference< XPropertySet > Key::createDataDescriptor( ) diff --git a/connectivity/source/drivers/postgresql/pq_xkey.hxx b/connectivity/source/drivers/postgresql/pq_xkey.hxx index d231e1e89945..68f05fd27d4e 100644 --- a/connectivity/source/drivers/postgresql/pq_xkey.hxx +++ b/connectivity/source/drivers/postgresql/pq_xkey.hxx @@ -61,8 +61,8 @@ public: Key( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & connection, ConnectionSettings *pSettings, - const OUString &schemaName, - const OUString &tableName); + OUString schemaName, + OUString tableName); public: // XInterface virtual void SAL_CALL acquire() noexcept override { ReflectionBase::acquire(); } diff --git a/connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx b/connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx index 8b62f28423a5..97e0ef29bbda 100644 --- a/connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx +++ b/connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx @@ -40,6 +40,7 @@ #include <com/sun/star/sdbc/XRow.hpp> #include <cppuhelper/exc_hlp.hxx> #include <rtl/ref.hxx> +#include <utility> #include "pq_xcolumns.hxx" #include "pq_xkeycolumns.hxx" @@ -68,13 +69,13 @@ KeyColumns::KeyColumns( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, - const OUString &schemaName, - const OUString &tableName, + OUString schemaName, + OUString tableName, const Sequence< OUString > &columnNames, const Sequence< OUString > &foreignColumnNames ) : Container( refMutex, origin, pSettings, "KEY_COLUMN" ), - m_schemaName( schemaName ), - m_tableName( tableName ), + m_schemaName(std::move( schemaName )), + m_tableName(std::move( tableName )), m_columnNames( columnNames ), m_foreignColumnNames( foreignColumnNames ) {} diff --git a/connectivity/source/drivers/postgresql/pq_xkeycolumns.hxx b/connectivity/source/drivers/postgresql/pq_xkeycolumns.hxx index 0c56fd189e9a..60bbd0c0de36 100644 --- a/connectivity/source/drivers/postgresql/pq_xkeycolumns.hxx +++ b/connectivity/source/drivers/postgresql/pq_xkeycolumns.hxx @@ -63,8 +63,8 @@ private: const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, - const OUString &schemaName, - const OUString &tableName, + OUString schemaName, + OUString tableName, const css::uno::Sequence< OUString > &keyColumns, const css::uno::Sequence< OUString > &foreignColumnNames); diff --git a/connectivity/source/drivers/postgresql/pq_xkeys.cxx b/connectivity/source/drivers/postgresql/pq_xkeys.cxx index dced2bc9baa5..0758be630e04 100644 --- a/connectivity/source/drivers/postgresql/pq_xkeys.cxx +++ b/connectivity/source/drivers/postgresql/pq_xkeys.cxx @@ -50,6 +50,7 @@ #include <com/sun/star/sdbcx/KeyType.hpp> #include <cppuhelper/exc_hlp.hxx> #include <o3tl/safeint.hxx> +#include <utility> #include "pq_xkeys.hxx" #include "pq_xkey.hxx" @@ -79,11 +80,11 @@ Keys::Keys( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, - const OUString &schemaName, - const OUString &tableName) + OUString schemaName, + OUString tableName) : Container( refMutex, origin, pSettings, getStatics().KEY ), - m_schemaName( schemaName ), - m_tableName( tableName ) + m_schemaName(std::move( schemaName )), + m_tableName(std::move( tableName )) {} Keys::~Keys() diff --git a/connectivity/source/drivers/postgresql/pq_xkeys.hxx b/connectivity/source/drivers/postgresql/pq_xkeys.hxx index fe1afef35a4b..ef6376d4d780 100644 --- a/connectivity/source/drivers/postgresql/pq_xkeys.hxx +++ b/connectivity/source/drivers/postgresql/pq_xkeys.hxx @@ -58,8 +58,8 @@ private: const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex, const css::uno::Reference< css::sdbc::XConnection > & origin, ConnectionSettings *pSettings, - const OUString &schemaName, - const OUString &tableName); + OUString schemaName, + OUString tableName); virtual ~Keys() override; |