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,10 +81,12 @@ void SlideShowRestarter::Restart (bool bForce)
IMPL_LINK_NOARG(SlideShowRestarter, EndPresentation, void*, void)
{
mnEventId = nullptr;
if (mpSlideShow.is())
{
if (mnDisplayCount != static_cast<sal_Int32>(Application::GetScreenCount()))
{
if (!mpSlideShow.is())
return;
if (mnDisplayCount == static_cast<sal_Int32>(Application::GetScreenCount()))
return;
bool bIsExitAfterPresenting = mpSlideShow->IsExitAfterPresenting();
mpSlideShow->SetExitAfterPresenting(false);
mpSlideShow->end();
......@@ -100,8 +102,9 @@ IMPL_LINK_NOARG(SlideShowRestarter, EndPresentation, void*, void)
// console, to disappear. Only when it is gone, call
// InitiatePresenterStart(), in order to begin the asynchronous
// restart of the slide show.
if (mpViewShellBase != nullptr)
{
if (mpViewShellBase == nullptr)
return;
::std::shared_ptr<FrameworkHelper> pHelper(
FrameworkHelper::Instance(*mpViewShellBase));
if (pHelper->GetConfigurationController()->getResource(
......@@ -119,9 +122,6 @@ IMPL_LINK_NOARG(SlideShowRestarter, EndPresentation, void*, void)
{
StartPresentation();
}
}
}
}
}
void SlideShowRestarter::StartPresentation()
......
......@@ -294,8 +294,9 @@ void ShowWindow::LoseFocus()
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 );
......@@ -308,7 +309,6 @@ void ShowWindow::SetEndMode()
}
Invalidate();
}
}
bool ShowWindow::SetPauseMode( sal_Int32 nTimeout, Graphic const * pLogo )
......
......@@ -650,8 +650,9 @@ void SAL_CALL SlideShow::end()
mbIsInStartup = false;
rtl::Reference< SlideshowImpl > xController( mxController );
if( xController.is() )
{
if( !xController.is() )
return;
mxController.clear();
if( mpFullScreenFrameView )
......@@ -778,7 +779,6 @@ void SAL_CALL SlideShow::end()
pViewShell->SwitchActiveViewFireFocus();
}
mpCurrentViewShellBase = nullptr;
}
}
void SAL_CALL SlideShow::rehearseTimings()
......@@ -1083,8 +1083,9 @@ void SlideShow::StartInPlacePresentation()
CreateController( nullptr, nullptr, mxCurrentSettings->mpParentWindow );
}
if( mxController.is() )
{
if( !mxController.is() )
return;
bool bSuccess = false;
if( mxCurrentSettings.get() && mxCurrentSettings->mbPreview )
{
......@@ -1102,7 +1103,6 @@ void SlideShow::StartInPlacePresentation()
if( mpCurrentViewShellBase && ( !mxCurrentSettings.get() || ( mxCurrentSettings.get() && !mxCurrentSettings->mbPreview ) ) )
mpCurrentViewShellBase->GetWindow()->GrabFocus();
}
}
}
void SlideShow::StartFullscreenPresentation( )
......@@ -1120,8 +1120,9 @@ void SlideShow::StartFullscreenPresentation( )
pWorkWindow->StartPresentationMode( true, mpDoc->getPresentationSettings().mbAlwaysOnTop ? PresentationFlags::HideAllApps : PresentationFlags::NONE, nDisplay);
// pWorkWindow->ShowFullScreenMode(sal_False, nDisplay);
if (pWorkWindow->IsVisible())
{
if (!pWorkWindow->IsVisible())
return;
// Initialize the new presentation view shell with a copy of the
// frame view of the current view shell. This avoids that
// changes made by the presentation have an effect on the other
......@@ -1148,7 +1149,6 @@ void SlideShow::StartFullscreenPresentation( )
// Windows and some Linux variants.)
mpFullScreenViewShellBase->GetWindow()->GrabFocus();
}
}
}
/// convert configuration setting display concept to real screens
......
......@@ -444,8 +444,9 @@ void AnimationSlideController::displayCurrentSlide( const Reference< XSlideShow
{
const sal_Int32 nCurrentSlideNumber = getCurrentSlideNumber();
if( xShow.is() && (nCurrentSlideNumber != -1 ) )
{
if( !(xShow.is() && (nCurrentSlideNumber != -1 )) )
return;
Reference< XDrawPage > xSlide;
Reference< XAnimationNode > xAnimNode;
::std::vector<PropertyValue> aProperties;
......@@ -479,7 +480,6 @@ void AnimationSlideController::displayCurrentSlide( const Reference< XSlideShow
if( getSlideAPI( nCurrentSlideNumber, xSlide, xAnimNode ) )
xShow->displaySlide( xSlide, xDrawPages, xAnimNode, comphelper::containerToSequence(aProperties) );
}
}
static constexpr OUStringLiteral gsOnClick( "OnClick" );
......@@ -1196,7 +1196,10 @@ bool SlideshowImpl::longpress(const CommandLongPressData &rLongPressData)
void SlideshowImpl::removeShapeEvents()
{
if( mxShow.is() && mxListenerProxy.is() ) try
if( !(mxShow.is() && mxListenerProxy.is()) )
return;
try
{
for( const auto& rEntry : maShapeEventMap )
{
......@@ -1215,7 +1218,10 @@ void SlideshowImpl::removeShapeEvents()
void SlideshowImpl::registerShapeEvents(sal_Int32 nSlideNumber)
{
if( nSlideNumber >= 0 ) try
if( nSlideNumber < 0 )
return;
try
{
Reference< XDrawPagesSupplier > xDrawPages( mxModel, UNO_QUERY_THROW );
Reference< XIndexAccess > xPages( xDrawPages->getDrawPages(), UNO_QUERY_THROW );
......@@ -1362,7 +1368,10 @@ void SAL_CALL SlideshowImpl::pause()
{
SolarMutexGuard aSolarGuard;
if( !mbIsPaused ) try
if( mbIsPaused )
return;
try
{
mbIsPaused = true;
if( mxShow.is() )
......@@ -1845,12 +1854,14 @@ IMPL_LINK( SlideshowImpl, EventListenerHdl, VclSimpleEvent&, rSimpleEvent, void
if( !mxShow.is() || mbInputFreeze )
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());
if( rEvent.GetCommand() == CommandEventId::Media )
{
if( rEvent.GetCommand() != CommandEventId::Media )
return;
CommandMediaData* pMediaData = rEvent.GetMediaData();
pMediaData->SetPassThroughToOS(false);
switch (pMediaData->GetMediaId())
......@@ -1913,8 +1924,6 @@ IMPL_LINK( SlideshowImpl, EventListenerHdl, VclSimpleEvent&, rSimpleEvent, void
pMediaData->SetPassThroughToOS(true);
break;
}
}
}
}
void SlideshowImpl::mouseButtonUp(const MouseEvent& rMEvt)
......@@ -2225,8 +2234,9 @@ void SlideshowImpl::createSlideList( bool bAll, const OUString& rPresSlide )
{
const sal_uInt16 nSlideCount = mpDoc->GetSdPageCount( PageKind::Standard );
if( nSlideCount )
{
if( !nSlideCount )
return;
SdCustomShow* pCustomShow;
if( mpDoc->GetCustomShowList() && maPresSettings.mbCustomShow )
......@@ -2303,7 +2313,6 @@ void SlideshowImpl::createSlideList( bool bAll, const OUString& rPresSlide )
mpSlideController->insertSlideNumber( nSdSlide );
}
}
}
}
typedef sal_uInt16 (*FncGetChildWindowId)();
......@@ -2325,12 +2334,14 @@ void SlideshowImpl::hideChildWindows()
{
mnChildMask = 0;
if( ANIMATIONMODE_SHOW == meAnimationMode )
{
if( ANIMATIONMODE_SHOW != meAnimationMode )
return;
SfxViewFrame* pViewFrame = getViewFrame();
if( pViewFrame )
{
if( !pViewFrame )
return;
for( sal_uLong i = 0; i < SAL_N_ELEMENTS( aShowChildren ); i++ )
{
const sal_uInt16 nId = ( *aShowChildren[ i ] )();
......@@ -2341,8 +2352,6 @@ void SlideshowImpl::hideChildWindows()
mnChildMask |= 1 << i;
}
}
}
}
}
void SlideshowImpl::showChildWindows()
......@@ -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
// 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);
if ( pItem && pItem->GetValue() )
{
if ( !(pItem && pItem->GetValue()) )
return;
// 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
SfxViewFrame* pViewFrame = getViewFrame();
if( pViewFrame )
{
if( !pViewFrame )
return;
try
{
Reference< frame::XLayoutManager > xLayoutManager;
......@@ -2425,9 +2437,6 @@ void SlideshowImpl::setActiveXToolbarsVisible( bool bVisible )
}
catch( uno::Exception& )
{}
}
}
}
}
void SAL_CALL SlideshowImpl::activate()
......@@ -2436,8 +2445,9 @@ void SAL_CALL SlideshowImpl::activate()
maDeactivateTimer.Stop();
if( !mbActive && mxShow.is() )
{
if( !(!mbActive && mxShow.is()) )
return;
mbActive = true;
if( ANIMATIONMODE_SHOW == meAnimationMode )
......@@ -2466,7 +2476,6 @@ void SAL_CALL SlideshowImpl::activate()
}
resume();
}
}
void SAL_CALL SlideshowImpl::deactivate()
......@@ -2481,8 +2490,9 @@ void SAL_CALL SlideshowImpl::deactivate()
IMPL_LINK_NOARG(SlideshowImpl, deactivateHdl, Timer *, void)
{
if( mbActive && mxShow.is() )
{
if( !(mbActive && mxShow.is()) )
return;
mbActive = false;
pause();
......@@ -2497,7 +2507,6 @@ IMPL_LINK_NOARG(SlideshowImpl, deactivateHdl, Timer *, void)
showChildWindows();
}
}
}
}
sal_Bool SAL_CALL SlideshowImpl::isActive()
......@@ -2629,7 +2638,10 @@ void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen )
{
SolarMutexGuard aSolarGuard;
mbUsePen = bMouseAsPen;
if( mxShow.is() ) try
if( !mxShow.is() )
return;
try
{
// For Pencolor;
Any aValue;
......@@ -2690,10 +2702,14 @@ void SAL_CALL SlideshowImpl::setPenColor( sal_Int32 nColor )
void SlideshowImpl::setEraseAllInk(bool bEraseAllInk)
{
if( bEraseAllInk )
{
if( !bEraseAllInk )
return;
SolarMutexGuard aSolarGuard;
if( mxShow.is() ) try
if( !mxShow.is() )
return;
try
{
beans::PropertyValue aPenPropEraseAllInk;
aPenPropEraseAllInk.Name = "EraseAllInk";
......@@ -2705,7 +2721,6 @@ void SlideshowImpl::setEraseAllInk(bool bEraseAllInk)
SAL_WARN( "sd.slideshow", "sd::SlideshowImpl::setEraseAllInk(), "
"exception caught: " << comphelper::anyToString( cppu::getCaughtException() ));
}
}
}
// XSlideShowController Methods
......@@ -2719,8 +2734,9 @@ void SAL_CALL SlideshowImpl::gotoNextEffect( )
{
SolarMutexGuard aSolarGuard;
if( mxShow.is() && mpSlideController.get() && mpShowWindow )
{
if( !(mxShow.is() && mpSlideController.get() && mpShowWindow) )
return;
if( mbIsPaused )
resume();
......@@ -2738,15 +2754,15 @@ void SAL_CALL SlideshowImpl::gotoNextEffect( )
mxShow->nextEffect();
update();
}
}
}
void SAL_CALL SlideshowImpl::gotoPreviousEffect( )
{
SolarMutexGuard aSolarGuard;
if( mxShow.is() && mpSlideController.get() && mpShowWindow )
{
if( !(mxShow.is() && mpSlideController.get() && mpShowWindow) )
return;
if( mbIsPaused )
resume();
......@@ -2760,15 +2776,15 @@ void SAL_CALL SlideshowImpl::gotoPreviousEffect( )
mxShow->previousEffect();
update();
}
}
}
void SAL_CALL SlideshowImpl::gotoFirstSlide( )
{
SolarMutexGuard aSolarGuard;
if( mpShowWindow && mpSlideController.get() )
{
if( !(mpShowWindow && mpSlideController.get()) )
return;
if( mbIsPaused )
resume();
......@@ -2781,7 +2797,6 @@ void SAL_CALL SlideshowImpl::gotoFirstSlide( )
{
displaySlideIndex( 0 );
}
}
}
void SAL_CALL SlideshowImpl::gotoNextSlide( )
......@@ -2864,7 +2879,10 @@ void SlideshowImpl::gotoPreviousSlide (const bool bSkipAllMainSequenceEffects)
{
SolarMutexGuard aSolarGuard;
if( mxShow.is() && mpSlideController.get() ) try
if( !(mxShow.is() && mpSlideController.get()) )
return;
try
{
if( mbIsPaused )
resume();
......@@ -2909,8 +2927,9 @@ void SAL_CALL SlideshowImpl::gotoLastSlide()
{
SolarMutexGuard aSolarGuard;
if( mpSlideController.get() )
{
if( !mpSlideController.get() )
return;
if( mbIsPaused )
resume();
......@@ -2926,7 +2945,6 @@ void SAL_CALL SlideshowImpl::gotoLastSlide()
displaySlideIndex( nLastSlideIndex );
}
}
}
}
void SAL_CALL SlideshowImpl::gotoBookmark( const OUString& rBookmark )
......@@ -2945,8 +2963,9 @@ void SAL_CALL SlideshowImpl::gotoSlide( const Reference< XDrawPage >& xSlide )
{
SolarMutexGuard aSolarGuard;
if( mpSlideController.get() && xSlide.is() )
{
if( !(mpSlideController.get() && xSlide.is()) )
return;
if( mbIsPaused )
resume();
......@@ -2958,7 +2977,6 @@ void SAL_CALL SlideshowImpl::gotoSlide( const Reference< XDrawPage >& xSlide )
displaySlideNumber( nSlide );
}
}
}
}
void SAL_CALL SlideshowImpl::gotoSlideIndex( sal_Int32 nIndex )
......
......@@ -487,8 +487,9 @@ 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 )
......@@ -502,7 +503,6 @@ void SlideShowView::updateimpl( ::osl::ClearableMutexGuard& rGuard, SlideshowImp
rGuard.clear();
pSlideShow->startUpdateTimer();
}
}
// XWindowListener methods
......@@ -662,8 +662,9 @@ 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(),
......@@ -674,7 +675,6 @@ void SlideShowView::init()
catch( uno::Exception& )
{
}
}
}
} // 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