--- sd/source/ui/slideshow/slideshowimpl.cxx (revision 1493324) +++ sd/source/ui/slideshow/slideshowimpl.cxx (working copy) @@ -171,6 +171,7 @@ sal_Int32 getNextSlideIndex() const; sal_Int32 getPreviousSlideIndex() const; + sal_Int32 getLastVisibleSlideIndex() const; bool isVisibleSlideNumber( sal_Int32 nSlideNumber ) const; @@ -464,6 +465,18 @@ return jumpToSlideIndex( getPreviousSlideIndex() ); } +sal_Int32 AnimationSlideController::getLastVisibleSlideIndex() const +{ + sal_Int32 nNewSlideIndex = getSlideIndexCount() -1; + while( isValidIndex( nNewSlideIndex ) ) + { + if ( maSlideVisible[nNewSlideIndex] ) + break; + nNewSlideIndex--; + } + return nNewSlideIndex; +} + void AnimationSlideController::displayCurrentSlide( const Reference< XSlideShow >& xShow, const Reference< XDrawPagesSupplier>& xDrawPages, const bool bSkipAllMainSequenceEffects ) @@ -3373,7 +3386,7 @@ const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode(); if( eMode == SHOWWINDOWMODE_END ) { - const sal_Int32 nLastSlideIndex = mpSlideController->getSlideIndexCount() - 1; + const sal_Int32 nLastSlideIndex = mpSlideController->getLastVisibleSlideIndex(); if( nLastSlideIndex >= 0 ) mpShowWindow->RestartShow( nLastSlideIndex ); }