diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-14 09:11:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-15 07:51:48 +0100 |
commit | b104e6e979bab16605840c2a14914917d5e552b3 (patch) | |
tree | c06984224bafa77c6f2825da572094c4a498f005 /sd/source/ui/slideshow/SlideShowRestarter.cxx | |
parent | fcdfb94ac11cd4832ad68c896c706fb3cb376ce4 (diff) |
loplugin:flatten in sd/source/ui/slideshow
Change-Id: Id820f0f7ac51928ba1a783615c3e9d6c268affdd
Reviewed-on: https://gerrit.libreoffice.org/67831
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui/slideshow/SlideShowRestarter.cxx')
-rw-r--r-- | sd/source/ui/slideshow/SlideShowRestarter.cxx | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/sd/source/ui/slideshow/SlideShowRestarter.cxx b/sd/source/ui/slideshow/SlideShowRestarter.cxx index 597f30ddb1cc..957ad4496af0 100644 --- a/sd/source/ui/slideshow/SlideShowRestarter.cxx +++ b/sd/source/ui/slideshow/SlideShowRestarter.cxx @@ -81,46 +81,46 @@ void SlideShowRestarter::Restart (bool bForce) IMPL_LINK_NOARG(SlideShowRestarter, EndPresentation, void*, void) { mnEventId = nullptr; - if (mpSlideShow.is()) + if (!mpSlideShow.is()) + return; + + if (mnDisplayCount == static_cast<sal_Int32>(Application::GetScreenCount())) + return; + + bool bIsExitAfterPresenting = mpSlideShow->IsExitAfterPresenting(); + mpSlideShow->SetExitAfterPresenting(false); + mpSlideShow->end(); + mpSlideShow->SetExitAfterPresenting(bIsExitAfterPresenting); + + // The following piece of code should not be here because the + // slide show should be aware of the existence of the presenter + // console (which is displayed in the FullScreenPane). But the + // timing has to be right and I did not find a better place for + // it. + + // Wait for the full screen pane, which displays the presenter + // console, to disappear. Only when it is gone, call + // InitiatePresenterStart(), in order to begin the asynchronous + // restart of the slide show. + if (mpViewShellBase == nullptr) + return; + + ::std::shared_ptr<FrameworkHelper> pHelper( + FrameworkHelper::Instance(*mpViewShellBase)); + if (pHelper->GetConfigurationController()->getResource( + FrameworkHelper::CreateResourceId(FrameworkHelper::msFullScreenPaneURL)).is()) { - if (mnDisplayCount != static_cast<sal_Int32>(Application::GetScreenCount())) - { - bool bIsExitAfterPresenting = mpSlideShow->IsExitAfterPresenting(); - mpSlideShow->SetExitAfterPresenting(false); - mpSlideShow->end(); - mpSlideShow->SetExitAfterPresenting(bIsExitAfterPresenting); - - // The following piece of code should not be here because the - // slide show should be aware of the existence of the presenter - // console (which is displayed in the FullScreenPane). But the - // timing has to be right and I did not find a better place for - // it. - - // Wait for the full screen pane, which displays the presenter - // console, to disappear. Only when it is gone, call - // InitiatePresenterStart(), in order to begin the asynchronous - // restart of the slide show. - if (mpViewShellBase != nullptr) - { - ::std::shared_ptr<FrameworkHelper> pHelper( - FrameworkHelper::Instance(*mpViewShellBase)); - if (pHelper->GetConfigurationController()->getResource( - FrameworkHelper::CreateResourceId(FrameworkHelper::msFullScreenPaneURL)).is()) - { - ::sd::framework::ConfigurationController::Lock aLock ( - pHelper->GetConfigurationController()); - - pHelper->RunOnConfigurationEvent( - FrameworkHelper::msConfigurationUpdateEndEvent, - ::std::bind(&SlideShowRestarter::StartPresentation, shared_from_this())); - pHelper->UpdateConfiguration(); - } - else - { - StartPresentation(); - } - } - } + ::sd::framework::ConfigurationController::Lock aLock ( + pHelper->GetConfigurationController()); + + pHelper->RunOnConfigurationEvent( + FrameworkHelper::msConfigurationUpdateEndEvent, + ::std::bind(&SlideShowRestarter::StartPresentation, shared_from_this())); + pHelper->UpdateConfiguration(); + } + else + { + StartPresentation(); } } |