From 3ea3c081721439644850ded0fe375b12e2e9b95c Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 5 Dec 2017 10:46:13 +0100 Subject: Replace deprecated std::bin2nd with lambda in dbaccess (as std::bind2nd is gone by default at least from recent libc++ in C++17 mode) Change-Id: Ib54bc40889aa45b5b9d4d3ab54baafbd260d3b25 Reviewed-on: https://gerrit.libreoffice.org/45861 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- dbaccess/source/ui/browser/formadapter.cxx | 6 +++--- dbaccess/source/ui/misc/RowSetDrop.cxx | 3 +-- dbaccess/source/ui/querydesign/JoinTableView.cxx | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/dbaccess/source/ui/browser/formadapter.cxx b/dbaccess/source/ui/browser/formadapter.cxx index ca01482f9bb7..7fd72dbd7464 100644 --- a/dbaccess/source/ui/browser/formadapter.cxx +++ b/dbaccess/source/ui/browser/formadapter.cxx @@ -1431,7 +1431,7 @@ sal_Int32 SbaXFormAdapter::implGetPos(const OUString& rName) { std::vector< OUString>::const_iterator aIter = std::find_if( m_aChildNames.begin(), m_aChildNames.end(), - std::bind2nd(std::equal_to< OUString>(),rName)); + [&rName](OUString const & s) { return s == rName; }); if(aIter != m_aChildNames.end()) return aIter - m_aChildNames.begin(); @@ -1634,7 +1634,7 @@ void SAL_CALL SbaXFormAdapter::propertyChange(const css::beans::PropertyChangeEv { std::vector< css::uno::Reference< css::form::XFormComponent > >::const_iterator aIter = std::find_if( m_aChildren.begin(), m_aChildren.end(), - std::bind2nd(std::equal_to< css::uno::Reference< css::uno::XInterface > >(),evt.Source)); + [&evt](css::uno::Reference< css::uno::XInterface > const & x) { return x == evt.Source; }); if(aIter != m_aChildren.end()) { @@ -1654,7 +1654,7 @@ void SAL_CALL SbaXFormAdapter::disposing(const css::lang::EventObject& Source) std::vector< css::uno::Reference< css::form::XFormComponent > >::const_iterator aIter = std::find_if( m_aChildren.begin(), m_aChildren.end(), - std::bind2nd(std::equal_to< css::uno::Reference< css::uno::XInterface > >(),Source.Source)); + [&Source](css::uno::Reference< css::uno::XInterface > const & x) { return x == Source.Source; }); if(aIter != m_aChildren.end()) removeByIndex(aIter - m_aChildren.begin()); } diff --git a/dbaccess/source/ui/misc/RowSetDrop.cxx b/dbaccess/source/ui/misc/RowSetDrop.cxx index bcaf2e42caab..aa1858a57d1b 100644 --- a/dbaccess/source/ui/misc/RowSetDrop.cxx +++ b/dbaccess/source/ui/misc/RowSetDrop.cxx @@ -28,7 +28,6 @@ #include #include #include -#include using namespace dbaui; using namespace ::com::sun::star::uno; @@ -102,7 +101,7 @@ bool ORowSetImportExport::Read() { // check if there is any column to copy if(std::find_if(m_aColumnMapping.begin(),m_aColumnMapping.end(), - std::bind2nd(std::greater(),0)) == m_aColumnMapping.end()) + [](sal_Int32 n) { return n > 0; }) == m_aColumnMapping.end()) return false; bool bContinue = true; if(m_aSelection.getLength()) diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index 8923a644bf21..26fe97d7423a 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -959,14 +959,14 @@ std::vector >::const_iterator OJoinTableView::getTableC { return std::find_if( m_vTableConnection.begin(), m_vTableConnection.end(), - std::bind2nd(std::mem_fun(&OTableConnection::isTableConnection),_pFromWin)); + [_pFromWin](OTableConnection * p) { return p->isTableConnection(_pFromWin); }); } sal_Int32 OJoinTableView::getConnectionCount(const OTableWindow* _pFromWin) const { return std::count_if( m_vTableConnection.begin(), m_vTableConnection.end(), - std::bind2nd(std::mem_fun(&OTableConnection::isTableConnection),_pFromWin)); + [_pFromWin](OTableConnection * p) { return p->isTableConnection(_pFromWin); }); } bool OJoinTableView::ExistsAConn(const OTableWindow* pFrom) const -- cgit