diff options
author | Andre Fischer <af@openoffice.org> | 2009-10-14 12:38:02 +0000 |
---|---|---|
committer | Andre Fischer <af@openoffice.org> | 2009-10-14 12:38:02 +0000 |
commit | 5caa4326854d346e40b9d052255effa446e54513 (patch) | |
tree | 482afd57dd05d92b5ec7c3d5af3e24bf2766a675 /slideshow | |
parent | 8918d0a78627c4e85fcbc0aa6bdf2e2878dff7a2 (diff) |
#i48179# Fixed stepping back for animations with active auto_reverse.
Diffstat (limited to 'slideshow')
-rw-r--r-- | slideshow/source/engine/activities/activitiesfactory.cxx | 7 | ||||
-rw-r--r-- | slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx | 1 | ||||
-rw-r--r-- | slideshow/source/engine/eventqueue.cxx | 23 | ||||
-rw-r--r-- | slideshow/source/engine/slideshowimpl.cxx | 16 | ||||
-rw-r--r-- | slideshow/source/engine/usereventqueue.cxx | 3 |
5 files changed, 32 insertions, 18 deletions
diff --git a/slideshow/source/engine/activities/activitiesfactory.cxx b/slideshow/source/engine/activities/activitiesfactory.cxx index 39cd7d733110..745e956c19e0 100644 --- a/slideshow/source/engine/activities/activitiesfactory.cxx +++ b/slideshow/source/engine/activities/activitiesfactory.cxx @@ -293,7 +293,12 @@ public: { // xxx todo: good guess if (mpAnim) - (*mpAnim)( getPresentationValue( maEndValue ) ); + { + if (isAutoReverse()) + (*mpAnim)( getPresentationValue( maStartValue ) ); + else + (*mpAnim)( getPresentationValue( maEndValue ) ); + } } /// Disposable: diff --git a/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx b/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx index bf0cba0cfe64..66ff0c40ceee 100644 --- a/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx +++ b/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx @@ -141,7 +141,6 @@ bool SequentialTimeContainer::resolveChild( void SequentialTimeContainer::notifyDeactivating( AnimationNodeSharedPtr const& rNotifier ) { - OSL_TRACE(" SequentialTimeContainer::notifyDeactivating\r"); if (notifyDeactivatedChild( rNotifier )) return; diff --git a/slideshow/source/engine/eventqueue.cxx b/slideshow/source/engine/eventqueue.cxx index ee92e5df27d6..44e1cad2f45e 100644 --- a/slideshow/source/engine/eventqueue.cxx +++ b/slideshow/source/engine/eventqueue.cxx @@ -106,9 +106,10 @@ namespace slideshow ::osl::MutexGuard aGuard( maMutex ); #if OSL_DEBUG_LEVEL > 1 && defined (SLIDESHOW_ADD_DESCRIPTIONS_TO_EVENTS) - OSL_TRACE("adding event at %x [%s] with delay %f\r", - rEvent.get(), + OSL_TRACE("adding at %f event [%s] at %x with delay %f\r", + mpTimer->getElapsedTime(), OUStringToOString(rEvent->GetDescription(), RTL_TEXTENCODING_UTF8).getStr(), + rEvent.get(), rEvent->getActivationTime(0.0)); #endif ENSURE_OR_RETURN( rEvent, @@ -133,9 +134,10 @@ namespace slideshow ::osl::MutexGuard aGuard( maMutex ); #if OSL_DEBUG_LEVEL > 1 && defined (SLIDESHOW_ADD_DESCRIPTIONS_TO_EVENTS) - OSL_TRACE("adding event at %x [%s] for next round with delay %f\r", - rEvent.get(), + OSL_TRACE("adding at %f event [%s] at %x for next round with delay %f\r", + mpTimer->getElapsedTime(), OUStringToOString(rEvent->GetDescription(), RTL_TEXTENCODING_UTF8).getStr(), + rEvent.get(), rEvent->getActivationTime(0.0)); #endif @@ -152,9 +154,10 @@ namespace slideshow ::osl::MutexGuard aGuard( maMutex ); #if OSL_DEBUG_LEVEL > 1 && defined (SLIDESHOW_ADD_DESCRIPTIONS_TO_EVENTS) - OSL_TRACE("adding event at %x [%s] for execution when queue is empty with delay %f\r", - rpEvent.get(), + OSL_TRACE("adding at %f event [%s] at %x for execution when queue is empty with delay %f\r", + mpTimer->getElapsedTime(), OUStringToOString(rpEvent->GetDescription(), RTL_TEXTENCODING_UTF8).getStr(), + rpEvent.get(), rpEvent->getActivationTime(0.0)); #endif @@ -239,10 +242,11 @@ namespace slideshow event.pEvent->getActivationTime(0.0) ); #endif #if OSL_DEBUG_LEVEL > 1 && defined (SLIDESHOW_ADD_DESCRIPTIONS_TO_EVENTS) - OSL_TRACE("firing event at %x [%s] with delay %f\r", - event.pEvent.get(), + OSL_TRACE("firing at %f event [%s] at %x with delay %f\r", + mpTimer->getElapsedTime(), OUStringToOString(event.pEvent->GetDescription(), RTL_TEXTENCODING_UTF8).getStr(), + event.pEvent.get(), event.pEvent->getActivationTime(0.0)); #endif @@ -326,6 +330,9 @@ namespace slideshow // TODO(P1): Maybe a plain vector and vector.swap will // be faster here. Profile. maEvents = ImplQueueType(); + + maNextEvents.clear(); + maNextNextEvents = ImplQueueType(); } } } diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index 45b94ac26501..b042014af9c6 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -71,6 +71,7 @@ #include <com/sun/star/animations/TransitionType.hpp> #include <com/sun/star/animations/TransitionSubType.hpp> #include <com/sun/star/presentation/XSlideShow.hpp> +#include <com/sun/star/presentation/XSlideShowListener.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XServiceName.hpp> #include <com/sun/star/loader/CannotActivateFactoryException.hpp> @@ -509,11 +510,14 @@ struct SlideShowImpl::SeparateListenerImpl : public EventHandler, // directly, but queue an event. handleEvent() // might be called from e.g. // showNext(), and notifySlideAnimationsEnded() must not be called - // in recursion. - mrEventQueue.addEvent( - makeEvent( boost::bind( &SlideShowImpl::notifySlideAnimationsEnded, - boost::ref(mrShow) ), - "SlideShowImpl::notifySlideAnimationsEnded")); + // in recursion. Note that the event is scheduled for the next + // frame so that its expensive execution does not come in between + // 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) ), + "SlideShowImpl::notifySlideAnimationsEnded")); return true; } @@ -2079,7 +2083,7 @@ void SlideShowImpl::notifySlideEnded (const bool bReverse) boost::bind( &presentation::XSlideShowListener::slideEnded, _1, - bReverse) ); + bReverse)); } bool SlideShowImpl::notifyHyperLinkClicked( rtl::OUString const& hyperLink ) diff --git a/slideshow/source/engine/usereventqueue.cxx b/slideshow/source/engine/usereventqueue.cxx index 95ff86ab200b..4415599f84d8 100644 --- a/slideshow/source/engine/usereventqueue.cxx +++ b/slideshow/source/engine/usereventqueue.cxx @@ -330,8 +330,6 @@ private: // next effect listeners: if(fireAllEvents( maEvents, mrEventQueue )) { - makeEvent(::boost::bind(&EventQueue::forceEmpty, ::boost::ref(mrEventQueue)), - "EventQueue::forceEmpty"); if (mbSkipTriggersNextEffect && bNotifyNextEffect) { // then simulate a next effect event: this skip effect @@ -794,6 +792,7 @@ void UserEventQueue::setAdvanceOnClick( bool bAdvanceOnClick ) mpClickEventHandler->setAdvanceOnClick( bAdvanceOnClick ); } + void UserEventQueue::registerSlideStartEvent( const EventSharedPtr& rEvent ) { registerEvent( mpStartEventHandler, |