summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorenz Paragas <j.paragas.237@gmail.com>2015-08-01 12:36:33 -0700
committerNoel Grandin <noelgrandin@gmail.com>2015-08-03 07:02:57 +0000
commit37ec6cbeebc5dc9bf642eedcf45f0441edd3d610 (patch)
tree9ab7fc6c7c7f6a6ece96fa54cd6d66f6bc7b2e79
parent4a2e0fa708bb00d35febe9e8939dcc0c2197e2f4 (diff)
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 <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--connectivity/source/drivers/ado/AColumn.cxx2
-rw-r--r--connectivity/source/drivers/ado/AColumns.cxx2
-rw-r--r--connectivity/source/drivers/ado/AConnection.cxx2
-rw-r--r--connectivity/source/drivers/hsqldb/HDriver.cxx4
-rw-r--r--connectivity/source/drivers/hsqldb/HStorageMap.cxx4
-rw-r--r--connectivity/source/drivers/odbc/OResultSet.cxx2
-rw-r--r--connectivity/source/manager/mdrivermanager.cxx6
-rw-r--r--dbaccess/source/core/dataaccess/definitioncontainer.cxx4
-rw-r--r--dbaccess/source/ui/control/tabletree.cxx4
-rw-r--r--dbaccess/source/ui/misc/DExport.cxx2
-rw-r--r--dbaccess/source/ui/misc/WColumnSelect.cxx4
-rw-r--r--dbaccess/source/ui/misc/WCopyTable.cxx4
-rw-r--r--reportdesign/source/core/sdr/PropertyForward.cxx2
-rw-r--r--reportdesign/source/ui/inspection/GeometryHandler.cxx2
-rw-r--r--reportdesign/source/ui/report/ViewsWindow.cxx20
15 files changed, 32 insertions, 32 deletions
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<XStorage> (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<XStorage> (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<sal_Int8> 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<XDriver> 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<XDriver> driver = ExtractDriverFromCollectionElement()(element);
return AcceptsURL(_rURL)(driver);
diff --git a/dbaccess/source/core/dataaccess/definitioncontainer.cxx b/dbaccess/source/core/dataaccess/definitioncontainer.cxx
index 6e0c78113922..f6a5f490523f 100644
--- a/dbaccess/source/core/dataaccess/definitioncontainer.cxx
+++ b/dbaccess/source/core/dataaccess/definitioncontainer.cxx
@@ -65,7 +65,7 @@ ODefinitionContainer_Impl::const_iterator ODefinitionContainer_Impl::find( TCont
return ::std::find_if(
m_aDefinitions.begin(),
m_aDefinitions.end(),
- [&_pDefinition] (NamedDefinitions::value_type namedDef) {
+ [&_pDefinition] (const NamedDefinitions::value_type& namedDef) {
return namedDef.second == _pDefinition;
});
}
@@ -75,7 +75,7 @@ ODefinitionContainer_Impl::iterator ODefinitionContainer_Impl::find( TContentPtr
return ::std::find_if(
m_aDefinitions.begin(),
m_aDefinitions.end(),
- [&_pDefinition] (NamedDefinitions::value_type namedDef) {
+ [&_pDefinition] (const NamedDefinitions::value_type& namedDef) {
return namedDef.second == _pDefinition;
});
}
diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx
index 5d5ec4cf0d06..7afce2ecbd77 100644
--- a/dbaccess/source/ui/control/tabletree.cxx
+++ b/dbaccess/source/ui/control/tabletree.cxx
@@ -261,10 +261,10 @@ void OTableTreeListBox::UpdateTableList( const Reference< XConnection >& _rxConn
{
OUString sRootEntryText;
if ( ::std::none_of(_rTables.begin(),_rTables.end(),
- [] (TNames::value_type name) { return !name.second; }) )
+ [] (const TNames::value_type& name) { return !name.second; }) )
sRootEntryText = ModuleRes(STR_ALL_TABLES);
else if ( ::std::none_of(_rTables.begin(),_rTables.end(),
- [] (TNames::value_type name) { return name.second; }) )
+ [] (const TNames::value_type& name) { return name.second; }) )
sRootEntryText = ModuleRes(STR_ALL_VIEWS);
else
sRootEntryText = ModuleRes(STR_ALL_TABLES_AND_VIEWS);
diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx
index 81f6531f932b..f8465fe856be 100644
--- a/dbaccess/source/ui/misc/DExport.cxx
+++ b/dbaccess/source/ui/misc/DExport.cxx
@@ -834,7 +834,7 @@ Reference< XPreparedStatement > ODatabaseExport::createPreparedStatment( const R
for(size_t j=0; j < aInsertList.size() ;++i,++j)
{
ODatabaseExport::TPositions::const_iterator aFind = ::std::find_if(_rvColumns.begin(),_rvColumns.end(),
- [i] (ODatabaseExport::TPositions::value_type tPos) { return tPos.second == i+1; });
+ [i] (const ODatabaseExport::TPositions::value_type& tPos) { return tPos.second == i+1; });
if ( _rvColumns.end() != aFind && aFind->second != sal::static_int_cast< long >(CONTAINER_ENTRY_NOTFOUND) && aFind->first != sal::static_int_cast< long >(CONTAINER_ENTRY_NOTFOUND) )
{
OSL_ENSURE((aFind->first) < static_cast<sal_Int32>(aInsertList.size()),"aInsertList: Illegal index for vector");
diff --git a/dbaccess/source/ui/misc/WColumnSelect.cxx b/dbaccess/source/ui/misc/WColumnSelect.cxx
index 9904a6efb3d4..d7ae174e4b65 100644
--- a/dbaccess/source/ui/misc/WColumnSelect.cxx
+++ b/dbaccess/source/ui/misc/WColumnSelect.cxx
@@ -339,7 +339,7 @@ void OWizColumnSelect::moveColumn( ListBox* _pRight,
{
// find the new column in the dest name mapping to obtain the old column
OCopyTableWizard::TNameMapping::iterator aIter = ::std::find_if(m_pParent->m_mNameMapping.begin(),m_pParent->m_mNameMapping.end(),
- [&_aCase, &_sColumnName] (OCopyTableWizard::TNameMapping::value_type nameMap) {
+ [&_aCase, &_sColumnName] (const OCopyTableWizard::TNameMapping::value_type& nameMap) {
return _aCase(nameMap.second, _sColumnName);
});
@@ -388,7 +388,7 @@ sal_uInt16 OWizColumnSelect::adjustColumnPosition( ListBox* _pLeft,
{
// find the new column in the dest name mapping to obtain the old column
OCopyTableWizard::TNameMapping::iterator aIter = ::std::find_if(m_pParent->m_mNameMapping.begin(),m_pParent->m_mNameMapping.end(),
- [&_aCase, &sColumnString] (OCopyTableWizard::TNameMapping::value_type nameMap) {
+ [&_aCase, &sColumnString] (const OCopyTableWizard::TNameMapping::value_type& nameMap) {
return _aCase(nameMap.second, sColumnString);
});
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx
index 1e28171738ea..f32dba666b7f 100644
--- a/dbaccess/source/ui/misc/WCopyTable.cxx
+++ b/dbaccess/source/ui/misc/WCopyTable.cxx
@@ -876,7 +876,7 @@ IMPL_LINK_NOARG(OCopyTableWizard, ImplOKHdl)
if ( supportsPrimaryKey() )
{
ODatabaseExport::TColumns::iterator aFind = ::std::find_if(m_vDestColumns.begin(),m_vDestColumns.end(),
- [] (ODatabaseExport::TColumns::value_type tCol) { return tCol.second->IsPrimaryKey(); });
+ [] (const ODatabaseExport::TColumns::value_type& tCol) { return tCol.second->IsPrimaryKey(); });
if ( aFind == m_vDestColumns.end() && m_xInteractionHandler.is() )
{
@@ -1293,7 +1293,7 @@ Reference< XPropertySet > OCopyTableWizard::createTable()
ODatabaseExport::TPositions::iterator aPosFind = ::std::find_if(
m_vColumnPos.begin(),
m_vColumnPos.end(),
- [nPos] (ODatabaseExport::TPositions::value_type tPos) {
+ [nPos] (const ODatabaseExport::TPositions::value_type& tPos) {
return tPos.first == nPos;
}
);
diff --git a/reportdesign/source/core/sdr/PropertyForward.cxx b/reportdesign/source/core/sdr/PropertyForward.cxx
index 3ef0438f0ed4..8295c672c87d 100644
--- a/reportdesign/source/core/sdr/PropertyForward.cxx
+++ b/reportdesign/source/core/sdr/PropertyForward.cxx
@@ -119,7 +119,7 @@ void SAL_CALL OPropertyMediator::propertyChange( const PropertyChangeEvent& evt
aFind = ::std::find_if(
m_aNameMap.begin(),
m_aNameMap.end(),
- [&evt] (TPropertyNamePair::value_type namePair) {
+ [&evt] (const TPropertyNamePair::value_type& namePair) {
return namePair.second.first == evt.PropertyName;
});
if ( aFind != m_aNameMap.end() )
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx
index 19d922554d1d..b338c6738f17 100644
--- a/reportdesign/source/ui/inspection/GeometryHandler.cxx
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -806,7 +806,7 @@ inspection::LineDescriptor SAL_CALL GeometryHandler::describePropertyLine(const
{
// add function names
::std::for_each(m_aFunctionNames.begin(), m_aFunctionNames.end(),
- [&xListControl] (TFunctions::value_type func) {
+ [&xListControl] (const TFunctions::value_type& func) {
xListControl->appendListEntry(func.first);
});
}
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index e236b159f106..9740f60e131e 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -326,11 +326,11 @@ void OViewsWindow::removeSection(sal_uInt16 _nPosition)
void OViewsWindow::toggleGrid(bool _bVisible)
{
::std::for_each(m_aSections.begin(),m_aSections.end(),
- [_bVisible] (TSectionsMap::value_type sectionPtr) {
+ [_bVisible] (const TSectionsMap::value_type& sectionPtr) {
sectionPtr->getReportSection().SetGridVisible(_bVisible);
});
::std::for_each(m_aSections.begin(),m_aSections.end(),
- [] (TSectionsMap::value_type sectionPtr) {
+ [] (const TSectionsMap::value_type& sectionPtr) {
sectionPtr->getReportSection().Window::Invalidate(InvalidateFlags::NoErase);
});
}
@@ -367,7 +367,7 @@ void OViewsWindow::SetInsertObj( sal_uInt16 eObj,const OUString& _sShapeType )
void OViewsWindow::SetMode( DlgEdMode eNewMode )
{
::std::for_each(m_aSections.begin(),m_aSections.end(),
- [&eNewMode] (TSectionsMap::value_type sectionPtr) {
+ [&eNewMode] (const TSectionsMap::value_type& sectionPtr) {
sectionPtr->getReportSection().SetMode(eNewMode);
});
}
@@ -385,7 +385,7 @@ void OViewsWindow::Delete()
{
m_bInUnmark = true;
::std::for_each(m_aSections.begin(),m_aSections.end(),
- [] (TSectionsMap::value_type sectionPtr) {
+ [] (const TSectionsMap::value_type& sectionPtr) {
sectionPtr->getReportSection().Delete();
});
m_bInUnmark = false;
@@ -395,7 +395,7 @@ void OViewsWindow::Copy()
{
uno::Sequence< beans::NamedValue > aAllreadyCopiedObjects;
::std::for_each(m_aSections.begin(),m_aSections.end(),
- [&aAllreadyCopiedObjects] (TSectionsMap::value_type sectionPtr) {
+ [&aAllreadyCopiedObjects] (const TSectionsMap::value_type& sectionPtr) {
sectionPtr->getReportSection().Copy(boost::ref(aAllreadyCopiedObjects));
});
@@ -410,7 +410,7 @@ void OViewsWindow::Paste()
OReportExchange::TSectionElements aCopies = OReportExchange::extractCopies(aTransferData);
if ( aCopies.getLength() > 1 )
::std::for_each(m_aSections.begin(),m_aSections.end(),
- [&aCopies] (TSectionsMap::value_type sectionPtr) {
+ [&aCopies] (const TSectionsMap::value_type& sectionPtr) {
sectionPtr->getReportSection().Paste(aCopies, false);
});
else
@@ -514,7 +514,7 @@ void OViewsWindow::SelectAll(const sal_uInt16 _nObjectType)
{
m_bInUnmark = true;
::std::for_each(m_aSections.begin(),m_aSections.end(),
- [&_nObjectType] (TSectionsMap::value_type sectionPtr) {
+ [&_nObjectType] (const TSectionsMap::value_type& sectionPtr) {
sectionPtr->getReportSection().SelectAll(_nObjectType);
});
m_bInUnmark = false;
@@ -559,11 +559,11 @@ void OViewsWindow::MouseButtonDown( const MouseEvent& rMEvt )
void OViewsWindow::showRuler(bool _bShow)
{
::std::for_each(m_aSections.begin(),m_aSections.end(),
- [_bShow] (TSectionsMap::value_type sectionPtr) {
+ [_bShow] (const TSectionsMap::value_type& sectionPtr) {
sectionPtr->getStartMarker().showRuler(_bShow);
});
::std::for_each(m_aSections.begin(),m_aSections.end(),
- [] (TSectionsMap::value_type sectionPtr) {
+ [] (const TSectionsMap::value_type& sectionPtr) {
sectionPtr->getStartMarker().Window::Invalidate(InvalidateFlags::NoErase);
});
}
@@ -1689,7 +1689,7 @@ void OViewsWindow::handleKey(const vcl::KeyCode& _rCode)
void OViewsWindow::stopScrollTimer()
{
::std::for_each(m_aSections.begin(),m_aSections.end(),
- [] (TSectionsMap::value_type sectionPtr) {
+ [] (const TSectionsMap::value_type& sectionPtr) {
sectionPtr->getReportSection().stopScrollTimer();
});
}