[Libreoffice-commits] core.git: 3 commits - include/comphelper sal/inc sal/osl sd/inc sd/source ucb/source

Michael Stahl mstahl at redhat.com
Thu Mar 3 14:06:23 UTC 2016


 include/comphelper/stl_types.hxx              |   12 --------
 sal/inc/pch/precompiled_sal.hxx               |    1 
 sal/osl/all/debugbase.cxx                     |    4 +-
 sd/inc/pch/precompiled_sd.hxx                 |    1 
 sd/source/ui/slideshow/SlideShowRestarter.cxx |    5 ++-
 sd/source/ui/slideshow/slideshow.cxx          |    5 ++-
 sd/source/ui/slideshow/slideshowimpl.cxx      |   36 +++++++++++++++++++++-----
 ucb/source/ucp/webdav-neon/NeonSession.cxx    |    6 ----
 8 files changed, 39 insertions(+), 31 deletions(-)

New commits:
commit c96dc8822d8bb7c1b8309888b22254cac2abc5ce
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Mar 3 14:28:30 2016 +0100

    ucb: replace boost::bind with C++11 lambdas
    
    ... and remove now unused comphelper::TNamedValueEqualFunctor.
    
    Change-Id: Ia6cac4ae4e34d2ba134e2f2a4a5b4daea58bf0b3

diff --git a/include/comphelper/stl_types.hxx b/include/comphelper/stl_types.hxx
index f38a9cf..e6c4a72 100644
--- a/include/comphelper/stl_types.hxx
+++ b/include/comphelper/stl_types.hxx
@@ -29,7 +29,6 @@
 #include <rtl/ustrbuf.hxx>
 #include <com/sun/star/uno/Reference.hxx>
 #include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/beans/NamedValue.hpp>
 
 namespace comphelper
 {
@@ -76,17 +75,6 @@ public:
     }
 };
 
-class TNamedValueEqualFunctor : public ::std::binary_function< css::beans::NamedValue,OUString,bool>
-{
-public:
-    TNamedValueEqualFunctor()
-    {}
-    bool operator() (const css::beans::NamedValue& lhs, const OUString& rhs) const
-    {
-        return !!(lhs.Name == rhs);
-    }
-};
-
 /// by-value less functor for std::set<std::unique_ptr<T>>
 template<class T> struct UniquePtrValueLess
     : public ::std::binary_function<std::unique_ptr<T>, std::unique_ptr<T>, bool>
diff --git a/ucb/source/ucp/webdav-neon/NeonSession.cxx b/ucb/source/ucp/webdav-neon/NeonSession.cxx
index 83e5ba7..516797e 100644
--- a/ucb/source/ucp/webdav-neon/NeonSession.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonSession.cxx
@@ -47,7 +47,6 @@ extern "C" {
 #include "rtl/ustrbuf.hxx"
 #include "comphelper/processfactory.hxx"
 #include "comphelper/sequence.hxx"
-#include <comphelper/stl_types.hxx>
 #include "ucbhelper/simplecertificatevalidationrequest.hxx"
 
 #include "DAVAuthListener.hxx"
@@ -71,7 +70,6 @@ extern "C" {
 #include <com/sun/star/beans/NamedValue.hpp>
 #include <com/sun/star/xml/crypto/SEInitializer.hpp>
 
-#include <boost/bind.hpp>
 
 using namespace com::sun::star;
 using namespace webdav_ucp;
@@ -148,9 +146,7 @@ static bool noKeepAlive( const uno::Sequence< beans::NamedValue >& rFlags )
     const sal_Int32          nLen(rFlags.getLength());
     const beans::NamedValue* pValue(
         std::find_if(pAry,pAry+nLen,
-                     boost::bind(comphelper::TNamedValueEqualFunctor(),
-                                 _1,
-                                 OUString("KeepAlive"))));
+            [] (beans::NamedValue const& rNV) { return rNV.Name == OUString("KeepAlive"); } ));
     if ( pValue != pAry+nLen && !pValue->Value.get<sal_Bool>() )
         return true;
 
commit b184b4249d114bafba7d2afd00093747db556d33
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Mar 3 14:10:32 2016 +0100

    sal: replace boost::bind with C++11 lambdas
    
    Change-Id: If8e16b7805b5b25dafe053e35cd98079abbea83c

