[Libreoffice-commits] core.git: 2 commits - forms/source svx/source

Stephan Bergmann sbergman at redhat.com
Tue Dec 5 15:19:46 UTC 2017


 forms/source/component/ListBox.cxx       |    5 ++---
 forms/source/richtext/richtextengine.cxx |    3 +--
 svx/source/form/filtnav.cxx              |    4 ++--
 3 files changed, 5 insertions(+), 7 deletions(-)

New commits:
commit d14e0d46e6b42d27f67e9d9227fe01d3ab2f2dcb
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Dec 5 10:51:47 2017 +0100

    Replace deprecated std::bin2nd with lambda in forms
    
    (as std::bind2nd is gone by default at least from recent libc++ in C++17 mode)
    
    Change-Id: Ia2c7970fd10e328a8b4a09e101ac3a89876c3d69
    Reviewed-on: https://gerrit.libreoffice.org/45863
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx
index b077847499a8..fd889c9d667d 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -57,7 +57,6 @@
 #include <boost/optional.hpp>
 
 #include <algorithm>
-#include <functional>
 #include <iterator>
 
 namespace frm
@@ -468,11 +467,11 @@ namespace frm
 
         const OUString* pSelectedItemsPos = ::std::find_if(
             _rPropertyNames.begin(), _rPropertyNames.end(),
-             ::std::bind2nd( ::std::equal_to< OUString >(), PROPERTY_SELECT_SEQ )
+             [](OUString const & s) { return s == PROPERTY_SELECT_SEQ; }
         );
         const OUString* pStringItemListPos = ::std::find_if(
             _rPropertyNames.begin(), _rPropertyNames.end(),
-             ::std::bind2nd( ::std::equal_to< OUString >(), PROPERTY_STRINGITEMLIST )
+             [](OUString const & s) { return s == PROPERTY_STRINGITEMLIST; }
         );
         if ( ( pSelectedItemsPos != _rPropertyNames.end() ) && ( pStringItemListPos != _rPropertyNames.end() ) )
         {
diff --git a/forms/source/richtext/richtextengine.cxx b/forms/source/richtext/richtextengine.cxx
index d920aa0fe485..0f583441e832 100644
--- a/forms/source/richtext/richtextengine.cxx
+++ b/forms/source/richtext/richtextengine.cxx
@@ -33,7 +33,6 @@
 #include <svl/undo.hxx>
 
 #include <algorithm>
-#include <functional>
 #include <memory>
 
 namespace frm
@@ -119,7 +118,7 @@ namespace frm
         ::std::vector< IEngineStatusListener* >::iterator aPos = ::std::find_if(
             m_aStatusListeners.begin(),
             m_aStatusListeners.end(),
-            ::std::bind2nd( ::std::equal_to< IEngineStatusListener* >( ), _pListener )
+            [_pListener](IEngineStatusListener * p) { return p == _pListener; }
         );
         OSL_ENSURE( aPos != m_aStatusListeners.end(), "RichTextEngine::revokeEngineStatusListener: listener not registered!" );
         if ( aPos != m_aStatusListeners.end() )
commit e2e8d201bb09e1bb4e654dcb7a701fe9840dbd94
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Dec 5 11:01:01 2017 +0100

    Replace deprecated std::mem_fun et al in svx
    
    (as std::mem_fun is gone by default at least from recent libc++ in C++17 mode)
    
    Change-Id: I7b2b6d20a7d89ed109bdce1f31cba660d9cdb9a0
    Reviewed-on: https://gerrit.libreoffice.org/45866
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index 989019e0a702..8a280a0a4a1a 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -1702,9 +1702,9 @@ void FmFilterNavigator::KeyInput(const KeyEvent& rKEvt)
         if ( !getSelectedFilterItems( aItemList ) )
             break;
 
-        ::std::mem_fun1_t<SvTreeListEntry*,FmFilterNavigator,SvTreeListEntry*> getter = ::std::mem_fun(&FmFilterNavigator::getNextEntry);
+        ::std::function<SvTreeListEntry*(FmFilterNavigator *, SvTreeListEntry*)> getter = ::std::mem_fn(&FmFilterNavigator::getNextEntry);
         if ( rKeyCode.GetCode() == KEY_UP )
-            getter = ::std::mem_fun(&FmFilterNavigator::getPrevEntry);
+            getter = ::std::mem_fn(&FmFilterNavigator::getPrevEntry);
 
         SvTreeListEntry* pTarget = getter( this, nullptr );
         if ( !pTarget )


More information about the Libreoffice-commits mailing list