diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-06-03 10:52:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-06-04 08:23:43 +0200 |
commit | b83ac35bf46ecbebf7f806235eca38a71e521c32 (patch) | |
tree | 660cb00ba4045c7238e9d43176196339ecf901f0 /sd/source | |
parent | 7b905c8f1d520ae1aaf4bd2fbb6a3325b404ea95 (diff) |
loplugin:simplifypointertobool improve (2)
to look for the
x.get() == null
pattern, which can be simplified to
!x
Change-Id: I0eddf93257ab53ab31949961d7c33ac2dd7288ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95400
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/core/CustomAnimationEffect.cxx | 2 | ||||
-rw-r--r-- | sd/source/core/EffectMigration.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/animations/CustomAnimationPane.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/annotations/annotationtag.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/framework/factories/FullScreenPane.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/presenter/PresenterHelper.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/sidebar/LayoutMenu.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/sidebar/MasterPageContainer.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/sidebar/MasterPageDescriptor.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/cache/SlsCacheConfiguration.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlsFocusManager.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlsPageSelector.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/model/SlideSorterModel.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/FormShellManager.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/viewshel.cxx | 4 |
17 files changed, 25 insertions, 25 deletions
diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index d01e46262c70..40ac14ab27fb 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -3216,7 +3216,7 @@ CustomAnimationEffectPtr MainSequence::findEffect( const css::uno::Reference< cs { CustomAnimationEffectPtr pEffect = EffectSequenceHelper::findEffect( xNode ); - if( pEffect.get() == nullptr ) + if( !pEffect ) { for (auto const& interactiveSequence : maInteractiveSequenceVector) { diff --git a/sd/source/core/EffectMigration.cxx b/sd/source/core/EffectMigration.cxx index 58cf4c30b016..9a21767141c0 100644 --- a/sd/source/core/EffectMigration.cxx +++ b/sd/source/core/EffectMigration.cxx @@ -638,7 +638,7 @@ void EffectMigration::SetTextAnimationEffect( SvxShape* pShape, AnimationEffect } // if there is not yet a group, create it - if( pGroup.get() == nullptr ) + if( !pGroup ) { CustomAnimationEffectPtr pShapeEffect; diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index 8af4b358e074..45e44c0d8628 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -1156,7 +1156,7 @@ std::unique_ptr<STLPropertySet> CustomAnimationPane::createSelectionSet() pTextGroup = pEffectSequence->findGroup( nGroupId ); addValue( pSet, nHandleTextGrouping, makeAny( pTextGroup ? pTextGroup->getTextGrouping() : sal_Int32(-1) ) ); - addValue( pSet, nHandleAnimateForm, makeAny( pTextGroup.get() == nullptr || pTextGroup->getAnimateForm() ) ); + addValue( pSet, nHandleAnimateForm, makeAny( !pTextGroup || pTextGroup->getAnimateForm() ) ); addValue( pSet, nHandleTextGroupingAuto, makeAny( pTextGroup ? pTextGroup->getTextGroupingAuto() : -1.0 ) ); addValue( pSet, nHandleTextReverse, makeAny( pTextGroup && pTextGroup->getTextReverse() ) ); diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx index 67d6366de7db..68a3e9a73efc 100644 --- a/sd/source/ui/annotations/annotationtag.cxx +++ b/sd/source/ui/annotations/annotationtag.cxx @@ -629,7 +629,7 @@ IMPL_LINK(AnnotationTag, WindowEventHandler, VclWindowEvent&, rEvent, void) // if we stop pressing the button without a mouse move we open the popup mpListenWindow->RemoveEventListener( LINK(this, AnnotationTag, WindowEventHandler)); mpListenWindow = nullptr; - if( mpAnnotationWindow.get() == nullptr ) + if( !mpAnnotationWindow ) OpenPopup(false); } break; diff --git a/sd/source/ui/framework/factories/FullScreenPane.cxx b/sd/source/ui/framework/factories/FullScreenPane.cxx index fd32ba6c9026..6a0e153b5399 100644 --- a/sd/source/ui/framework/factories/FullScreenPane.cxx +++ b/sd/source/ui/framework/factories/FullScreenPane.cxx @@ -51,7 +51,7 @@ FullScreenPane::FullScreenPane ( sal_Int32 nScreenNumber = 1; ExtractArguments(rxPaneId, nScreenNumber); - if (mpWorkWindow.get() == nullptr) + if (!mpWorkWindow) return; // Create a new top-level window that is displayed full screen. diff --git a/sd/source/ui/presenter/PresenterHelper.cxx b/sd/source/ui/presenter/PresenterHelper.cxx index 66774bd1e5ef..912821982a97 100644 --- a/sd/source/ui/presenter/PresenterHelper.cxx +++ b/sd/source/ui/presenter/PresenterHelper.cxx @@ -392,7 +392,7 @@ Reference<rendering::XBitmap> SAL_CALL PresenterHelper::loadBitmap ( cppcanvas::BitmapSharedPtr xBitmap( cppcanvas::VCLFactory::createBitmap(pCanvas, aBitmapEx)); - if (xBitmap.get() == nullptr) + if (!xBitmap) return nullptr; return xBitmap->getUNOBitmap(); } diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx index af19e712c751..968f5dcf01f0 100644 --- a/sd/source/ui/sidebar/LayoutMenu.cxx +++ b/sd/source/ui/sidebar/LayoutMenu.cxx @@ -445,7 +445,7 @@ void LayoutMenu::AssignLayoutToSelectedSlides (AutoLayout aLayout) pPageSelection = pSlideSorter->GetPageSelection(); } - if( (pSlideSorter == nullptr) || (pPageSelection.get() == nullptr) || pPageSelection->empty() ) + if( (pSlideSorter == nullptr) || !pPageSelection || pPageSelection->empty() ) { // No valid slide sorter available. Ask the main view shell for // its current page. diff --git a/sd/source/ui/sidebar/MasterPageContainer.cxx b/sd/source/ui/sidebar/MasterPageContainer.cxx index 767c1e332133..ebdf2121447a 100644 --- a/sd/source/ui/sidebar/MasterPageContainer.cxx +++ b/sd/source/ui/sidebar/MasterPageContainer.cxx @@ -254,7 +254,7 @@ void MasterPageContainer::AcquireToken (Token aToken) void MasterPageContainer::ReleaseToken (Token aToken) { SharedMasterPageDescriptor pDescriptor = mpImpl->GetDescriptor(aToken); - if (pDescriptor.get() == nullptr) + if (!pDescriptor) return; OSL_ASSERT(pDescriptor->mnUseCount>0); @@ -885,7 +885,7 @@ void MasterPageContainer::Implementation::CleanContainer() // elements in the middle can not be removed because that would // invalidate the references still held by others. int nIndex (maContainer.size()-1); - while (nIndex>=0 && maContainer[nIndex].get()==nullptr) + while (nIndex>=0 && !maContainer[nIndex]) --nIndex; maContainer.resize(++nIndex); } diff --git a/sd/source/ui/sidebar/MasterPageDescriptor.cxx b/sd/source/ui/sidebar/MasterPageDescriptor.cxx index edd0dbb0811a..0e886023e620 100644 --- a/sd/source/ui/sidebar/MasterPageDescriptor.cxx +++ b/sd/source/ui/sidebar/MasterPageDescriptor.cxx @@ -268,7 +268,7 @@ MasterPageDescriptor::URLComparator::URLComparator (const OUString& sURL) bool MasterPageDescriptor::URLComparator::operator() ( const SharedMasterPageDescriptor& rDescriptor) { - if (rDescriptor.get() == nullptr) + if (!rDescriptor) return false; else return rDescriptor->msURL == msURL; @@ -284,7 +284,7 @@ MasterPageDescriptor::StyleNameComparator::StyleNameComparator (const OUString& bool MasterPageDescriptor::StyleNameComparator::operator() ( const SharedMasterPageDescriptor& rDescriptor) { - if (rDescriptor.get() == nullptr) + if (!rDescriptor) return false; else return rDescriptor->msStyleName == msStyleName; @@ -300,7 +300,7 @@ MasterPageDescriptor::PageObjectComparator::PageObjectComparator (const SdPage* bool MasterPageDescriptor::PageObjectComparator::operator() ( const SharedMasterPageDescriptor& rDescriptor) { - if (rDescriptor.get() == nullptr) + if (!rDescriptor) return false; else return rDescriptor->mpMasterPage==mpMasterPage; @@ -315,7 +315,7 @@ MasterPageDescriptor::AllComparator::AllComparator(const SharedMasterPageDescrip bool MasterPageDescriptor::AllComparator::operator() (const SharedMasterPageDescriptor&rDescriptor) { - if (rDescriptor.get() == nullptr) + if (!rDescriptor) return false; else { diff --git a/sd/source/ui/slidesorter/cache/SlsCacheConfiguration.cxx b/sd/source/ui/slidesorter/cache/SlsCacheConfiguration.cxx index f4f0a6c2e1c3..150791213b13 100644 --- a/sd/source/ui/slidesorter/cache/SlsCacheConfiguration.cxx +++ b/sd/source/ui/slidesorter/cache/SlsCacheConfiguration.cxx @@ -46,12 +46,12 @@ std::shared_ptr<CacheConfiguration> CacheConfiguration::Instance() { SolarMutexGuard aSolarGuard; CacheConfigSharedPtr &rInstancePtr = theInstance::get(); - if (rInstancePtr.get() == nullptr) + if (!rInstancePtr) { // Maybe somebody else kept a previously created instance alive. if ( ! mpWeakInstance.expired()) rInstancePtr = std::shared_ptr<CacheConfiguration>(mpWeakInstance); - if (rInstancePtr.get() == nullptr) + if (!rInstancePtr) { // We have to create a new instance. rInstancePtr.reset(new CacheConfiguration()); diff --git a/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx b/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx index 1d9970bb201b..538187cdfb8a 100644 --- a/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx @@ -121,7 +121,7 @@ void CurrentSlideManager::SwitchCurrentSlide ( const SharedPageDescriptor& rpDescriptor, const bool bUpdateSelection) { - if (rpDescriptor.get() == nullptr || mpCurrentSlide==rpDescriptor) + if (!rpDescriptor || mpCurrentSlide==rpDescriptor) return; ReleaseCurrentSlide(); diff --git a/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx b/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx index 60f0bd48d763..1c7be02427b8 100644 --- a/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx @@ -183,7 +183,7 @@ void FocusManager::ShowFocusIndicator ( const model::SharedPageDescriptor& rpDescriptor, const bool bScrollToFocus) { - if (rpDescriptor.get() == nullptr) + if (!rpDescriptor) return; mrSlideSorter.GetView().SetState(rpDescriptor, model::PageDescriptor::ST_Focused, true); diff --git a/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx b/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx index b9d428297c8a..df639ae41d48 100644 --- a/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx +++ b/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx @@ -139,7 +139,7 @@ void PageSelector::SelectPage (const SdPage* pPage) void PageSelector::SelectPage (const SharedPageDescriptor& rpDescriptor) { - if (rpDescriptor.get()==nullptr + if (!rpDescriptor || !mrSlideSorter.GetView().SetState(rpDescriptor, PageDescriptor::ST_Selected, true)) return; @@ -171,7 +171,7 @@ void PageSelector::DeselectPage ( const SharedPageDescriptor& rpDescriptor, const bool bUpdateCurrentPage) { - if (rpDescriptor.get()==nullptr + if (!rpDescriptor || !mrSlideSorter.GetView().SetState(rpDescriptor, PageDescriptor::ST_Selected, false)) return; diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx index 0bf400aad1f7..272403364abe 100644 --- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx @@ -1155,7 +1155,7 @@ void NormalModeHandler::RangeSelect (const model::SharedPageDescriptor& rpDescri model::SharedPageDescriptor pAnchor (rSelector.GetSelectionAnchor()); DeselectAllPages(); - if (pAnchor.get() == nullptr) + if (!pAnchor) return; // Select all pages between the anchor and the given one, including diff --git a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx index 4afc516a9b84..ccf933346167 100644 --- a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx +++ b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx @@ -221,7 +221,7 @@ sal_Int32 SlideSorterModel::GetIndex (const Reference<drawing::XDrawPage>& rxSli // Make sure that the descriptor exists. Without it the given slide // can not be found. - if (pDescriptor.get() == nullptr) + if (!pDescriptor) { // Call GetPageDescriptor() to create the missing descriptor. pDescriptor = GetPageDescriptor(nIndex); @@ -259,7 +259,7 @@ sal_Int32 SlideSorterModel::GetIndex (const SdrPage* pPage) const // Make sure that the descriptor exists. Without it the given slide // can not be found. - if (pDescriptor.get() == nullptr) + if (!pDescriptor) { // Call GetPageDescriptor() to create the missing descriptor. pDescriptor = GetPageDescriptor(nIndex); diff --git a/sd/source/ui/view/FormShellManager.cxx b/sd/source/ui/view/FormShellManager.cxx index 522efec6fcfd..d780b0c4e0d1 100644 --- a/sd/source/ui/view/FormShellManager.cxx +++ b/sd/source/ui/view/FormShellManager.cxx @@ -147,7 +147,7 @@ void FormShellManager::RegisterAtCenterPane() WindowEventHandler)); // Create a shell factory and with it activate the form shell. - OSL_ASSERT(mpSubShellFactory.get()==nullptr); + OSL_ASSERT(!mpSubShellFactory); mpSubShellFactory = std::make_shared<FormShellManagerFactory>(*pShell, *this); mrBase.GetViewShellManager()->AddSubShellFactory(pShell,mpSubShellFactory); mrBase.GetViewShellManager()->ActivateSubShell(*pShell, ToolbarId::FormLayer_Toolbox); diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 9ba96ff29a87..e1af322f88eb 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -767,7 +767,7 @@ void ViewShell::SetupRulers() long nHRulerOfs = 0; - if ( mpVerticalRuler.get() == nullptr ) + if ( !mpVerticalRuler ) { mpVerticalRuler.reset(CreateVRuler(GetActiveWindow())); if ( mpVerticalRuler ) @@ -777,7 +777,7 @@ void ViewShell::SetupRulers() mpVerticalRuler->Show(); } } - if ( mpHorizontalRuler.get() == nullptr ) + if ( !mpHorizontalRuler ) { mpHorizontalRuler.reset(CreateHRuler(GetActiveWindow())); if ( mpHorizontalRuler ) |