diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-06 13:32:43 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-14 18:03:06 +0200 |
commit | e67657d5211f6e95ddf8bd621108608573b00d5d (patch) | |
tree | 66724101dbd95721714bd40fcb4861663432774c /sd/source | |
parent | 186def8f48e273c3a3b4d23b3ab2efd0d8664731 (diff) |
loplugin:simplifybool more
look for expressions like
!(a && !b)
which can be expanded out
Change-Id: I72515a9638762b050f9a258c08da39ebfa2ef8e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100579
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/core/drawdoc4.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/animations/motionpathtag.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/annotations/annotationtag.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/annotations/annotationwindow.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/app/sdxfer.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/futext.cxx | 10 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshowimpl.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/viewoverlaymanager.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/viewshel.cxx | 2 |
10 files changed, 16 insertions, 16 deletions
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index 59687f189450..c33f9d5f3f98 100644 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -819,8 +819,8 @@ void SdDrawDocument::StopOnlineSpelling() // Start OnlineSpelling in the background void SdDrawDocument::StartOnlineSpelling(bool bForceSpelling) { - if (!(mbOnlineSpell && (bForceSpelling || mbInitialOnlineSpellingEnabled) && - mpDocSh && !mpDocSh->IsReadOnly()) ) + if ( !mbOnlineSpell || !(bForceSpelling || mbInitialOnlineSpellingEnabled) || + !mpDocSh || mpDocSh->IsReadOnly() ) return; StopOnlineSpelling(); diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx index 4c5226fcf8c6..1bc2c58cad96 100644 --- a/sd/source/ui/animations/motionpathtag.cxx +++ b/sd/source/ui/animations/motionpathtag.cxx @@ -285,7 +285,7 @@ void SdPathHdl::CreateB2dIAObject() SdrMarkView* pView = pHdlList->GetView(); - if(!(pView && !pView->areMarkHandlesHidden())) + if(!pView || pView->areMarkHandlesHidden()) return; SdrPageView* pPageView = pView->GetSdrPageView(); diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx index 4e1cd4504791..f4b0d66a5563 100644 --- a/sd/source/ui/annotations/annotationtag.cxx +++ b/sd/source/ui/annotations/annotationtag.cxx @@ -200,7 +200,7 @@ void AnnotationHdl::CreateB2dIAObject() SdrMarkView* pView = pHdlList->GetView(); - if(!(pView && !pView->areMarkHandlesHidden())) + if(!pView || pView->areMarkHandlesHidden()) return; SdrPageView* pPageView = pView->GetSdrPageView(); diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx index 828045c6b2da..fab5c58679f0 100644 --- a/sd/source/ui/annotations/annotationwindow.cxx +++ b/sd/source/ui/annotations/annotationwindow.cxx @@ -603,7 +603,7 @@ void AnnotationWindow::Paint(vcl::RenderContext& rRenderContext, const ::tools:: { FloatingWindow::Paint(rRenderContext, rRect); - if(!(mpMeta->IsVisible() && !mbReadonly)) + if(!mpMeta->IsVisible() || mbReadonly) return; const bool bHighContrast = Application::GetSettings().GetStyleSettings().GetHighContrastMode(); diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index 769003d1ded9..b56c4a7c6389 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -375,7 +375,7 @@ static bool lcl_HasOnlyOneTable( SdrModel* pModel ) void SdTransferable::AddSupportedFormats() { - if( !(!mbPageTransferable || mbPageTransferablePersistent) ) + if( mbPageTransferable && !mbPageTransferablePersistent ) return; if( !mbLateInit ) diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index 358805436097..a44e89b3b34b 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -1178,11 +1178,11 @@ void FuText::DeleteDefaultText() PresObjKind ePresObjKind = pPage->GetPresObjKind(mxTextObj.get()); - if ( !((ePresObjKind == PresObjKind::Title || - ePresObjKind == PresObjKind::Outline || - ePresObjKind == PresObjKind::Notes || - ePresObjKind == PresObjKind::Text) && - !pPage->IsMasterPage()) ) + if ( !(ePresObjKind == PresObjKind::Title || + ePresObjKind == PresObjKind::Outline || + ePresObjKind == PresObjKind::Notes || + ePresObjKind == PresObjKind::Text ) || + pPage->IsMasterPage() ) return; ::Outliner* pOutliner = mpView->GetTextEditOutliner(); diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index fba43df9aebe..9ca70b5ce710 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -2430,7 +2430,7 @@ void SAL_CALL SlideshowImpl::activate() maDeactivateTimer.Stop(); - if( !(!mbActive && mxShow.is()) ) + if( mbActive || !mxShow.is() ) return; mbActive = true; diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 8db31ea24a25..0d7d14cc2f59 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -1886,8 +1886,8 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r vcl::PDFExtOutDevData* pPDFExtOutDevData = dynamic_cast<vcl::PDFExtOutDevData* >( pOut->GetExtOutDevData() ); - if ( !(!( mpDoc->GetSdPage(static_cast<sal_Int16>(nPageNumber)-1, PageKind::Standard)->IsExcluded() ) || - (pPDFExtOutDevData && pPDFExtOutDevData->GetIsExportHiddenSlides())) ) + if ( mpDoc->GetSdPage(static_cast<sal_Int16>(nPageNumber)-1, PageKind::Standard)->IsExcluded() && + !(pPDFExtOutDevData && pPDFExtOutDevData->GetIsExportHiddenSlides()) ) return; if (pPDFExtOutDevData) diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx index 0485dde40f94..59c9fde7c377 100644 --- a/sd/source/ui/view/viewoverlaymanager.cxx +++ b/sd/source/ui/view/viewoverlaymanager.cxx @@ -262,7 +262,7 @@ void ImageButtonHdl::CreateB2dIAObject() SdrMarkView* pView = pHdlList->GetView(); - if(!(pView && !pView->areMarkHandlesHidden())) + if(!pView || pView->areMarkHandlesHidden()) return; SdrPageView* pPageView = pView->GetSdrPageView(); diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index e1af322f88eb..ec1dd6d27b5a 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -762,7 +762,7 @@ bool ViewShell::HandleScrollCommand(const CommandEvent& rCEvt, ::sd::Window* pWi void ViewShell::SetupRulers() { - if(!(mbHasRulers && mpContentWindow && !SlideShow::IsRunning(GetViewShellBase()))) + if(!mbHasRulers || !mpContentWindow || SlideShow::IsRunning(GetViewShellBase())) return; long nHRulerOfs = 0; |