Kaydet (Commit) 45e4a5ef authored tarafından Katarina Behrens's avatar Katarina Behrens

Start slideshow with the next visible slide

if current slide happens to be hidden + feeble attempt to untangle
spaghetti code in slideshowimpl *sigh*
Fixed within Impress Sprint

Change-Id: I120f72307ff5ec4d573845bf480a18ac4ce9212d
üst f4cde665
...@@ -942,11 +942,14 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings ) ...@@ -942,11 +942,14 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
if( bStartWithActualSlide ) 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( meAnimationMode != ANIMATIONMODE_SHOW ) if( meAnimationMode != ANIMATIONMODE_SHOW )
{ {
if( pStartPage->GetPageKind() == PK_STANDARD ) if( pStartPage->GetPageKind() == PK_STANDARD )
{ {
aPresSlide = pStartPage->GetName();
maPresSettings.mbAll = false; maPresSettings.mbAll = false;
} }
else else
...@@ -963,31 +966,9 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings ) ...@@ -963,31 +966,9 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
} }
} }
// build page list
createSlideList( maPresSettings.mbAll, false, aPresSlide );
if( bStartWithActualSlide )
{
sal_Int32 nSlideNum = ( pStartPage->GetPageNum() - 1 ) >> 1; sal_Int32 nSlideNum = ( pStartPage->GetPageNum() - 1 ) >> 1;
// build page list
if( !maPresSettings.mbAll && !maPresSettings.mbCustomShow ) createSlideList( maPresSettings.mbAll, false, aPresSlide, nSlideNum );
{
// its start from dia, find out if it is located before our current Slide
const sal_Int32 nSlideCount = mpDoc->GetSdPageCount( PK_STANDARD );
sal_Int32 nSlide;
for( nSlide = 0; (nSlide < nSlideCount); nSlide++ )
{
if( mpDoc->GetSdPage( (sal_uInt16) nSlide, PK_STANDARD )->GetName() == aPresSlide )
break;
}
if( nSlide > nSlideNum )
nSlideNum = -1;
}
if( nSlideNum != -1 )
mpSlideController->setStartSlideNumber( nSlideNum );
}
// remember Slide number from where the show was started // remember Slide number from where the show was started
if( pStartPage ) if( pStartPage )
...@@ -2448,7 +2429,7 @@ Reference< XSlideShow > SlideshowImpl::createSlideShow() const ...@@ -2448,7 +2429,7 @@ Reference< XSlideShow > SlideshowImpl::createSlideShow() const
// --------------------------------------------------------- // ---------------------------------------------------------
void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, const String& rPresSlide ) void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, const String& rPresSlide, sal_Int32 nStartSlide )
{ {
const long nSlideCount = mpDoc->GetSdPageCount( PK_STANDARD ); const long nSlideCount = mpDoc->GetSdPageCount( PK_STANDARD );
...@@ -2472,17 +2453,17 @@ void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, cons ...@@ -2472,17 +2453,17 @@ void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, cons
if( eMode != AnimationSlideController::CUSTOM ) if( eMode != AnimationSlideController::CUSTOM )
{ {
sal_Int32 nFirstSlide = 0; sal_Int32 nFirstVisibleSlide = 0;
// normal presentation // normal presentation
if( eMode == AnimationSlideController::FROM )
{
if( rPresSlide.Len() ) if( rPresSlide.Len() )
{ {
sal_Int32 nSlide; sal_Int32 nSlide;
sal_Bool bTakeNextAvailable = sal_False; sal_Bool bTakeNextAvailable = sal_False;
for( nSlide = 0, nFirstSlide = -1; ( nSlide < nSlideCount ) && ( -1 == nFirstSlide ); nSlide++ ) for( nSlide = nStartSlide, nFirstVisibleSlide = -1;
( nSlide < nSlideCount ) && ( -1 == nFirstVisibleSlide ); nSlide++ )
{ {
SdPage* pTestSlide = mpDoc->GetSdPage( (sal_uInt16)nSlide, PK_STANDARD ); SdPage* pTestSlide = mpDoc->GetSdPage( (sal_uInt16)nSlide, PK_STANDARD );
...@@ -2491,15 +2472,14 @@ void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, cons ...@@ -2491,15 +2472,14 @@ void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, cons
if( pTestSlide->IsExcluded() ) if( pTestSlide->IsExcluded() )
bTakeNextAvailable = sal_True; bTakeNextAvailable = sal_True;
else else
nFirstSlide = nSlide; nFirstVisibleSlide = nSlide;
} }
else if( bTakeNextAvailable && !pTestSlide->IsExcluded() ) else if( bTakeNextAvailable && !pTestSlide->IsExcluded() )
nFirstSlide = nSlide; nFirstVisibleSlide = nSlide;
} }
if( -1 == nFirstSlide ) if( -1 == nFirstVisibleSlide )
nFirstSlide = 0; nFirstVisibleSlide = 0;
}
} }
for( sal_Int32 i = 0; i < nSlideCount; i++ ) for( sal_Int32 i = 0; i < nSlideCount; i++ )
...@@ -2509,7 +2489,7 @@ void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, cons ...@@ -2509,7 +2489,7 @@ void SlideshowImpl::createSlideList( bool bAll, bool bStartWithActualSlide, cons
mpSlideController->insertSlideNumber( i, bVisible ); mpSlideController->insertSlideNumber( i, bVisible );
} }
mpSlideController->setStartSlideNumber( nFirstSlide ); mpSlideController->setStartSlideNumber( nFirstVisibleSlide );
} }
else else
{ {
......
...@@ -265,7 +265,7 @@ private: ...@@ -265,7 +265,7 @@ private:
double update(); double update();
void createSlideList( bool bAll, bool bStartWithActualSlide, const String& rPresSlide ); void createSlideList( bool bAll, bool bStartWithActualSlide, const String& rPresSlide, sal_Int32 nStartSlide = 0 );
void displayCurrentSlide (const bool bSkipAllMainSequenceEffects = false); void displayCurrentSlide (const bool bSkipAllMainSequenceEffects = false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment