From 37ec6cbeebc5dc9bf642eedcf45f0441edd3d610 Mon Sep 17 00:00:00 2001 From: Jorenz Paragas Date: Sat, 1 Aug 2015 12:36:33 -0700 Subject: tdf#91112: pass by const reference to lambdas Since the function returned by o3tl::compose1 had its parameter passed by const reference, the same should be done for the lambda expressions that replace o3tl::compose1. I overlooked this detail in my previous commits. Change-Id: I0db5eec4e74d4835e786742ee6de3805215f377f Reviewed-on: https://gerrit.libreoffice.org/17465 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- connectivity/source/drivers/ado/AColumn.cxx | 2 +- connectivity/source/drivers/ado/AColumns.cxx | 2 +- connectivity/source/drivers/ado/AConnection.cxx | 2 +- connectivity/source/drivers/hsqldb/HDriver.cxx | 4 ++-- connectivity/source/drivers/hsqldb/HStorageMap.cxx | 4 ++-- connectivity/source/drivers/odbc/OResultSet.cxx | 2 +- connectivity/source/manager/mdrivermanager.cxx | 6 +++--- 7 files changed, 11 insertions(+), 11 deletions(-) (limited to 'connectivity') diff --git a/connectivity/source/drivers/ado/AColumn.cxx b/connectivity/source/drivers/ado/AColumn.cxx index 81e18c5b1193..0e91b49e9503 100644 --- a/connectivity/source/drivers/ado/AColumn.cxx +++ b/connectivity/source/drivers/ado/AColumn.cxx @@ -216,7 +216,7 @@ void OAdoColumn::fillPropertyValues() { ::comphelper::UStringMixEqual aCase(sal_False); OTypeInfoMap::const_iterator aFind = ::std::find_if(pTypeInfoMap->begin(), pTypeInfoMap->end(), - [&aCase] (OTypeInfoMap::value_type typeInfo) { + [&aCase] (const OTypeInfoMap::value_type& typeInfo) { return aCase(typeInfo.second->getDBName(), OUString("VarBinary")); }); diff --git a/connectivity/source/drivers/ado/AColumns.cxx b/connectivity/source/drivers/ado/AColumns.cxx index 66af0bc58aeb..56a253c18399 100644 --- a/connectivity/source/drivers/ado/AColumns.cxx +++ b/connectivity/source/drivers/ado/AColumns.cxx @@ -89,7 +89,7 @@ sdbcx::ObjectType OColumns::appendObject( const OUString&, const Reference< XPro ::comphelper::UStringMixEqual aCase(sal_False); // search for typeinfo where the typename is equal sTypeName OTypeInfoMap::const_iterator aFind = ::std::find_if(pTypeInfoMap->begin(), pTypeInfoMap->end(), - [&aCase, &sTypeName] (OTypeInfoMap::value_type typeInfo) { + [&aCase, &sTypeName] (const OTypeInfoMap::value_type& typeInfo) { return aCase(typeInfo.second->getDBName(), sTypeName); }); diff --git a/connectivity/source/drivers/ado/AConnection.cxx b/connectivity/source/drivers/ado/AConnection.cxx index 463db7f4f833..f66adbd8baa5 100644 --- a/connectivity/source/drivers/ado/AConnection.cxx +++ b/connectivity/source/drivers/ado/AConnection.cxx @@ -599,7 +599,7 @@ const OExtendedTypeInfo* OConnection::getTypeInfoFromType(const OTypeInfoMap& _r ::comphelper::UStringMixEqual aCase(sal_False); // search for typeinfo where the typename is equal _sTypeName OTypeInfoMap::const_iterator aFind = ::std::find_if(_rTypeInfo.begin(), _rTypeInfo.end(), - [&aCase, &_sTypeName] (OTypeInfoMap::value_type typeInfo) { + [&aCase, &_sTypeName] (const OTypeInfoMap::value_type& typeInfo) { return aCase(typeInfo.second->getDBName(), _sTypeName); }); diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx index 373f0e81e593..5ae04b3acd88 100644 --- a/connectivity/source/drivers/hsqldb/HDriver.cxx +++ b/connectivity/source/drivers/hsqldb/HDriver.cxx @@ -584,7 +584,7 @@ namespace connectivity { OUString sKey = StorageContainer::getRegisteredKey(xStorage); TWeakPairVector::iterator i = ::std::find_if(m_aConnections.begin(),m_aConnections.end(), - [&sKey] (TWeakPairVector::value_type conn) { + [&sKey] (const TWeakPairVector::value_type& conn) { return conn.second.first == sKey; }); @@ -640,7 +640,7 @@ namespace connectivity if ( !sKey.isEmpty() ) { TWeakPairVector::iterator i = ::std::find_if(m_aConnections.begin(), m_aConnections.end(), - [&sKey] (TWeakPairVector::value_type conn) { + [&sKey] (const TWeakPairVector::value_type& conn) { return conn.second.first == sKey; }); diff --git a/connectivity/source/drivers/hsqldb/HStorageMap.cxx b/connectivity/source/drivers/hsqldb/HStorageMap.cxx index dd84f849ec72..321a12942d7b 100644 --- a/connectivity/source/drivers/hsqldb/HStorageMap.cxx +++ b/connectivity/source/drivers/hsqldb/HStorageMap.cxx @@ -171,7 +171,7 @@ namespace connectivity TStorages& rMap = lcl_getStorageMap(); // check if the storage is already in our map TStorages::iterator aFind = ::std::find_if(rMap.begin(),rMap.end(), - [&_xStorage] (TStorages::value_type storage) { + [&_xStorage] (const TStorages::value_type& storage) { // TStoragePair (second) -> TStorageURLPair (first) -> uno::Reference (first) return storage.second.first.first == _xStorage; }); @@ -203,7 +203,7 @@ namespace connectivity TStorages& rMap = lcl_getStorageMap(); // check if the storage is already in our map TStorages::iterator aFind = ::std::find_if(rMap.begin(),rMap.end(), - [&_xStorage] (TStorages::value_type storage) { + [&_xStorage] (const TStorages::value_type& storage) { // TStoragePair (second) -> TStorageURLPair (first) -> uno::Reference (first) return storage.second.first.first == _xStorage; }); diff --git a/connectivity/source/drivers/odbc/OResultSet.cxx b/connectivity/source/drivers/odbc/OResultSet.cxx index bd78ac57cdea..5e9c840f456f 100644 --- a/connectivity/source/drivers/odbc/OResultSet.cxx +++ b/connectivity/source/drivers/odbc/OResultSet.cxx @@ -1167,7 +1167,7 @@ Sequence OResultSet::impl_getBookmark( ) throw( SQLException, Runtim checkDisposed(OResultSet_BASE::rBHelper.bDisposed); TBookmarkPosMap::iterator aFind = ::std::find_if(m_aPosToBookmarks.begin(),m_aPosToBookmarks.end(), - [this] (TBookmarkPosMap::value_type bookmarkPos) { + [this] (const TBookmarkPosMap::value_type& bookmarkPos) { return bookmarkPos.second == m_nRowPos; }); diff --git a/connectivity/source/manager/mdrivermanager.cxx b/connectivity/source/manager/mdrivermanager.cxx index 8553ba4e028e..4b4ad1be7502 100644 --- a/connectivity/source/manager/mdrivermanager.cxx +++ b/connectivity/source/manager/mdrivermanager.cxx @@ -646,9 +646,9 @@ Reference< XDriver > OSDBCDriverManager::implGetDriverForURL(const OUString& _rU aFind = ::std::find_if( m_aDriversBS.begin(), // begin of search range m_aDriversBS.end(), // end of search range - [&_rURL, this] (DriverAccessArray::value_type driverAccess) { + [&_rURL, this] (const DriverAccessArray::value_type& driverAccess) { // extract the driver from the access, then ask the resulting driver for acceptance - const DriverAccess &ensuredAccess = EnsureDriver(m_xContext)(driverAccess); + const DriverAccess& ensuredAccess = EnsureDriver(m_xContext)(driverAccess); const Reference driver = ExtractDriverFromAccess()(ensuredAccess); return AcceptsURL(_rURL)(driver); }); @@ -670,7 +670,7 @@ Reference< XDriver > OSDBCDriverManager::implGetDriverForURL(const OUString& _rU DriverCollection::iterator aPos = ::std::find_if( m_aDriversRT.begin(), // begin of search range m_aDriversRT.end(), // end of search range - [&_rURL] (DriverCollection::value_type element) { + [&_rURL] (const DriverCollection::value_type& element) { // extract the driver from the collection element, then ask the resulting driver for acceptance const Reference driver = ExtractDriverFromCollectionElement()(element); return AcceptsURL(_rURL)(driver); -- cgit