sd/source/ui/slideshow/slideshowimpl.cxx  |   12 ++++++++++++
 slideshow/source/engine/slideshowimpl.cxx |    8 ++++++++
 2 files changed, 20 insertions(+)

New commits:
commit 77eb3f1a76892b6070e77324e260204408383ef4
Author:     Armin Le Grand (allotropia) <armin.le.grand.ext...@allotropia.de>
AuthorDate: Thu Apr 11 16:37:30 2024 +0200
Commit:     Armin Le Grand <armin.le.gr...@me.com>
CommitDate: Thu Apr 11 18:59:46 2024 +0200

    IASS: Correct Buffering of last Slide
    
    There is a mechanism to pre-fetch the next slide, but
    at the last slide that just gets not reset/refreshed.
    Thus the last slide *is* the buffered slide.
    When making changes and refreshing the SlideShow display
    for the last slide this pe-fetched one is just used, so
    the slide content gets not re-created and thus not
    updated.
    I added needed code to do that now when reacing the last
    slide to make that work.
    
    Change-Id: Ie57e6917e0996d5fce46021aeb933064c47dd90f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166011
    Tested-by: Jenkins
    Reviewed-by: Armin Le Grand <armin.le.gr...@me.com>

diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx 
b/sd/source/ui/slideshow/slideshowimpl.cxx
index 7c05da952c5e..29870dc45783 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -500,6 +500,18 @@ void AnimationSlideController::displayCurrentSlide( const 
Reference< XSlideShow
                 Any(aValue),
                 PropertyState_DIRECT_VALUE);
     }
+    else if (-1 == nNextSlideNumber)
+    {
+        // IASS: next slide does not exist, thus current slide is the last one.
+        // we need to signal to stop Prefetch since else SlideShowImpl *keeps* 
the
+        // last slide buffered and will just re-use it when asked to update, 
thus
+        // updates will not work.
+        aProperties.emplace_back( "Prefetch" ,
+                -1,
+                Any(false),
+                PropertyState_DIRECT_VALUE);
+    }
+
     if (bSkipAllMainSequenceEffects)
     {
         // Add one property that prevents the slide transition from being
diff --git a/slideshow/source/engine/slideshowimpl.cxx 
b/slideshow/source/engine/slideshowimpl.cxx
index 5e0dbbb8074e..121416327191 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -1041,6 +1041,14 @@ public:
                 seq[0] >>= mpSlideShowImpl->mxPrefetchSlide;
                 seq[1] >>= mpSlideShowImpl->mxPrefetchAnimationNode;
             }
+            else // rProperty.Value might be tested to 'bool' and 'false'
+            {
+                // IASS: There is no 'next' slide (last one is displayed),
+                // so end/flush Prefetch since that might still hold the
+                // last slide what would prevent updating/re-creating it
+                mpSlideShowImpl->mxPrefetchSlide.clear();
+                mpSlideShowImpl->mpPrefetchSlide.reset();
+            }
         }
         else if ( rProperty.Name == "SkipAllMainSequenceEffects" )
         {

Reply via email to