slideshow/source/engine/slideshowimpl.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 850b66f969834e61f3cb1a1ccd4bfc15f23d558f
Author:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
AuthorDate: Mon Aug 14 14:13:05 2023 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
CommitDate: Mon Aug 14 21:40:33 2023 +0200

    tdf#154265 Disable automatic slide advancement when moving backwards
    
    When a slide has a 0 second automatic slide advance setting, and you move
    back to that slide, it would immediately move forward again.
    
    Only enable automatic slide advancement when moving forwards.
    
    Change-Id: I3c901bed5323569f5cf52aeca5b3227c87b6e539
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155663
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>

diff --git a/slideshow/source/engine/slideshowimpl.cxx 
b/slideshow/source/engine/slideshowimpl.cxx
index f681dc2a9559..33a9825e544a 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -479,6 +479,7 @@ private:
     bool                                    mbShowPaused;
     bool                                    mbSlideShowIdle;
     bool                                    mbDisableAnimationZOrder;
+    bool                                    mbMovingForward;
 
     EffectRewinder                          maEffectRewinder;
     FrameSynchronization                    maFrameSynchronization;
@@ -590,6 +591,7 @@ SlideShowImpl::SlideShowImpl(
       mbShowPaused( false ),
       mbSlideShowIdle( true ),
       mbDisableAnimationZOrder( false ),
+      mbMovingForward( true ),
       maEffectRewinder(maEventMultiplexer, maEventQueue, maUserEventQueue),
       maFrameSynchronization(1.0 / FrameRate::PreferredFramesPerSecond)
 
@@ -1215,6 +1217,7 @@ void SlideShowImpl::redisplayCurrentSlide()
 
 sal_Bool SlideShowImpl::nextEffect()
 {
+    mbMovingForward = true;
     osl::MutexGuard const guard( m_aMutex );
 
     if (isDisposed())
@@ -1231,6 +1234,7 @@ sal_Bool SlideShowImpl::nextEffect()
 
 sal_Bool SlideShowImpl::previousEffect()
 {
+    mbMovingForward = false;
     osl::MutexGuard const guard( m_aMutex );
 
     if (isDisposed())
@@ -2310,7 +2314,8 @@ void SlideShowImpl::notifySlideAnimationsEnded()
         // step slides manually.
         if( !mbForceManualAdvance &&
             !mpRehearseTimingsActivity &&
-            bHasAutomaticNextSlide )
+            bHasAutomaticNextSlide &&
+            mbMovingForward )
         {
             aNotificationEvents = makeInterruptableDelay(
                 [this]() { return this->notifySlideEnded( false ); },

Reply via email to