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,46 +81,46 @@ void SlideShowRestarter::Restart (bool bForce) ...@@ -81,46 +81,46 @@ 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()))
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())) ::sd::framework::ConfigurationController::Lock aLock (
{ pHelper->GetConfigurationController());
bool bIsExitAfterPresenting = mpSlideShow->IsExitAfterPresenting();
mpSlideShow->SetExitAfterPresenting(false); pHelper->RunOnConfigurationEvent(
mpSlideShow->end(); FrameworkHelper::msConfigurationUpdateEndEvent,
mpSlideShow->SetExitAfterPresenting(bIsExitAfterPresenting); ::std::bind(&SlideShowRestarter::StartPresentation, shared_from_this()));
pHelper->UpdateConfiguration();
// The following piece of code should not be here because the }
// slide show should be aware of the existence of the presenter else
// console (which is displayed in the FullScreenPane). But the {
// timing has to be right and I did not find a better place for StartPresentation();
// 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();
}
}
}
} }
} }
......
...@@ -294,21 +294,21 @@ void ShowWindow::LoseFocus() ...@@ -294,21 +294,21 @@ 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();
meShowWindowMode = SHOWWINDOWMODE_END;
maShowBackground = Wallpaper( COL_BLACK );
// hide navigator if it is visible DeleteWindowFromPaintView();
if( mpViewShell->GetViewFrame()->GetChildWindow( SID_NAVIGATOR ) ) meShowWindowMode = SHOWWINDOWMODE_END;
{ maShowBackground = Wallpaper( COL_BLACK );
mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, false );
mbShowNavigatorAfterSpecialMode = true;
}
Invalidate(); // hide navigator if it is visible
if( mpViewShell->GetViewFrame()->GetChildWindow( SID_NAVIGATOR ) )
{
mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, false );
mbShowNavigatorAfterSpecialMode = true;
} }
Invalidate();
} }
bool ShowWindow::SetPauseMode( sal_Int32 nTimeout, Graphic const * pLogo ) bool ShowWindow::SetPauseMode( sal_Int32 nTimeout, Graphic const * pLogo )
......
...@@ -487,22 +487,22 @@ awt::Rectangle SAL_CALL SlideShowView::getCanvasArea( ) ...@@ -487,22 +487,22 @@ 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 );
if( mbFirstPaint )
{ {
::rtl::Reference< SlideshowImpl > aSLGuard( pSlideShow ); mbFirstPaint = false;
SlideshowImpl* pTmpSlideShow = mpSlideShow;
rGuard.clear();
if( pTmpSlideShow )
pTmpSlideShow->onFirstPaint();
} else
rGuard.clear();
if( mbFirstPaint ) pSlideShow->startUpdateTimer();
{
mbFirstPaint = false;
SlideshowImpl* pTmpSlideShow = mpSlideShow;
rGuard.clear();
if( pTmpSlideShow )
pTmpSlideShow->onFirstPaint();
} else
rGuard.clear();
pSlideShow->startUpdateTimer();
}
} }
// XWindowListener methods // XWindowListener methods
...@@ -662,18 +662,18 @@ void SlideShowView::init() ...@@ -662,18 +662,18 @@ 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
{
Reference< beans::XPropertySet > xCanvasProps( getCanvas(),
uno::UNO_QUERY_THROW );
xCanvasProps->setPropertyValue("UnsafeScrolling",
uno::makeAny( true ) );
}
catch( uno::Exception& )
{ {
try
{
Reference< beans::XPropertySet > xCanvasProps( getCanvas(),
uno::UNO_QUERY_THROW );
xCanvasProps->setPropertyValue("UnsafeScrolling",
uno::makeAny( true ) );
}
catch( uno::Exception& )
{
}
} }
} }
......
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