Kaydet (Commit) b104e6e9 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:flatten in sd/source/ui/slideshow

Change-Id: Id820f0f7ac51928ba1a783615c3e9d6c268affdd
Reviewed-on: https://gerrit.libreoffice.org/67831
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst fcdfb94a
...@@ -45,7 +45,10 @@ PaneHider::PaneHider (const ViewShell& rViewShell, SlideshowImpl* pSlideShow) ...@@ -45,7 +45,10 @@ PaneHider::PaneHider (const ViewShell& rViewShell, SlideshowImpl* pSlideShow)
{ {
// Hide the left and right pane windows when a slideshow exists and is // Hide the left and right pane windows when a slideshow exists and is
// not full screen. // not full screen.
if (pSlideShow!=nullptr && !pSlideShow->isFullScreen()) try if (pSlideShow==nullptr || pSlideShow->isFullScreen())
return;
try
{ {
Reference<XControllerManager> xControllerManager ( Reference<XControllerManager> xControllerManager (
mrViewShell.GetViewShellBase().GetController(), UNO_QUERY_THROW); mrViewShell.GetViewShellBase().GetController(), UNO_QUERY_THROW);
......
...@@ -81,10 +81,12 @@ void SlideShowRestarter::Restart (bool bForce) ...@@ -81,10 +81,12 @@ void SlideShowRestarter::Restart (bool bForce)
IMPL_LINK_NOARG(SlideShowRestarter, EndPresentation, void*, void) IMPL_LINK_NOARG(SlideShowRestarter, EndPresentation, void*, void)
{ {
mnEventId = nullptr; mnEventId = nullptr;
if (mpSlideShow.is()) if (!mpSlideShow.is())
{ return;
if (mnDisplayCount != static_cast<sal_Int32>(Application::GetScreenCount()))
{ if (mnDisplayCount == static_cast<sal_Int32>(Application::GetScreenCount()))
return;
bool bIsExitAfterPresenting = mpSlideShow->IsExitAfterPresenting(); bool bIsExitAfterPresenting = mpSlideShow->IsExitAfterPresenting();
mpSlideShow->SetExitAfterPresenting(false); mpSlideShow->SetExitAfterPresenting(false);
mpSlideShow->end(); mpSlideShow->end();
...@@ -100,8 +102,9 @@ IMPL_LINK_NOARG(SlideShowRestarter, EndPresentation, void*, void) ...@@ -100,8 +102,9 @@ IMPL_LINK_NOARG(SlideShowRestarter, EndPresentation, void*, void)
// console, to disappear. Only when it is gone, call // console, to disappear. Only when it is gone, call
// InitiatePresenterStart(), in order to begin the asynchronous // InitiatePresenterStart(), in order to begin the asynchronous
// restart of the slide show. // restart of the slide show.
if (mpViewShellBase != nullptr) if (mpViewShellBase == nullptr)
{ return;
::std::shared_ptr<FrameworkHelper> pHelper( ::std::shared_ptr<FrameworkHelper> pHelper(
FrameworkHelper::Instance(*mpViewShellBase)); FrameworkHelper::Instance(*mpViewShellBase));
if (pHelper->GetConfigurationController()->getResource( if (pHelper->GetConfigurationController()->getResource(
...@@ -119,9 +122,6 @@ IMPL_LINK_NOARG(SlideShowRestarter, EndPresentation, void*, void) ...@@ -119,9 +122,6 @@ IMPL_LINK_NOARG(SlideShowRestarter, EndPresentation, void*, void)
{ {
StartPresentation(); StartPresentation();
} }
}
}
}
} }
void SlideShowRestarter::StartPresentation() void SlideShowRestarter::StartPresentation()
......
...@@ -294,8 +294,9 @@ void ShowWindow::LoseFocus() ...@@ -294,8 +294,9 @@ void ShowWindow::LoseFocus()
void ShowWindow::SetEndMode() void ShowWindow::SetEndMode()
{ {
if( ( SHOWWINDOWMODE_NORMAL == meShowWindowMode ) && mpViewShell && mpViewShell->GetView() ) if( !(( SHOWWINDOWMODE_NORMAL == meShowWindowMode ) && mpViewShell && mpViewShell->GetView()) )
{ return;
DeleteWindowFromPaintView(); DeleteWindowFromPaintView();
meShowWindowMode = SHOWWINDOWMODE_END; meShowWindowMode = SHOWWINDOWMODE_END;
maShowBackground = Wallpaper( COL_BLACK ); maShowBackground = Wallpaper( COL_BLACK );
...@@ -308,7 +309,6 @@ void ShowWindow::SetEndMode() ...@@ -308,7 +309,6 @@ void ShowWindow::SetEndMode()
} }
Invalidate(); Invalidate();
}
} }
bool ShowWindow::SetPauseMode( sal_Int32 nTimeout, Graphic const * pLogo ) bool ShowWindow::SetPauseMode( sal_Int32 nTimeout, Graphic const * pLogo )
......
...@@ -650,8 +650,9 @@ void SAL_CALL SlideShow::end() ...@@ -650,8 +650,9 @@ void SAL_CALL SlideShow::end()
mbIsInStartup = false; mbIsInStartup = false;
rtl::Reference< SlideshowImpl > xController( mxController ); rtl::Reference< SlideshowImpl > xController( mxController );
if( xController.is() ) if( !xController.is() )
{ return;
mxController.clear(); mxController.clear();
if( mpFullScreenFrameView ) if( mpFullScreenFrameView )
...@@ -778,7 +779,6 @@ void SAL_CALL SlideShow::end() ...@@ -778,7 +779,6 @@ void SAL_CALL SlideShow::end()
pViewShell->SwitchActiveViewFireFocus(); pViewShell->SwitchActiveViewFireFocus();
} }
mpCurrentViewShellBase = nullptr; mpCurrentViewShellBase = nullptr;
}
} }
void SAL_CALL SlideShow::rehearseTimings() void SAL_CALL SlideShow::rehearseTimings()
...@@ -1083,8 +1083,9 @@ void SlideShow::StartInPlacePresentation() ...@@ -1083,8 +1083,9 @@ void SlideShow::StartInPlacePresentation()
CreateController( nullptr, nullptr, mxCurrentSettings->mpParentWindow ); CreateController( nullptr, nullptr, mxCurrentSettings->mpParentWindow );
} }
if( mxController.is() ) if( !mxController.is() )
{ return;
bool bSuccess = false; bool bSuccess = false;
if( mxCurrentSettings.get() && mxCurrentSettings->mbPreview ) if( mxCurrentSettings.get() && mxCurrentSettings->mbPreview )
{ {
...@@ -1102,7 +1103,6 @@ void SlideShow::StartInPlacePresentation() ...@@ -1102,7 +1103,6 @@ void SlideShow::StartInPlacePresentation()
if( mpCurrentViewShellBase && ( !mxCurrentSettings.get() || ( mxCurrentSettings.get() && !mxCurrentSettings->mbPreview ) ) ) if( mpCurrentViewShellBase && ( !mxCurrentSettings.get() || ( mxCurrentSettings.get() && !mxCurrentSettings->mbPreview ) ) )
mpCurrentViewShellBase->GetWindow()->GrabFocus(); mpCurrentViewShellBase->GetWindow()->GrabFocus();
} }
}
} }
void SlideShow::StartFullscreenPresentation( ) void SlideShow::StartFullscreenPresentation( )
...@@ -1120,8 +1120,9 @@ void SlideShow::StartFullscreenPresentation( ) ...@@ -1120,8 +1120,9 @@ void SlideShow::StartFullscreenPresentation( )
pWorkWindow->StartPresentationMode( true, mpDoc->getPresentationSettings().mbAlwaysOnTop ? PresentationFlags::HideAllApps : PresentationFlags::NONE, nDisplay); pWorkWindow->StartPresentationMode( true, mpDoc->getPresentationSettings().mbAlwaysOnTop ? PresentationFlags::HideAllApps : PresentationFlags::NONE, nDisplay);
// pWorkWindow->ShowFullScreenMode(sal_False, nDisplay); // pWorkWindow->ShowFullScreenMode(sal_False, nDisplay);
if (pWorkWindow->IsVisible()) if (!pWorkWindow->IsVisible())
{ return;
// Initialize the new presentation view shell with a copy of the // Initialize the new presentation view shell with a copy of the
// frame view of the current view shell. This avoids that // frame view of the current view shell. This avoids that
// changes made by the presentation have an effect on the other // changes made by the presentation have an effect on the other
...@@ -1148,7 +1149,6 @@ void SlideShow::StartFullscreenPresentation( ) ...@@ -1148,7 +1149,6 @@ void SlideShow::StartFullscreenPresentation( )
// Windows and some Linux variants.) // Windows and some Linux variants.)
mpFullScreenViewShellBase->GetWindow()->GrabFocus(); mpFullScreenViewShellBase->GetWindow()->GrabFocus();
} }
}
} }
/// convert configuration setting display concept to real screens /// convert configuration setting display concept to real screens
......
...@@ -444,8 +444,9 @@ void AnimationSlideController::displayCurrentSlide( const Reference< XSlideShow ...@@ -444,8 +444,9 @@ void AnimationSlideController::displayCurrentSlide( const Reference< XSlideShow
{ {
const sal_Int32 nCurrentSlideNumber = getCurrentSlideNumber(); const sal_Int32 nCurrentSlideNumber = getCurrentSlideNumber();
if( xShow.is() && (nCurrentSlideNumber != -1 ) ) if( !(xShow.is() && (nCurrentSlideNumber != -1 )) )
{ return;
Reference< XDrawPage > xSlide; Reference< XDrawPage > xSlide;
Reference< XAnimationNode > xAnimNode; Reference< XAnimationNode > xAnimNode;
::std::vector<PropertyValue> aProperties; ::std::vector<PropertyValue> aProperties;
...@@ -479,7 +480,6 @@ void AnimationSlideController::displayCurrentSlide( const Reference< XSlideShow ...@@ -479,7 +480,6 @@ void AnimationSlideController::displayCurrentSlide( const Reference< XSlideShow
if( getSlideAPI( nCurrentSlideNumber, xSlide, xAnimNode ) ) if( getSlideAPI( nCurrentSlideNumber, xSlide, xAnimNode ) )
xShow->displaySlide( xSlide, xDrawPages, xAnimNode, comphelper::containerToSequence(aProperties) ); xShow->displaySlide( xSlide, xDrawPages, xAnimNode, comphelper::containerToSequence(aProperties) );
}
} }
static constexpr OUStringLiteral gsOnClick( "OnClick" ); static constexpr OUStringLiteral gsOnClick( "OnClick" );
...@@ -1196,7 +1196,10 @@ bool SlideshowImpl::longpress(const CommandLongPressData &rLongPressData) ...@@ -1196,7 +1196,10 @@ bool SlideshowImpl::longpress(const CommandLongPressData &rLongPressData)
void SlideshowImpl::removeShapeEvents() void SlideshowImpl::removeShapeEvents()
{ {
if( mxShow.is() && mxListenerProxy.is() ) try if( !(mxShow.is() && mxListenerProxy.is()) )
return;
try
{ {
for( const auto& rEntry : maShapeEventMap ) for( const auto& rEntry : maShapeEventMap )
{ {
...@@ -1215,7 +1218,10 @@ void SlideshowImpl::removeShapeEvents() ...@@ -1215,7 +1218,10 @@ void SlideshowImpl::removeShapeEvents()
void SlideshowImpl::registerShapeEvents(sal_Int32 nSlideNumber) void SlideshowImpl::registerShapeEvents(sal_Int32 nSlideNumber)
{ {
if( nSlideNumber >= 0 ) try if( nSlideNumber < 0 )
return;
try
{ {
Reference< XDrawPagesSupplier > xDrawPages( mxModel, UNO_QUERY_THROW ); Reference< XDrawPagesSupplier > xDrawPages( mxModel, UNO_QUERY_THROW );
Reference< XIndexAccess > xPages( xDrawPages->getDrawPages(), UNO_QUERY_THROW ); Reference< XIndexAccess > xPages( xDrawPages->getDrawPages(), UNO_QUERY_THROW );
...@@ -1362,7 +1368,10 @@ void SAL_CALL SlideshowImpl::pause() ...@@ -1362,7 +1368,10 @@ void SAL_CALL SlideshowImpl::pause()
{ {
SolarMutexGuard aSolarGuard; SolarMutexGuard aSolarGuard;
if( !mbIsPaused ) try if( mbIsPaused )
return;
try
{ {
mbIsPaused = true; mbIsPaused = true;
if( mxShow.is() ) if( mxShow.is() )
...@@ -1845,12 +1854,14 @@ IMPL_LINK( SlideshowImpl, EventListenerHdl, VclSimpleEvent&, rSimpleEvent, void ...@@ -1845,12 +1854,14 @@ IMPL_LINK( SlideshowImpl, EventListenerHdl, VclSimpleEvent&, rSimpleEvent, void
if( !mxShow.is() || mbInputFreeze ) if( !mxShow.is() || mbInputFreeze )
return; return;
if( (rSimpleEvent.GetId() == VclEventId::WindowCommand) && static_cast<VclWindowEvent*>(&rSimpleEvent)->GetData() ) if( !((rSimpleEvent.GetId() == VclEventId::WindowCommand) && static_cast<VclWindowEvent*>(&rSimpleEvent)->GetData()) )
{ return;
const CommandEvent& rEvent = *static_cast<const CommandEvent*>(static_cast<VclWindowEvent*>(&rSimpleEvent)->GetData()); const CommandEvent& rEvent = *static_cast<const CommandEvent*>(static_cast<VclWindowEvent*>(&rSimpleEvent)->GetData());
if( rEvent.GetCommand() == CommandEventId::Media ) if( rEvent.GetCommand() != CommandEventId::Media )
{ return;
CommandMediaData* pMediaData = rEvent.GetMediaData(); CommandMediaData* pMediaData = rEvent.GetMediaData();
pMediaData->SetPassThroughToOS(false); pMediaData->SetPassThroughToOS(false);
switch (pMediaData->GetMediaId()) switch (pMediaData->GetMediaId())
...@@ -1913,8 +1924,6 @@ IMPL_LINK( SlideshowImpl, EventListenerHdl, VclSimpleEvent&, rSimpleEvent, void ...@@ -1913,8 +1924,6 @@ IMPL_LINK( SlideshowImpl, EventListenerHdl, VclSimpleEvent&, rSimpleEvent, void
pMediaData->SetPassThroughToOS(true); pMediaData->SetPassThroughToOS(true);
break; break;
} }
}
}
} }
void SlideshowImpl::mouseButtonUp(const MouseEvent& rMEvt) void SlideshowImpl::mouseButtonUp(const MouseEvent& rMEvt)
...@@ -2225,8 +2234,9 @@ void SlideshowImpl::createSlideList( bool bAll, const OUString& rPresSlide ) ...@@ -2225,8 +2234,9 @@ void SlideshowImpl::createSlideList( bool bAll, const OUString& rPresSlide )
{ {
const sal_uInt16 nSlideCount = mpDoc->GetSdPageCount( PageKind::Standard ); const sal_uInt16 nSlideCount = mpDoc->GetSdPageCount( PageKind::Standard );
if( nSlideCount ) if( !nSlideCount )
{ return;
SdCustomShow* pCustomShow; SdCustomShow* pCustomShow;
if( mpDoc->GetCustomShowList() && maPresSettings.mbCustomShow ) if( mpDoc->GetCustomShowList() && maPresSettings.mbCustomShow )
...@@ -2303,7 +2313,6 @@ void SlideshowImpl::createSlideList( bool bAll, const OUString& rPresSlide ) ...@@ -2303,7 +2313,6 @@ void SlideshowImpl::createSlideList( bool bAll, const OUString& rPresSlide )
mpSlideController->insertSlideNumber( nSdSlide ); mpSlideController->insertSlideNumber( nSdSlide );
} }
} }
}
} }
typedef sal_uInt16 (*FncGetChildWindowId)(); typedef sal_uInt16 (*FncGetChildWindowId)();
...@@ -2325,12 +2334,14 @@ void SlideshowImpl::hideChildWindows() ...@@ -2325,12 +2334,14 @@ void SlideshowImpl::hideChildWindows()
{ {
mnChildMask = 0; mnChildMask = 0;
if( ANIMATIONMODE_SHOW == meAnimationMode ) if( ANIMATIONMODE_SHOW != meAnimationMode )
{ return;
SfxViewFrame* pViewFrame = getViewFrame(); SfxViewFrame* pViewFrame = getViewFrame();
if( pViewFrame ) if( !pViewFrame )
{ return;
for( sal_uLong i = 0; i < SAL_N_ELEMENTS( aShowChildren ); i++ ) for( sal_uLong i = 0; i < SAL_N_ELEMENTS( aShowChildren ); i++ )
{ {
const sal_uInt16 nId = ( *aShowChildren[ i ] )(); const sal_uInt16 nId = ( *aShowChildren[ i ] )();
...@@ -2341,8 +2352,6 @@ void SlideshowImpl::hideChildWindows() ...@@ -2341,8 +2352,6 @@ void SlideshowImpl::hideChildWindows()
mnChildMask |= 1 << i; mnChildMask |= 1 << i;
} }
} }
}
}
} }
void SlideshowImpl::showChildWindows() void SlideshowImpl::showChildWindows()
...@@ -2402,16 +2411,19 @@ void SlideshowImpl::setActiveXToolbarsVisible( bool bVisible ) ...@@ -2402,16 +2411,19 @@ void SlideshowImpl::setActiveXToolbarsVisible( bool bVisible )
{ {
// in case of ActiveX control the toolbars should not be visible if slide show runs in window mode // in case of ActiveX control the toolbars should not be visible if slide show runs in window mode
// actually it runs always in window mode in case of ActiveX control // actually it runs always in window mode in case of ActiveX control
if ( !maPresSettings.mbFullScreen && mpDocSh && mpDocSh->GetMedium() ) if ( !(!maPresSettings.mbFullScreen && mpDocSh && mpDocSh->GetMedium()) )
{ return;
const SfxBoolItem* pItem = SfxItemSet::GetItem<SfxBoolItem>(mpDocSh->GetMedium()->GetItemSet(), SID_VIEWONLY, false); const SfxBoolItem* pItem = SfxItemSet::GetItem<SfxBoolItem>(mpDocSh->GetMedium()->GetItemSet(), SID_VIEWONLY, false);
if ( pItem && pItem->GetValue() ) if ( !(pItem && pItem->GetValue()) )
{ return;
// this is a plugin/activex mode, no toolbars should be visible during slide show // this is a plugin/activex mode, no toolbars should be visible during slide show
// after the end of slide show they should be visible again // after the end of slide show they should be visible again
SfxViewFrame* pViewFrame = getViewFrame(); SfxViewFrame* pViewFrame = getViewFrame();
if( pViewFrame ) if( !pViewFrame )
{ return;
try try
{ {
Reference< frame::XLayoutManager > xLayoutManager; Reference< frame::XLayoutManager > xLayoutManager;
...@@ -2425,9 +2437,6 @@ void SlideshowImpl::setActiveXToolbarsVisible( bool bVisible ) ...@@ -2425,9 +2437,6 @@ void SlideshowImpl::setActiveXToolbarsVisible( bool bVisible )
} }
catch( uno::Exception& ) catch( uno::Exception& )
{} {}
}
}
}
} }
void SAL_CALL SlideshowImpl::activate() void SAL_CALL SlideshowImpl::activate()
...@@ -2436,8 +2445,9 @@ void SAL_CALL SlideshowImpl::activate() ...@@ -2436,8 +2445,9 @@ void SAL_CALL SlideshowImpl::activate()
maDeactivateTimer.Stop(); maDeactivateTimer.Stop();
if( !mbActive && mxShow.is() ) if( !(!mbActive && mxShow.is()) )
{ return;
mbActive = true; mbActive = true;
if( ANIMATIONMODE_SHOW == meAnimationMode ) if( ANIMATIONMODE_SHOW == meAnimationMode )
...@@ -2466,7 +2476,6 @@ void SAL_CALL SlideshowImpl::activate() ...@@ -2466,7 +2476,6 @@ void SAL_CALL SlideshowImpl::activate()
} }
resume(); resume();
}
} }
void SAL_CALL SlideshowImpl::deactivate() void SAL_CALL SlideshowImpl::deactivate()
...@@ -2481,8 +2490,9 @@ void SAL_CALL SlideshowImpl::deactivate() ...@@ -2481,8 +2490,9 @@ void SAL_CALL SlideshowImpl::deactivate()
IMPL_LINK_NOARG(SlideshowImpl, deactivateHdl, Timer *, void) IMPL_LINK_NOARG(SlideshowImpl, deactivateHdl, Timer *, void)
{ {
if( mbActive && mxShow.is() ) if( !(mbActive && mxShow.is()) )
{ return;
mbActive = false; mbActive = false;
pause(); pause();
...@@ -2497,7 +2507,6 @@ IMPL_LINK_NOARG(SlideshowImpl, deactivateHdl, Timer *, void) ...@@ -2497,7 +2507,6 @@ IMPL_LINK_NOARG(SlideshowImpl, deactivateHdl, Timer *, void)
showChildWindows(); showChildWindows();
} }
} }
}
} }
sal_Bool SAL_CALL SlideshowImpl::isActive() sal_Bool SAL_CALL SlideshowImpl::isActive()
...@@ -2629,7 +2638,10 @@ void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) ...@@ -2629,7 +2638,10 @@ void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen )
{ {
SolarMutexGuard aSolarGuard; SolarMutexGuard aSolarGuard;
mbUsePen = bMouseAsPen; mbUsePen = bMouseAsPen;
if( mxShow.is() ) try if( !mxShow.is() )
return;
try
{ {
// For Pencolor; // For Pencolor;
Any aValue; Any aValue;
...@@ -2690,10 +2702,14 @@ void SAL_CALL SlideshowImpl::setPenColor( sal_Int32 nColor ) ...@@ -2690,10 +2702,14 @@ void SAL_CALL SlideshowImpl::setPenColor( sal_Int32 nColor )
void SlideshowImpl::setEraseAllInk(bool bEraseAllInk) void SlideshowImpl::setEraseAllInk(bool bEraseAllInk)
{ {
if( bEraseAllInk ) if( !bEraseAllInk )
{ return;
SolarMutexGuard aSolarGuard; SolarMutexGuard aSolarGuard;
if( mxShow.is() ) try if( !mxShow.is() )
return;
try
{ {
beans::PropertyValue aPenPropEraseAllInk; beans::PropertyValue aPenPropEraseAllInk;
aPenPropEraseAllInk.Name = "EraseAllInk"; aPenPropEraseAllInk.Name = "EraseAllInk";
...@@ -2705,7 +2721,6 @@ void SlideshowImpl::setEraseAllInk(bool bEraseAllInk) ...@@ -2705,7 +2721,6 @@ void SlideshowImpl::setEraseAllInk(bool bEraseAllInk)
SAL_WARN( "sd.slideshow", "sd::SlideshowImpl::setEraseAllInk(), " SAL_WARN( "sd.slideshow", "sd::SlideshowImpl::setEraseAllInk(), "
"exception caught: " << comphelper::anyToString( cppu::getCaughtException() )); "exception caught: " << comphelper::anyToString( cppu::getCaughtException() ));
} }
}
} }
// XSlideShowController Methods // XSlideShowController Methods
...@@ -2719,8 +2734,9 @@ void SAL_CALL SlideshowImpl::gotoNextEffect( ) ...@@ -2719,8 +2734,9 @@ void SAL_CALL SlideshowImpl::gotoNextEffect( )
{ {
SolarMutexGuard aSolarGuard; SolarMutexGuard aSolarGuard;
if( mxShow.is() && mpSlideController.get() && mpShowWindow ) if( !(mxShow.is() && mpSlideController.get() && mpShowWindow) )
{ return;
if( mbIsPaused ) if( mbIsPaused )
resume(); resume();
...@@ -2738,15 +2754,15 @@ void SAL_CALL SlideshowImpl::gotoNextEffect( ) ...@@ -2738,15 +2754,15 @@ void SAL_CALL SlideshowImpl::gotoNextEffect( )
mxShow->nextEffect(); mxShow->nextEffect();
update(); update();
} }
}
} }
void SAL_CALL SlideshowImpl::gotoPreviousEffect( ) void SAL_CALL SlideshowImpl::gotoPreviousEffect( )
{ {
SolarMutexGuard aSolarGuard; SolarMutexGuard aSolarGuard;
if( mxShow.is() && mpSlideController.get() && mpShowWindow ) if( !(mxShow.is() && mpSlideController.get() && mpShowWindow) )
{ return;
if( mbIsPaused ) if( mbIsPaused )
resume(); resume();
...@@ -2760,15 +2776,15 @@ void SAL_CALL SlideshowImpl::gotoPreviousEffect( ) ...@@ -2760,15 +2776,15 @@ void SAL_CALL SlideshowImpl::gotoPreviousEffect( )
mxShow->previousEffect(); mxShow->previousEffect();
update(); update();
} }
}
} }
void SAL_CALL SlideshowImpl::gotoFirstSlide( ) void SAL_CALL SlideshowImpl::gotoFirstSlide( )
{ {
SolarMutexGuard aSolarGuard; SolarMutexGuard aSolarGuard;
if( mpShowWindow && mpSlideController.get() ) if( !(mpShowWindow && mpSlideController.get()) )
{ return;
if( mbIsPaused ) if( mbIsPaused )
resume(); resume();
...@@ -2781,7 +2797,6 @@ void SAL_CALL SlideshowImpl::gotoFirstSlide( ) ...@@ -2781,7 +2797,6 @@ void SAL_CALL SlideshowImpl::gotoFirstSlide( )
{ {
displaySlideIndex( 0 ); displaySlideIndex( 0 );
} }
}
} }
void SAL_CALL SlideshowImpl::gotoNextSlide( ) void SAL_CALL SlideshowImpl::gotoNextSlide( )
...@@ -2864,7 +2879,10 @@ void SlideshowImpl::gotoPreviousSlide (const bool bSkipAllMainSequenceEffects) ...@@ -2864,7 +2879,10 @@ void SlideshowImpl::gotoPreviousSlide (const bool bSkipAllMainSequenceEffects)
{ {
SolarMutexGuard aSolarGuard; SolarMutexGuard aSolarGuard;
if( mxShow.is() && mpSlideController.get() ) try if( !(mxShow.is() && mpSlideController.get()) )
return;
try
{ {
if( mbIsPaused ) if( mbIsPaused )
resume(); resume();
...@@ -2909,8 +2927,9 @@ void SAL_CALL SlideshowImpl::gotoLastSlide() ...@@ -2909,8 +2927,9 @@ void SAL_CALL SlideshowImpl::gotoLastSlide()
{ {
SolarMutexGuard aSolarGuard; SolarMutexGuard aSolarGuard;
if( mpSlideController.get() ) if( !mpSlideController.get() )
{ return;
if( mbIsPaused ) if( mbIsPaused )
resume(); resume();
...@@ -2926,7 +2945,6 @@ void SAL_CALL SlideshowImpl::gotoLastSlide() ...@@ -2926,7 +2945,6 @@ void SAL_CALL SlideshowImpl::gotoLastSlide()
displaySlideIndex( nLastSlideIndex ); displaySlideIndex( nLastSlideIndex );
} }
} }
}
} }
void SAL_CALL SlideshowImpl::gotoBookmark( const OUString& rBookmark ) void SAL_CALL SlideshowImpl::gotoBookmark( const OUString& rBookmark )
...@@ -2945,8 +2963,9 @@ void SAL_CALL SlideshowImpl::gotoSlide( const Reference< XDrawPage >& xSlide ) ...@@ -2945,8 +2963,9 @@ void SAL_CALL SlideshowImpl::gotoSlide( const Reference< XDrawPage >& xSlide )
{ {
SolarMutexGuard aSolarGuard; SolarMutexGuard aSolarGuard;
if( mpSlideController.get() && xSlide.is() ) if( !(mpSlideController.get() && xSlide.is()) )
{ return;
if( mbIsPaused ) if( mbIsPaused )
resume(); resume();
...@@ -2958,7 +2977,6 @@ void SAL_CALL SlideshowImpl::gotoSlide( const Reference< XDrawPage >& xSlide ) ...@@ -2958,7 +2977,6 @@ void SAL_CALL SlideshowImpl::gotoSlide( const Reference< XDrawPage >& xSlide )
displaySlideNumber( nSlide ); displaySlideNumber( nSlide );
} }
} }
}
} }
void SAL_CALL SlideshowImpl::gotoSlideIndex( sal_Int32 nIndex ) void SAL_CALL SlideshowImpl::gotoSlideIndex( sal_Int32 nIndex )
......
...@@ -487,8 +487,9 @@ awt::Rectangle SAL_CALL SlideShowView::getCanvasArea( ) ...@@ -487,8 +487,9 @@ awt::Rectangle SAL_CALL SlideShowView::getCanvasArea( )
void SlideShowView::updateimpl( ::osl::ClearableMutexGuard& rGuard, SlideshowImpl* pSlideShow ) void SlideShowView::updateimpl( ::osl::ClearableMutexGuard& rGuard, SlideshowImpl* pSlideShow )
{ {
if( pSlideShow ) if( !pSlideShow )
{ return;
::rtl::Reference< SlideshowImpl > aSLGuard( pSlideShow ); ::rtl::Reference< SlideshowImpl > aSLGuard( pSlideShow );
if( mbFirstPaint ) if( mbFirstPaint )
...@@ -502,7 +503,6 @@ void SlideShowView::updateimpl( ::osl::ClearableMutexGuard& rGuard, SlideshowImp ...@@ -502,7 +503,6 @@ void SlideShowView::updateimpl( ::osl::ClearableMutexGuard& rGuard, SlideshowImp
rGuard.clear(); rGuard.clear();
pSlideShow->startUpdateTimer(); pSlideShow->startUpdateTimer();
}
} }
// XWindowListener methods // XWindowListener methods
...@@ -662,8 +662,9 @@ void SlideShowView::init() ...@@ -662,8 +662,9 @@ void SlideShowView::init()
// #i48939# only switch on kind of hacky scroll optimization, when // #i48939# only switch on kind of hacky scroll optimization, when
// running fullscreen. this minimizes the probability that other // running fullscreen. this minimizes the probability that other
// windows partially cover the show. // windows partially cover the show.
if( mbFullScreen ) if( !mbFullScreen )
{ return;
try try
{ {
Reference< beans::XPropertySet > xCanvasProps( getCanvas(), Reference< beans::XPropertySet > xCanvasProps( getCanvas(),
...@@ -674,7 +675,6 @@ void SlideShowView::init() ...@@ -674,7 +675,6 @@ void SlideShowView::init()
catch( uno::Exception& ) catch( uno::Exception& )
{ {
} }
}
} }
} // namespace ::sd } // namespace ::sd
......
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