[Libreoffice-commits] core.git: slideshow/source

Michael Stahl mstahl at redhat.com
Mon Aug 3 08:27:13 PDT 2015


 slideshow/source/engine/animationnodes/animationaudionode.cxx      |   13 ++--
 slideshow/source/engine/animationnodes/animationbasenode.cxx       |    4 -
 slideshow/source/engine/animationnodes/animationcommandnode.cxx    |    4 -
 slideshow/source/engine/animationnodes/animationsetnode.cxx        |    5 -
 slideshow/source/engine/animationnodes/basecontainernode.cxx       |    3 
 slideshow/source/engine/animationnodes/basenode.cxx                |    3 
 slideshow/source/engine/animationnodes/paralleltimecontainer.cxx   |    5 -
 slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx |   10 +--
 slideshow/source/engine/effectrewinder.cxx                         |    8 +-
 slideshow/source/engine/eventmultiplexer.cxx                       |   11 +--
 slideshow/source/engine/slideshowimpl.cxx                          |   32 ++--------
 slideshow/source/engine/slideview.cxx                              |    9 --
 slideshow/source/engine/usereventqueue.cxx                         |    6 -
 13 files changed, 44 insertions(+), 69 deletions(-)

New commits:
commit 38a4b5ea2ab7188ce61d18c655893482dd098772
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Aug 3 17:20:26 2015 +0200

    slideshow: try to fix libc++/MSVC build by replacing boost::bind
    
    Change-Id: I6418119f9d3e70ea89f7c8a094bbde42eeadec8c

diff --git a/slideshow/source/engine/animationnodes/animationaudionode.cxx b/slideshow/source/engine/animationnodes/animationaudionode.cxx
index 5e953a9..c44561a 100644
--- a/slideshow/source/engine/animationnodes/animationaudionode.cxx
+++ b/slideshow/source/engine/animationnodes/animationaudionode.cxx
@@ -27,7 +27,6 @@
 #include "delayevent.hxx"
 #include "tools.hxx"
 #include "nodetools.hxx"
-#include "boost/bind.hpp"
 
 using namespace com::sun::star;
 
@@ -79,17 +78,19 @@ void AnimationAudioNode::activate_st()
         else
         {
             // no node duration. Take inherent media time, then
+            auto self(getSelf());
             scheduleDeactivationEvent(
-                makeDelay( boost::bind( &AnimationNode::deactivate, getSelf() ),
-                                        mpPlayer->getDuration(),
+                makeDelay( [self] () { self->deactivate(); },
+                           mpPlayer->getDuration(),
                            "AnimationAudioNode::deactivate with delay") );
         }
     }
     else
     {
         // deactivate ASAP:
+        auto self(getSelf());
         scheduleDeactivationEvent(
-            makeEvent( boost::bind( &AnimationNode::deactivate, getSelf() ),
+            makeEvent( [self] () { self->deactivate(); },
                                     "AnimationAudioNode::deactivate without delay") );
     }
 }