diff --git a/sal/inc/pch/precompiled_sal.hxx b/sal/inc/pch/precompiled_sal.hxx
index ab1c7d2..13cf7bb 100644
--- a/sal/inc/pch/precompiled_sal.hxx
+++ b/sal/inc/pch/precompiled_sal.hxx
@@ -32,7 +32,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <boost/bind.hpp>
 #include <boost/noncopyable.hpp>
 #include <osl/diagnose.h>
 #include <osl/diagnose.hxx>
diff --git a/sal/osl/all/debugbase.cxx b/sal/osl/all/debugbase.cxx
index c0f0a63..c82dde9 100644
--- a/sal/osl/all/debugbase.cxx
+++ b/sal/osl/all/debugbase.cxx
@@ -23,7 +23,7 @@
 #include "osl/process.h"
 #include "osl/diagnose.hxx"
 #include "sal/log.hxx"
-#include "boost/bind.hpp"
+
 #include <algorithm>
 #include <vector>
 
@@ -95,7 +95,7 @@ bool SAL_CALL osl_detail_ObjectRegistry_storeAddresses( char const* pName )
         return true;
     OStringVec::const_iterator const iEnd( rVec.end() );
     return std::find_if( rVec.begin(), iEnd,
-                         boost::bind( &isSubStr, pName, _1 ) ) != iEnd;
+        [pName] (OString const& it) { return isSubStr(pName, it); }) != iEnd;
 }
 
 bool SAL_CALL osl_detail_ObjectRegistry_checkObjectCount(
commit 521c5602e366a8d4d826fcd910428965de5d9d4e
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Mar 3 14:06:17 2016 +0100

    sd: replace boost::bind with C++11 lambdas or std::bind
    
    Change-Id: I1fc9ca7712fde802c885f5cfeedec1575d913f85

diff --git a/sd/inc/pch/precompiled_sd.hxx b/sd/inc/pch/precompiled_sd.hxx
index 454dfe3..b0555fb 100644
--- a/sd/inc/pch/precompiled_sd.hxx
+++ b/sd/inc/pch/precompiled_sd.hxx
@@ -42,7 +42,6 @@
 #include <unordered_map>
 #include <utility>
 #include <vector>
-#include <boost/bind.hpp>
 #include <boost/intrusive_ptr.hpp>
 #include <boost/limits.hpp>
 #include <boost/noncopyable.hpp>
diff --git a/sd/source/ui/slideshow/SlideShowRestarter.cxx b/sd/source/ui/slideshow/SlideShowRestarter.cxx
index fdd3fad..4db7f62 100644
--- a/sd/source/ui/slideshow/SlideShowRestarter.cxx
+++ b/sd/source/ui/slideshow/SlideShowRestarter.cxx
@@ -27,7 +27,8 @@
 #include <sfx2/app.hxx>
 #include <svx/svxids.hrc>
 #include <vcl/svapp.hxx>
-#include <boost/bind.hpp>
+
+#include <functional>
 
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::lang;
@@ -110,7 +111,7 @@ IMPL_LINK_NOARG_TYPED(SlideShowRestarter, EndPresentation, void*, void)
 
                     pHelper->RunOnConfigurationEvent(
                         FrameworkHelper::msConfigurationUpdateEndEvent,
-                        ::boost::bind(&SlideShowRestarter::StartPresentation, shared_from_this()));
+                        ::std::bind(&SlideShowRestarter::StartPresentation, shared_from_this()));
                     pHelper->UpdateConfiguration();
                 }
                 else
diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx
index db0f476..20a7231 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -51,7 +51,6 @@
 #include "SlideShowRestarter.hxx"
 #include "DrawController.hxx"
 #include "customshowlist.hxx"
-#include <boost/bind.hpp>
 #include "unopage.hxx"
 
 using ::com::sun::star::presentation::XSlideShowController;
@@ -1072,7 +1071,9 @@ void SlideShow::StartInPlacePresentation()
             }
 
             pHelper->RequestView( FrameworkHelper::msImpressViewURL, FrameworkHelper::msCenterPaneURL );
