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

New commits:
commit 6acb20111c5b65bdca8ef401154d8eb943b62945
Author:     Samuel Mehrbrodt <[email protected]>
AuthorDate: Mon Aug 14 14:13:05 2023 +0200
Commit:     Michael Stahl <[email protected]>
CommitDate: Tue Aug 15 11:24:17 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 <[email protected]>
    (cherry picked from commit 2815c357ed4aa1b97cbf4fb407a0d55d70ff7488)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155692
    Reviewed-by: Michael Stahl <[email protected]>

diff --git a/slideshow/source/engine/slideshowimpl.cxx 
b/slideshow/source/engine/slideshowimpl.cxx
index 473791bb620f..fd4d984b6e32 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -478,6 +478,7 @@ private:
     bool                                    mbShowPaused;
     bool                                    mbSlideShowIdle;
     bool                                    mbDisableAnimationZOrder;
+    bool                                    mbMovingForward;
 
     EffectRewinder                          maEffectRewinder;
     FrameSynchronization                    maFrameSynchronization;
@@ -589,6 +590,7 @@ SlideShowImpl::SlideShowImpl(
       mbShowPaused( false ),
       mbSlideShowIdle( true ),
       mbDisableAnimationZOrder( false ),
+      mbMovingForward( true ),
       maEffectRewinder(maEventMultiplexer, maEventQueue, maUserEventQueue),
       maFrameSynchronization(1.0 / FrameRate::PreferredFramesPerSecond)
 
@@ -1214,6 +1216,7 @@ void SlideShowImpl::redisplayCurrentSlide()
 
 sal_Bool SlideShowImpl::nextEffect()
 {
+    mbMovingForward = true;
     osl::MutexGuard const guard( m_aMutex );
 
     if (isDisposed())
@@ -1230,6 +1233,7 @@ sal_Bool SlideShowImpl::nextEffect()
 
 sal_Bool SlideShowImpl::previousEffect()
 {
+    mbMovingForward = false;
     osl::MutexGuard const guard( m_aMutex );
 
     if (isDisposed())
@@ -2253,7 +2257,8 @@ void SlideShowImpl::notifySlideAnimationsEnded()
         // step slides manually.
         if( !mbForceManualAdvance &&
             !mpRehearseTimingsActivity &&
-            bHasAutomaticNextSlide )
+            bHasAutomaticNextSlide &&
+            mbMovingForward )
         {
             aNotificationEvents = makeInterruptableDelay(
                 [this]() { return this->notifySlideEnded( false ); },

Reply via email to