@@ -114,8 +115,8 @@ void AnimationAudioNode::deactivate_st( NodeState /*eDestState*/ )
 
     // notify _after_ state change:
     getContext().mrEventQueue.addEvent(
-        makeEvent( boost::bind( &EventMultiplexer::notifyAudioStopped,
-                                boost::ref(getContext().mrEventMultiplexer),
+        makeEvent( std::bind( &EventMultiplexer::notifyAudioStopped,
+                              std::ref(getContext().mrEventMultiplexer),
                                 getSelf() ),
                    "AnimationAudioNode::notifyAudioStopped") );
 }
diff --git a/slideshow/source/engine/animationnodes/animationbasenode.cxx b/slideshow/source/engine/animationnodes/animationbasenode.cxx
index d9373d5..41adb19 100644
--- a/slideshow/source/engine/animationnodes/animationbasenode.cxx
+++ b/slideshow/source/engine/animationnodes/animationbasenode.cxx
@@ -35,7 +35,6 @@
 #include "delayevent.hxx"
 #include "framerate.hxx"
 
-#include <boost/bind.hpp>
 #include <boost/optional.hpp>
 #include <algorithm>
 
@@ -449,8 +448,7 @@ AnimationBaseNode::fillCommonParameters() const
 
     EventSharedPtr pEndEvent;
     if (pSelf) {
-        pEndEvent = makeEvent(
-            boost::bind( &AnimationNode::deactivate, pSelf ),
+        pEndEvent = makeEvent( [pSelf] () {pSelf->deactivate(); },
             "AnimationBaseNode::deactivate");
     }
 
diff --git a/slideshow/source/engine/animationnodes/animationcommandnode.cxx b/slideshow/source/engine/animationnodes/animationcommandnode.cxx
index be7b2b7..17365f3 100644
--- a/slideshow/source/engine/animationnodes/animationcommandnode.cxx
+++ b/slideshow/source/engine/animationnodes/animationcommandnode.cxx
@@ -30,7 +30,6 @@
 #include "tools.hxx"
 #include "nodetools.hxx"
 
-#include <boost/bind.hpp>
 
 using namespace com::sun::star;
 
@@ -108,8 +107,9 @@ void AnimationCommandNode::activate_st()
     }
 
     // deactivate ASAP:
+    auto self(getSelf());
     scheduleDeactivationEvent(
-        makeEvent( boost::bind( &AnimationNode::deactivate, getSelf() ),
+        makeEvent( [self] () { self->deactivate(); },
                    "AnimationCommandNode::deactivate" ) );
 }
 
diff --git a/slideshow/source/engine/animationnodes/animationsetnode.cxx b/slideshow/source/engine/animationnodes/animationsetnode.cxx
index 2b1230a..63c7620 100644
--- a/slideshow/source/engine/animationnodes/animationsetnode.cxx
+++ b/slideshow/source/engine/animationnodes/animationsetnode.cxx
@@ -28,8 +28,6 @@
 #include "tools.hxx"
 #include "delayevent.hxx"
 
-#include <boost/bind.hpp>
-
 using namespace com::sun::star;
 
 namespace slideshow {
@@ -66,8 +64,7 @@ AnimationActivitySharedPtr AnimationSetNode::createActivity() const
         ENSURE_OR_THROW(
             pSelf, "cannot cast getSelf() to my type!" );
         aParms.mpEndEvent = makeEvent(
-            boost::bind( &AnimationSetNode::implScheduleDeactivationEvent,
-                         pSelf ),
+            [pSelf] () { pSelf->implScheduleDeactivationEvent(); },
             "AnimationSetNode::implScheduleDeactivationEvent");
     }
 
diff --git a/slideshow/source/engine/animationnodes/basecontainernode.cxx b/slideshow/source/engine/animationnodes/basecontainernode.cxx
index a3c73e8..5371c12 100644
--- a/slideshow/source/engine/animationnodes/basecontainernode.cxx
+++ b/slideshow/source/engine/animationnodes/basecontainernode.cxx
@@ -28,7 +28,6 @@
 #include "nodetools.hxx"
 #include "delayevent.hxx"
 
-#include <boost/bind.hpp>
 #include <boost/mem_fn.hpp>
 #include <algorithm>
 
@@ -154,7 +153,7 @@ bool BaseContainerNode::notifyDeactivatedChild(
         {
             bFinished = false;
             EventSharedPtr aRepetitionEvent =
-                    makeDelay( boost::bind( &BaseContainerNode::repeat, this ),
+                    makeDelay( [this] () { this->repeat(); },
                                0.0,
                                "BaseContainerNode::repeat");
             getContext().mrEventQueue.addEvent( aRepetitionEvent );
diff --git a/slideshow/source/engine/animationnodes/basenode.cxx b/slideshow/source/engine/animationnodes/basenode.cxx
index 4940a83..0aced6f 100644
--- a/slideshow/source/engine/animationnodes/basenode.cxx
+++ b/slideshow/source/engine/animationnodes/basenode.cxx
@@ -474,8 +474,9 @@ bool BaseNode::resolve()
 
             // schedule delayed activation event. Take iterate node
             // timeout into account
+            auto self(mpSelf);
             mpCurrentEvent = makeDelay(
-                boost::bind( &AnimationNode::activate, mpSelf ),
+                [self] () { self->activate(); },
                 mnStartDelay,
                 "AnimationNode::activate with delay");
             maContext.mrEventQueue.addEvent( mpCurrentEvent );
diff --git a/slideshow/source/engine/animationnodes/paralleltimecontainer.cxx b/slideshow/source/engine/animationnodes/paralleltimecontainer.cxx
index 07b68a2..20d16d71 100644
--- a/slideshow/source/engine/animationnodes/paralleltimecontainer.cxx
+++ b/slideshow/source/engine/animationnodes/paralleltimecontainer.cxx
@@ -21,7 +21,7 @@
 #include "paralleltimecontainer.hxx"
 #include "delayevent.hxx"
 
-#include <boost/bind.hpp>
+#include <boost/mem_fn.hpp>
 
 namespace slideshow {
 namespace internal {
@@ -39,8 +39,9 @@ void ParallelTimeContainer::activate_st()
 
     if (isDurationIndefinite() && maChildren.empty()) {
         // deactivate ASAP:
+        auto self(getSelf());
         scheduleDeactivationEvent(
-            makeEvent( boost::bind( &AnimationNode::deactivate, getSelf() ),
+            makeEvent( [self] () { self->deactivate(); },
                        "ParallelTimeContainer::deactivate") );
     }
     else { // use default
diff --git a/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx b/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx
index 1972e31..7a53e33 100644
--- a/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx
+++ b/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx
@@ -27,7 +27,6 @@
 #include "sequentialtimecontainer.hxx"
 #include "tools.hxx"
 
-#include <boost/bind.hpp>
 #include <algorithm>
 
 namespace slideshow {
@@ -49,9 +48,9 @@ void SequentialTimeContainer::activate_st()
         (maChildren.empty() || mnFinishedChildren >= maChildren.size()))
     {
         // deactivate ASAP:
+        auto self(getSelf());
         scheduleDeactivationEvent(
-            makeEvent(
-                 boost::bind< void >( boost::mem_fn( &AnimationNode::deactivate ), getSelf() ),
+            makeEvent( [self] () { self->deactivate(); },
                  "SequentialTimeContainer::deactivate") );
     }
     else // use default
@@ -78,8 +77,7 @@ void SequentialTimeContainer::skipEffect(
         // empty all events ignoring timings => until next effect
         getContext().mrEventQueue.forceEmpty();
         getContext().mrEventQueue.addEvent(
-            makeEvent(
-                boost::bind<void>( boost::mem_fn( &AnimationNode::deactivate ), pChildNode ),
+            makeEvent( [pChildNode] () { pChildNode->deactivate(); },
                 "SequentialTimeContainer::deactivate, skipEffect with delay") );
     }
     else
@@ -99,7 +97,7 @@ bool SequentialTimeContainer::resolveChild(
 
         // event that will deactivate the resolved/running child:
         mpCurrentSkipEvent = makeEvent(
-            boost::bind( &SequentialTimeContainer::skipEffect,
+            std::bind( &SequentialTimeContainer::skipEffect,
                          boost::dynamic_pointer_cast<SequentialTimeContainer>( getSelf() ),
                          pChildNode ),
             "SequentialTimeContainer::skipEffect, resolveChild");
diff --git a/slideshow/source/engine/effectrewinder.cxx b/slideshow/source/engine/effectrewinder.cxx
index 2b2bbfb..af589c2 100644
--- a/slideshow/source/engine/effectrewinder.cxx
+++ b/slideshow/source/engine/effectrewinder.cxx
@@ -198,7 +198,7 @@ bool EffectRewinder::rewind (
         // No main sequence effects to rewind on the current slide.
         // Go back to the previous slide.
         mpAsynchronousRewindEvent = makeEvent(
-            ::boost::bind(
+            ::std::bind(
                 &EffectRewinder::asynchronousRewindToPreviousSlide,
                 this,
                 rPreviousSlideFunctor),
@@ -209,7 +209,7 @@ bool EffectRewinder::rewind (
         // The actual rewinding is done asynchronously so that we can safely
         // call other methods.
         mpAsynchronousRewindEvent = makeEvent(
-            ::boost::bind(
+            ::std::bind(
                 &EffectRewinder::asynchronousRewind,
                 this,
                 nSkipCount,
@@ -238,7 +238,7 @@ void EffectRewinder::skipAllMainSequenceEffects()
 
     const int nTotalMainSequenceEffectCount (countMainSequenceEffects());
     mpAsynchronousRewindEvent = makeEvent(
-        ::boost::bind(
+        ::std::bind(
             &EffectRewinder::asynchronousRewind,
             this,
             nTotalMainSequenceEffectCount,
@@ -365,7 +365,7 @@ void EffectRewinder::asynchronousRewind (
         if (rSlideRewindFunctor)
             rSlideRewindFunctor();
         mpAsynchronousRewindEvent = makeEvent(
-            ::boost::bind(
+            ::std::bind(
                 &EffectRewinder::asynchronousRewind,
                 this,
                 nEffectCount,
diff --git a/slideshow/source/engine/eventmultiplexer.cxx b/slideshow/source/engine/eventmultiplexer.cxx
index d5c32fa..2be7714 100644
--- a/slideshow/source/engine/eventmultiplexer.cxx
+++ b/slideshow/source/engine/eventmultiplexer.cxx
@@ -351,7 +351,7 @@ void SAL_CALL EventMultiplexerListener::mousePressed(
     // might not be the main thread!
     if( mpEventQueue )
         mpEventQueue->addEvent(
-            makeEvent( boost::bind( &EventMultiplexerImpl::mousePressed,
+            makeEvent( std::bind( &EventMultiplexerImpl::mousePressed,
                                     mpEventMultiplexer,
                                     e ),
                        "EventMultiplexerImpl::mousePressed") );
@@ -366,7 +366,7 @@ void SAL_CALL EventMultiplexerListener::mouseReleased(
     // this might not be the main thread!
     if( mpEventQueue )
         mpEventQueue->addEvent(
-            makeEvent( boost::bind( &EventMultiplexerImpl::mouseReleased,
+            makeEvent( std::bind( &EventMultiplexerImpl::mouseReleased,
                                     mpEventMultiplexer,
                                     e ),
                        "EventMultiplexerImpl::mouseReleased") );
@@ -394,7 +394,7 @@ void SAL_CALL EventMultiplexerListener::mouseDragged(
     // might not be the main thread!
     if( mpEventQueue )
         mpEventQueue->addEvent(
-            makeEvent( boost::bind( &EventMultiplexerImpl::mouseDragged,
+            makeEvent( std::bind( &EventMultiplexerImpl::mouseDragged,
                                     mpEventMultiplexer,
                                     e ),
                        "EventMultiplexerImpl::mouseDragged") );
@@ -409,7 +409,7 @@ void SAL_CALL EventMultiplexerListener::mouseMoved(
     // might not be the main thread!
     if( mpEventQueue )
         mpEventQueue->addEvent(
-            makeEvent( boost::bind( &EventMultiplexerImpl::mouseMoved,
+            makeEvent( std::bind( &EventMultiplexerImpl::mouseMoved,
                                     mpEventMultiplexer,
                                     e ),
                        "EventMultiplexerImpl::mouseMoved") );
@@ -514,8 +514,7 @@ void EventMultiplexerImpl::tick()
 void EventMultiplexerImpl::scheduleTick()
 {
     EventSharedPtr pEvent(
-        makeDelay( boost::bind( &EventMultiplexerImpl::tick,
-                                this ),
+        makeDelay( [this] () { this->tick(); },
                    mnTimeout,
                    "EventMultiplexerImpl::tick with delay"));
 
diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx
index cd46010..fecd064 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -534,8 +534,7 @@ struct SlideShowImpl::SeparateListenerImpl : public EventHandler,
         // sprite hiding and shape redraw (at the end of the animation of a
         // shape), which would cause a flicker.
         mrEventQueue.addEventForNextRound(
-            makeEvent(
-                boost::bind( &SlideShowImpl::notifySlideAnimationsEnded, boost::ref(mrShow) ),
+            makeEvent( [this] () { this->mrShow.notifySlideAnimationsEnded(); },
                 "SlideShowImpl::notifySlideAnimationsEnded"));
         return true;
     }
@@ -861,12 +860,10 @@ ActivitySharedPtr SlideShowImpl::createSlideTransition(
     // displaySlide() has finished - sometimes, view size has not yet
     // reached final size
     maEventQueue.addEvent(
-        makeEvent(
-            boost::bind(
-                &::slideshow::internal::Animation::prefetch,
-                pTransition,
-                AnimatableShapeSharedPtr(),
-                ShapeAttributeLayerSharedPtr()),
+        makeEvent( [pTransition] () {
+                        pTransition->prefetch(
+                            AnimatableShapeSharedPtr(),
+                            ShapeAttributeLayerSharedPtr()); },
             "Animation::prefetch"));
 
     return ActivitySharedPtr(
@@ -1156,10 +1153,7 @@ void SlideShowImpl::displaySlide(
                     mpPreviousSlide,
                     mpCurrentSlide,
                     makeEvent(
-                        boost::bind(
-                            &SlideShowImpl::notifySlideTransitionEnded,
-                            this,
-                            false ),
+                        [this] () { this->notifySlideTransitionEnded(false); },
                         "SlideShowImpl::notifySlideTransitionEnded")));
 
             if (bSkipSlideTransition)
@@ -1182,10 +1176,7 @@ void SlideShowImpl::displaySlide(
                 // effect start event right away.
                 maEventQueue.addEvent(
                     makeEvent(
-                        boost::bind(
-                            &SlideShowImpl::notifySlideTransitionEnded,
-                            this,
-                            true ),
+                        [this] () { this->notifySlideTransitionEnded(true); },
                         "SlideShowImpl::notifySlideTransitionEnded"));
             }
         }
@@ -1219,11 +1210,7 @@ void SlideShowImpl::redisplayCurrentSlide()
     // No transition effect on this slide - schedule slide
     // effect start event right away.
     maEventQueue.addEvent(
-        makeEvent(
-            boost::bind(
-                &SlideShowImpl::notifySlideTransitionEnded,
-                this,
-                true ),
+        makeEvent( [this] () { this->notifySlideTransitionEnded(true); },
             "SlideShowImpl::notifySlideTransitionEnded"));
 
     maListenerContainer.forEach<presentation::XSlideShowListener>(
@@ -2287,8 +2274,7 @@ void SlideShowImpl::notifySlideAnimationsEnded()
             // generate interruptable event here, there's no
             // timeout involved.
             aNotificationEvents.mpImmediateEvent =
-                makeEvent( boost::bind<void>(
-                    boost::mem_fn(&SlideShowImpl::notifySlideEnded), this, false ),
+                makeEvent( [this] () { this->notifySlideEnded(false); },
                     "SlideShowImpl::notifySlideEnded");
         }
     }
diff --git a/slideshow/source/engine/slideview.cxx b/slideshow/source/engine/slideview.cxx
index 04170a7..f699ce1 100644
--- a/slideshow/source/engine/slideview.cxx
+++ b/slideshow/source/engine/slideview.cxx
@@ -53,7 +53,6 @@
 #include <com/sun/star/presentation/XSlideShow.hpp>
 
 #include <boost/noncopyable.hpp>
-#include <boost/bind.hpp>
 #include <boost/weak_ptr.hpp>
 
 #include <vector>
@@ -1087,10 +1086,7 @@ void SlideView::modified( const lang::EventObject& /*aEvent*/ )
     // notify view change. Don't call EventMultiplexer directly, this
     // might not be the main thread!
     mrEventQueue.addEvent(
-        makeEvent( boost::bind( (bool (EventMultiplexer::*)(
-                                     const uno::Reference<presentation::XSlideShowView>&))
-                                &EventMultiplexer::notifyViewChanged,
-                                boost::ref(mrEventMultiplexer), mxView ),
+        makeEvent( [this] () { this->mrEventMultiplexer.notifyViewChanged(this->mxView); },
                    "EventMultiplexer::notifyViewChanged"));
 }
 
@@ -1105,8 +1101,7 @@ void SlideView::windowPaint( const awt::PaintEvent& /*e*/ )
     // notify view clobbering. Don't call EventMultiplexer directly,
     // this might not be the main thread!
     mrEventQueue.addEvent(
-        makeEvent( boost::bind( &EventMultiplexer::notifyViewClobbered,
-                                boost::ref(mrEventMultiplexer), mxView ),
+        makeEvent( [this] () { this->mrEventMultiplexer.notifyViewClobbered(this->mxView); },
                    "EventMultiplexer::notifyViewClobbered") );
 }
 
diff --git a/slideshow/source/engine/usereventqueue.cxx b/slideshow/source/engine/usereventqueue.cxx
index 1b5d1a1..9f06797 100644
--- a/slideshow/source/engine/usereventqueue.cxx
+++ b/slideshow/source/engine/usereventqueue.cxx
@@ -268,9 +268,9 @@ private:
                 // someone has registerered above for next effects
                 // (multiplexer prio=0) at the user event queue.
                 return mrEventQueue.addEventWhenQueueIsEmpty(
-                    makeEvent( boost::bind( &EventMultiplexer::notifyNextEffect,
-                                            boost::ref(mrEventMultiplexer) ),
-                               "EventMultiplexer::notifyNextEffect") );
+                    makeEvent( [this] () {
+                            this->mrEventMultiplexer.notifyNextEffect();
+                        }, "EventMultiplexer::notifyNextEffect") );
             }
             else
                 return true;


More information about the Libreoffice-commits mailing list