-            pHelper->RunOnConfigurationEvent( FrameworkHelper::msConfigurationUpdateEndEvent, ::boost::bind(&SlideShow::StartInPlacePresentationConfigurationCallback, this) );
+            pHelper->RunOnConfigurationEvent(
+                FrameworkHelper::msConfigurationUpdateEndEvent,
+                [this] (bool const) { return this->StartInPlacePresentationConfigurationCallback(); } );
             return;
         }
         else
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index 3eed5a6..b154130 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -78,7 +78,7 @@
 #include "customshowlist.hxx"
 #include "unopage.hxx"
 
-#include <boost/bind.hpp>
+#include <boost/mem_fn.hpp>
 
 using ::comphelper::OInterfaceContainerHelper2;
 using ::com::sun::star::animations::XAnimationNode;
@@ -3325,7 +3325,12 @@ void SAL_CALL SlideShowListenerProxy::beginEvent( const Reference< XAnimationNod
     ::osl::MutexGuard aGuard( m_aMutex );
 
     if( maListeners.getLength() >= 0 )
-        maListeners.forEach<XSlideShowListener>( boost::bind( &XAnimationListener::beginEvent, _1,  boost::cref(xNode) ));
+    {
+        maListeners.forEach<XSlideShowListener>(
+            [&] (Reference<XAnimationListener> const& xListener) {
+                return xListener->beginEvent(xNode);
+            } );
+    }
 }
 
 void SAL_CALL SlideShowListenerProxy::endEvent( const Reference< XAnimationNode >& xNode ) throw (RuntimeException, std::exception)
@@ -3333,7 +3338,12 @@ void SAL_CALL SlideShowListenerProxy::endEvent( const Reference< XAnimationNode
     ::osl::MutexGuard aGuard( m_aMutex );
 
     if( maListeners.getLength() >= 0 )
-        maListeners.forEach<XSlideShowListener>( boost::bind( &XAnimationListener::endEvent, _1, boost::cref(xNode) ));
+    {
+        maListeners.forEach<XSlideShowListener>(
+            [&] (Reference<XAnimationListener> const& xListener) {
+                return xListener->endEvent(xNode);
+            } );
+    }
 }
 
 void SAL_CALL SlideShowListenerProxy::repeat( const Reference< XAnimationNode >& xNode, ::sal_Int32 nRepeat ) throw (RuntimeException, std::exception)
@@ -3341,7 +3351,12 @@ void SAL_CALL SlideShowListenerProxy::repeat( const Reference< XAnimationNode >&
     ::osl::MutexGuard aGuard( m_aMutex );
 
     if( maListeners.getLength() >= 0 )
-        maListeners.forEach<XSlideShowListener>( boost::bind( &XAnimationListener::repeat, _1,  boost::cref(xNode), boost::cref(nRepeat) ));
+    {
+        maListeners.forEach<XSlideShowListener>(
+            [&] (Reference<XAnimationListener> const& xListener) {
+                return xListener->repeat(xNode, nRepeat);
+            } );
+    }
 }
 
 // css::presentation::XSlideShowListener:
@@ -3392,8 +3407,12 @@ void SlideShowListenerProxy::slideEnded(sal_Bool bReverse) throw (RuntimeExcepti
         ::osl::MutexGuard aGuard( m_aMutex );
 
         if( maListeners.getLength() >= 0 )
+        {
             maListeners.forEach<XSlideShowListener>(
-                boost::bind( &XSlideShowListener::slideEnded, _1, bReverse) );
+                [&] (Reference<XSlideShowListener> const& xListener) {
+                    return xListener->slideEnded(bReverse);
+                } );
+        }
     }
 
     {
@@ -3409,7 +3428,12 @@ void SlideShowListenerProxy::hyperLinkClicked( OUString const& aHyperLink ) thro
         ::osl::MutexGuard aGuard( m_aMutex );
 
         if( maListeners.getLength() >= 0 )
-            maListeners.forEach<XSlideShowListener>( boost::bind( &XSlideShowListener::hyperLinkClicked, _1, boost::cref(aHyperLink) ));
+        {
+            maListeners.forEach<XSlideShowListener>(
+                [&] (Reference<XSlideShowListener> const& xListener) {
+                    return xListener->hyperLinkClicked(aHyperLink);
+                } );
+        }
     }
 
     {


More information about the Libreoffice-commits mailing list