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)
{
// Hide the left and right pane windows when a slideshow exists and is
// not full screen.
if (pSlideShow!=nullptr && !pSlideShow->isFullScreen()) try
if (pSlideShow==nullptr || pSlideShow->isFullScreen())
return;
try
{
Reference<XControllerManager> xControllerManager (
mrViewShell.GetViewShellBase().GetController(), UNO_QUERY_THROW);
......
......@@ -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();
}
}
......
......@@ -294,21 +294,21 @@ void ShowWindow::LoseFocus()
void ShowWindow::SetEndMode()
{
if( ( SHOWWINDOWMODE_NORMAL == meShowWindowMode ) && mpViewShell && mpViewShell->GetView() )
{
DeleteWindowFromPaintView();
meShowWindowMode = SHOWWINDOWMODE_END;
maShowBackground = Wallpaper( COL_BLACK );
if( !(( SHOWWINDOWMODE_NORMAL == meShowWindowMode ) && mpViewShell && mpViewShell->GetView()) )
return;
// hide navigator if it is visible
if( mpViewShell->GetViewFrame()->GetChildWindow( SID_NAVIGATOR ) )
{
mpViewShell->GetViewFrame()->ShowChildWindow( SID_NAVIGATOR, false );
mbShowNavigatorAfterSpecialMode = true;
}
DeleteWindowFromPaintView();
meShowWindowMode = SHOWWINDOWMODE_END;
maShowBackground = Wallpaper( COL_BLACK );
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 )
......
......@@ -487,22 +487,22 @@ awt::Rectangle SAL_CALL SlideShowView::getCanvasArea( )
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 )
{
mbFirstPaint = false;
SlideshowImpl* pTmpSlideShow = mpSlideShow;
rGuard.clear();
if( pTmpSlideShow )
pTmpSlideShow->onFirstPaint();
} else
rGuard.clear();
pSlideShow->startUpdateTimer();
}
pSlideShow->startUpdateTimer();
}
// XWindowListener methods
......@@ -662,18 +662,18 @@ void SlideShowView::init()
// #i48939# only switch on kind of hacky scroll optimization, when
// running fullscreen. this minimizes the probability that other
// 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