From e8b924e440a8f82076389d2774d1c414c87924dc Mon Sep 17 00:00:00 2001 From: Katarina Behrens Date: Sat, 23 Mar 2013 21:47:24 +0100 Subject: Start slideshow with the next visible slide, part2 simplify it a bit. Also fix fdo#62665, as a side effect Change-Id: I77e3d9d261f0d313d6514897d2d4923de32b3591 --- sd/source/ui/slideshow/slideshowimpl.cxx | 17 ++++++++++------- sd/source/ui/slideshow/slideshowimpl.hxx | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 6ba66deba292..fd29a7bd9996 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -942,9 +942,13 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings ) if( bStartWithActualSlide ) { - aPresSlide = pStartPage->GetName(); - // if the starting slide is hidden, we can't set slide controller to ALL mode - maPresSettings.mbAll = !pStartPage->IsExcluded(); + if ( !aPresSlide.Len()) + { + // no preset slide yet, so pick current on one + aPresSlide = pStartPage->GetName(); + // if the starting slide is hidden, we can't set slide controller to ALL mode + maPresSettings.mbAll = !pStartPage->IsExcluded(); + } if( meAnimationMode != ANIMATIONMODE_SHOW ) { @@ -966,9 +970,8 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings ) } } - sal_Int32 nSlideNum = ( pStartPage->GetPageNum() - 1 ) >> 1; // build page list - createSlideList( maPresSettings.mbAll, false, aPresSlide, nSlideNum ); + createSlideList( maPresSettings.mbAll, false, aPresSlide ); // remember Slide number from where the show was started if( pStartPage ) @@ -2429,7 +2432,7 @@ Reference< XSlideShow > SlideshowImpl::createSlideShow() const // --------------------------------------------------------- -void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, const String& rPresSlide, sal_Int32 nStartSlide ) +void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, const String& rPresSlide ) { const long nSlideCount = mpDoc->GetSdPageCount( PK_STANDARD ); @@ -2462,7 +2465,7 @@ void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, cons sal_Int32 nSlide; sal_Bool bTakeNextAvailable = sal_False; - for( nSlide = nStartSlide, nFirstVisibleSlide = -1; + for( nSlide = 0, nFirstVisibleSlide = -1; ( nSlide < nSlideCount ) && ( -1 == nFirstVisibleSlide ); nSlide++ ) { SdPage* pTestSlide = mpDoc->GetSdPage( (sal_uInt16)nSlide, PK_STANDARD ); diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx index ca968c4a4d65..7f87ea01ccd5 100644 --- a/sd/source/ui/slideshow/slideshowimpl.hxx +++ b/sd/source/ui/slideshow/slideshowimpl.hxx @@ -265,7 +265,7 @@ private: double update(); - void createSlideList( bool bAll, bool bStartWithActualSlide, const String& rPresSlide, sal_Int32 nStartSlide = 0 ); + void createSlideList( bool bAll, bool bStartWithActualSlide, const String& rPresSlide ); void displayCurrentSlide (const bool bSkipAllMainSequenceEffects = false); -- cgit