diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-06-02 10:40:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-06-03 10:51:57 +0200 |
commit | 054c0e7177cbef26942f8ca7cb7b1422ceea721c (patch) | |
tree | 7390a1be5ee0797b7f43d7d433822315fd75c6dd /sd | |
parent | 0f499af8c2c22ccc8f1c19edeeb2bdac8cbcb7f0 (diff) |
loplugin:simplifypointertobool improve
to look for the
x.get() != null
pattern, which can be simplified to
x
I'll do the
x.get() == nullptr
pattern in a separate patch, to reduce the chances of a mistake
Change-Id: I45e0d178e75359857cdf50d712039cb526016555
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95354
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
36 files changed, 157 insertions, 157 deletions
diff --git a/sd/source/core/EffectMigration.cxx b/sd/source/core/EffectMigration.cxx index 35bddcd3116e..58cf4c30b016 100644 --- a/sd/source/core/EffectMigration.cxx +++ b/sd/source/core/EffectMigration.cxx @@ -684,7 +684,7 @@ void EffectMigration::SetTextAnimationEffect( SvxShape* pShape, AnimationEffect } } - if( pGroup.get() != nullptr ) + if( pGroup ) { const bool bLaserEffect = (eEffect >= AnimationEffect_LASER_FROM_LEFT) && (eEffect <= AnimationEffect_LASER_FROM_LOWERRIGHT); diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx index e2c3816daa1b..a8c81225130b 100644 --- a/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx +++ b/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx @@ -421,7 +421,7 @@ SdPage* AccessibleSlideSorterObject::GetPage() const { ::sd::slidesorter::model::SharedPageDescriptor pDescriptor( mrSlideSorter.GetModel().GetPageDescriptor(mnPageNumber)); - if (pDescriptor.get() != nullptr) + if (pDescriptor) return pDescriptor->GetPage(); else return nullptr; diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx index 305f8abaa3d4..99f38b4d3d79 100644 --- a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx +++ b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx @@ -387,7 +387,7 @@ Reference<XAccessible> SAL_CALL const Point aTestPoint (aPoint.X, aPoint.Y); ::sd::slidesorter::model::SharedPageDescriptor pHitDescriptor ( mrSlideSorter.GetController().GetPageAt(aTestPoint)); - if (pHitDescriptor.get() != nullptr) + if (pHitDescriptor) xAccessible = mpImpl->GetAccessibleChild( (pHitDescriptor->GetPage()->GetPageNum()-1)/2); @@ -737,7 +737,7 @@ AccessibleSlideSorterObject* AccessibleSlideSorterView::Implementation::GetAcces { ::sd::slidesorter::model::SharedPageDescriptor pDescriptor( mrSlideSorter.GetModel().GetPageDescriptor(nIndex)); - if (pDescriptor.get() != nullptr) + if (pDescriptor) { maPageObjects[nIndex] = new AccessibleSlideSorterObject( &mrAccessibleSlideSorter, diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index 9444d21ed192..8eceb1c0c5a6 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -509,7 +509,7 @@ sal_Int8 CustomAnimationList::ExecuteDrop(const ExecuteDropEvent& rEvt) const bool bMovingEffect = ( mxDndEffectDragging != nullptr ); const bool bMoveNotSelf = !xDndEffectInsertBefore || (mxDndEffectDragging && mxTreeView->iter_compare(*xDndEffectInsertBefore, *mxDndEffectDragging) != 0); - const bool bHaveSequence = ( mpMainSequence.get() != nullptr ); + const bool bHaveSequence(mpMainSequence); if( bMovingEffect && bMoveNotSelf && bHaveSequence ) { diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index a55f93beecbc..8af4b358e074 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -2506,7 +2506,7 @@ void CustomAnimationPane::updatePathFromMotionPathTag( const rtl::Reference< Mot SdrPathObj* pPathObj = xTag->getPathObj(); CustomAnimationEffectPtr pEffect = xTag->getEffect(); - if( (pPathObj != nullptr) && pEffect.get() != nullptr ) + if( (pPathObj != nullptr) && pEffect ) { SfxUndoManager* pManager = mrBase.GetDocShell()->GetUndoManager(); if( pManager ) diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx index 60c77e0d0890..75cd52b55f39 100644 --- a/sd/source/ui/animations/motionpathtag.cxx +++ b/sd/source/ui/animations/motionpathtag.cxx @@ -399,7 +399,7 @@ void MotionPathTag::updatePathAttributes() void MotionPathTag::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) { - if( !(mpPathObj && !mbInUpdatePath && rHint.GetId() == SfxHintId::ThisIsAnSdrHint && (mpEffect.get() != nullptr)) ) + if( !(mpPathObj && !mbInUpdatePath && rHint.GetId() == SfxHintId::ThisIsAnSdrHint && mpEffect) ) return; if( mxPolyPoly != mpPathObj->GetPathPoly() ) diff --git a/sd/source/ui/framework/factories/FullScreenPane.cxx b/sd/source/ui/framework/factories/FullScreenPane.cxx index 03f8afb3b21a..fd32ba6c9026 100644 --- a/sd/source/ui/framework/factories/FullScreenPane.cxx +++ b/sd/source/ui/framework/factories/FullScreenPane.cxx @@ -100,7 +100,7 @@ void SAL_CALL FullScreenPane::disposing() { mpWindow.disposeAndClear(); - if (mpWorkWindow.get() != nullptr) + if (mpWorkWindow) { Link<VclWindowEvent&,void> aWindowEventHandler (LINK(this, FullScreenPane, WindowEventHandler)); mpWorkWindow->RemoveEventListener(aWindowEventHandler); diff --git a/sd/source/ui/framework/factories/Pane.cxx b/sd/source/ui/framework/factories/Pane.cxx index 6ca637ea6694..631cc072edb3 100644 --- a/sd/source/ui/framework/factories/Pane.cxx +++ b/sd/source/ui/framework/factories/Pane.cxx @@ -168,7 +168,7 @@ Reference<rendering::XCanvas> Pane::CreateCanvas() { ::cppcanvas::SpriteCanvasSharedPtr pCanvas ( cppcanvas::VCLFactory::createSpriteCanvas(*mpWindow)); - if (pCanvas.get() != nullptr) + if (pCanvas) xCanvas.set(pCanvas->getUNOSpriteCanvas()); } diff --git a/sd/source/ui/presenter/PresenterHelper.cxx b/sd/source/ui/presenter/PresenterHelper.cxx index 4fce3397eae0..66774bd1e5ef 100644 --- a/sd/source/ui/presenter/PresenterHelper.cxx +++ b/sd/source/ui/presenter/PresenterHelper.cxx @@ -82,7 +82,7 @@ Reference<awt::XWindow> SAL_CALL PresenterHelper::createWindow ( { // Make the frame window transparent and make the parent able to // draw behind it. - if (pParentWindow.get() != nullptr) + if (pParentWindow) pParentWindow->EnableChildTransparentMode(); } @@ -386,7 +386,7 @@ Reference<rendering::XBitmap> SAL_CALL PresenterHelper::loadBitmap ( const cppcanvas::CanvasSharedPtr pCanvas ( cppcanvas::VCLFactory::createCanvas(rxCanvas)); - if (pCanvas.get() != nullptr) + if (pCanvas) { BitmapEx aBitmapEx(bmpid); cppcanvas::BitmapSharedPtr xBitmap( diff --git a/sd/source/ui/presenter/SlideRenderer.cxx b/sd/source/ui/presenter/SlideRenderer.cxx index bb4a75209767..f8281e6319bb 100644 --- a/sd/source/ui/presenter/SlideRenderer.cxx +++ b/sd/source/ui/presenter/SlideRenderer.cxx @@ -98,7 +98,7 @@ Reference<rendering::XBitmap> SlideRenderer::createPreviewForCanvas ( cppcanvas::CanvasSharedPtr pCanvas ( cppcanvas::VCLFactory::createCanvas(rxCanvas)); - if (pCanvas.get() != nullptr) + if (pCanvas) return cppcanvas::VCLFactory::createBitmap( pCanvas, CreatePreview(rxSlide, rMaximalSize, nSuperSampleFactor))->getUNOBitmap(); diff --git a/sd/source/ui/sidebar/MasterPageContainer.cxx b/sd/source/ui/sidebar/MasterPageContainer.cxx index 21fb595e9624..767c1e332133 100644 --- a/sd/source/ui/sidebar/MasterPageContainer.cxx +++ b/sd/source/ui/sidebar/MasterPageContainer.cxx @@ -245,7 +245,7 @@ MasterPageContainer::Token MasterPageContainer::PutMasterPage ( void MasterPageContainer::AcquireToken (Token aToken) { SharedMasterPageDescriptor pDescriptor = mpImpl->GetDescriptor(aToken); - if (pDescriptor.get() != nullptr) + if (pDescriptor) { ++pDescriptor->mnUseCount; } @@ -361,7 +361,7 @@ OUString MasterPageContainer::GetURLForToken ( const ::osl::MutexGuard aGuard (mpImpl->maMutex); SharedMasterPageDescriptor pDescriptor = mpImpl->GetDescriptor(aToken); - if (pDescriptor.get() != nullptr) + if (pDescriptor) return pDescriptor->msURL; else return OUString(); @@ -373,7 +373,7 @@ OUString MasterPageContainer::GetPageNameForToken ( const ::osl::MutexGuard aGuard (mpImpl->maMutex); SharedMasterPageDescriptor pDescriptor = mpImpl->GetDescriptor(aToken); - if (pDescriptor.get() != nullptr) + if (pDescriptor) return pDescriptor->msPageName; else return OUString(); @@ -385,7 +385,7 @@ OUString MasterPageContainer::GetStyleNameForToken ( const ::osl::MutexGuard aGuard (mpImpl->maMutex); SharedMasterPageDescriptor pDescriptor = mpImpl->GetDescriptor(aToken); - if (pDescriptor.get() != nullptr) + if (pDescriptor) return pDescriptor->msStyleName; else return OUString(); @@ -399,7 +399,7 @@ SdPage* MasterPageContainer::GetPageObjectForToken ( SdPage* pPageObject = nullptr; SharedMasterPageDescriptor pDescriptor = mpImpl->GetDescriptor(aToken); - if (pDescriptor.get() != nullptr) + if (pDescriptor) { pPageObject = pDescriptor->mpMasterPage; if (pPageObject == nullptr) @@ -421,7 +421,7 @@ MasterPageContainer::Origin MasterPageContainer::GetOriginForToken (Token aToken const ::osl::MutexGuard aGuard (mpImpl->maMutex); SharedMasterPageDescriptor pDescriptor = mpImpl->GetDescriptor(aToken); - if (pDescriptor.get() != nullptr) + if (pDescriptor) return pDescriptor->meOrigin; else return UNKNOWN; @@ -432,7 +432,7 @@ sal_Int32 MasterPageContainer::GetTemplateIndexForToken (Token aToken) const ::osl::MutexGuard aGuard (mpImpl->maMutex); SharedMasterPageDescriptor pDescriptor = mpImpl->GetDescriptor(aToken); - if (pDescriptor.get() != nullptr) + if (pDescriptor) return pDescriptor->mnTemplateIndex; else return -1; @@ -675,7 +675,7 @@ bool MasterPageContainer::Implementation::HasToken (Token aToken) const { return aToken>=0 && o3tl::make_unsigned(aToken)<maContainer.size() - && maContainer[aToken].get()!=nullptr; + && maContainer[aToken]; } SharedMasterPageDescriptor MasterPageContainer::Implementation::GetDescriptor (Token aToken) const @@ -691,7 +691,7 @@ void MasterPageContainer::Implementation::InvalidatePreview (Token aToken) const ::osl::MutexGuard aGuard (maMutex); SharedMasterPageDescriptor pDescriptor (GetDescriptor(aToken)); - if (pDescriptor.get() != nullptr) + if (pDescriptor) { pDescriptor->maSmallPreview = Image(); pDescriptor->maLargePreview = Image(); @@ -712,7 +712,7 @@ Image MasterPageContainer::Implementation::GetPreviewForToken ( // When the preview is missing but inexpensively creatable then do that // now. - if (pDescriptor.get()!=nullptr) + if (pDescriptor) { if (ePreviewState == PS_CREATABLE) if (UpdateDescriptor(pDescriptor, false,false, true)) @@ -760,7 +760,7 @@ MasterPageContainer::PreviewState MasterPageContainer::Implementation::GetPrevie PreviewState eState (PS_NOT_AVAILABLE); SharedMasterPageDescriptor pDescriptor = GetDescriptor(aToken); - if (pDescriptor.get() != nullptr) + if (pDescriptor) { if (pDescriptor->maLargePreview.GetSizePixel().Width() != 0) eState = PS_AVAILABLE; @@ -783,7 +783,7 @@ MasterPageContainer::PreviewState MasterPageContainer::Implementation::GetPrevie bool MasterPageContainer::Implementation::RequestPreview (Token aToken) { SharedMasterPageDescriptor pDescriptor = GetDescriptor(aToken); - if (pDescriptor.get() != nullptr) + if (pDescriptor) return mpRequestQueue->RequestPreview(pDescriptor); else return false; diff --git a/sd/source/ui/sidebar/MasterPageContainerQueue.cxx b/sd/source/ui/sidebar/MasterPageContainerQueue.cxx index 417702dd909d..b1067c9a6bee 100644 --- a/sd/source/ui/sidebar/MasterPageContainerQueue.cxx +++ b/sd/source/ui/sidebar/MasterPageContainerQueue.cxx @@ -117,7 +117,7 @@ void MasterPageContainerQueue::LateInit() bool MasterPageContainerQueue::RequestPreview (const SharedMasterPageDescriptor& rpDescriptor) { bool bSuccess (false); - if (rpDescriptor.get() != nullptr + if (rpDescriptor && rpDescriptor->maLargePreview.GetSizePixel().Width() == 0) { sal_Int32 nPriority (CalculatePriority(rpDescriptor)); @@ -215,7 +215,7 @@ IMPL_LINK(MasterPageContainerQueue, DelayedPreviewCreation, Timer*, pTimer, void mpRequestQueue->erase(mpRequestQueue->begin()); - if (aRequest.mpDescriptor.get() != nullptr) + if (aRequest.mpDescriptor) { mnRequestsServedCount += 1; if ( ! mpWeakContainer.expired()) diff --git a/sd/source/ui/sidebar/PanelBase.cxx b/sd/source/ui/sidebar/PanelBase.cxx index 061d4ea3f3bb..70a20ea4e017 100644 --- a/sd/source/ui/sidebar/PanelBase.cxx +++ b/sd/source/ui/sidebar/PanelBase.cxx @@ -69,7 +69,7 @@ bool PanelBase::ProvideWrappedControl() if (mpWrappedControl) mpWrappedControl->Show(); } - return mpWrappedControl.get() != nullptr; + return bool(mpWrappedControl); } ISidebarReceiver::~ISidebarReceiver() diff --git a/sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx b/sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx index ec0c2a3d22e2..d3fba2087432 100644 --- a/sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx +++ b/sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx @@ -100,7 +100,7 @@ IMPL_LINK_NOARG(QueueProcessor, ProcessRequestHdl, Timer *, void) void QueueProcessor::ProcessRequests() { - assert(mpCacheContext.get()!=nullptr); + assert(mpCacheContext); // Never process more than one request at a time in order to prevent the // lock up of the edit view. @@ -147,7 +147,7 @@ void QueueProcessor::ProcessOneRequest ( ::osl::MutexGuard aGuard (maMutex); // Create a new preview bitmap and store it in the cache. - if (mpCache != nullptr && mpCacheContext.get() != nullptr) + if (mpCache != nullptr && mpCacheContext) { const SdPage* pSdPage = dynamic_cast<const SdPage*>(mpCacheContext->GetPage(aKey)); if (pSdPage != nullptr) diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx index 638b405bdd09..2588124b867c 100644 --- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx +++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx @@ -346,7 +346,7 @@ bool SlideSorterController::Command ( // focused page as top left position of the context menu. model::SharedPageDescriptor pDescriptor ( GetFocusManager().GetFocusedPageDescriptor()); - if (pDescriptor.get() != nullptr) + if (pDescriptor) { ::tools::Rectangle aBBox ( mrView.GetLayouter().GetPageObjectLayouter()->GetBoundingBox ( @@ -803,7 +803,7 @@ void SlideSorterController::PageNameHasChanged (int nPageIndex, const OUString& { // Request a repaint for the page object whose name has changed. model::SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nPageIndex)); - if (pDescriptor.get() != nullptr) + if (pDescriptor) mrView.RequestRepaint(pDescriptor); // Get a pointer to the corresponding accessible object and notify diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx index 7b08dd24b1ff..c45e782be567 100644 --- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx +++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx @@ -353,7 +353,7 @@ void Clipboard::SelectPageRange (sal_Int32 nFirstIndex, sal_Int32 nPageCount) { model::SharedPageDescriptor pDescriptor ( mrSlideSorter.GetModel().GetPageDescriptor(nFirstIndex + i)); - if (pDescriptor.get() != nullptr) + if (pDescriptor) { rSelector.SelectPage(pDescriptor); // The first page of the new selection is made the current page. diff --git a/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx b/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx index 8ae3afdad243..1d9970bb201b 100644 --- a/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx @@ -88,7 +88,7 @@ void CurrentSlideManager::NotifyCurrentSlideChange (const sal_Int32 nSlideIndex) void CurrentSlideManager::ReleaseCurrentSlide() { - if (mpCurrentSlide.get() != nullptr) + if (mpCurrentSlide) mrSlideSorter.GetView().SetState(mpCurrentSlide, PageDescriptor::ST_Current, false); mpCurrentSlide.reset(); @@ -106,7 +106,7 @@ void CurrentSlideManager::AcquireCurrentSlide (const sal_Int32 nSlideIndex) // given XDrawPage may or may not be member of the slide sorter // document. mpCurrentSlide = mrSlideSorter.GetModel().GetPageDescriptor(mnCurrentSlideIndex); - if (mpCurrentSlide.get() != nullptr) + if (mpCurrentSlide) mrSlideSorter.GetView().SetState(mpCurrentSlide, PageDescriptor::ST_Current, true); } } @@ -163,7 +163,7 @@ void CurrentSlideManager::SwitchCurrentSlide ( void CurrentSlideManager::SetCurrentSlideAtViewShellBase (const SharedPageDescriptor& rpDescriptor) { - OSL_ASSERT(rpDescriptor.get() != nullptr); + OSL_ASSERT(rpDescriptor); ViewShellBase* pBase = mrSlideSorter.GetViewShellBase(); if (pBase != nullptr) @@ -182,7 +182,7 @@ void CurrentSlideManager::SetCurrentSlideAtViewShellBase (const SharedPageDescri void CurrentSlideManager::SetCurrentSlideAtTabControl (const SharedPageDescriptor& rpDescriptor) { - OSL_ASSERT(rpDescriptor.get() != nullptr); + OSL_ASSERT(rpDescriptor); ViewShellBase* pBase = mrSlideSorter.GetViewShellBase(); if (pBase != nullptr) @@ -200,7 +200,7 @@ void CurrentSlideManager::SetCurrentSlideAtTabControl (const SharedPageDescripto void CurrentSlideManager::SetCurrentSlideAtXController (const SharedPageDescriptor& rpDescriptor) { - OSL_ASSERT(rpDescriptor.get() != nullptr); + OSL_ASSERT(rpDescriptor); try { @@ -230,7 +230,7 @@ void CurrentSlideManager::HandleModelChange() if (mnCurrentSlideIndex >= 0) { mpCurrentSlide = mrSlideSorter.GetModel().GetPageDescriptor(mnCurrentSlideIndex); - if (mpCurrentSlide.get() != nullptr) + if (mpCurrentSlide) mrSlideSorter.GetView().SetState(mpCurrentSlide, PageDescriptor::ST_Current, true); } } diff --git a/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx b/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx index 0169bff7fbdc..60f0bd48d763 100644 --- a/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx @@ -143,7 +143,7 @@ model::SharedPageDescriptor FocusManager::GetFocusedPageDescriptor() const bool FocusManager::SetFocusedPage (const model::SharedPageDescriptor& rpDescriptor) { - if (rpDescriptor.get() != nullptr) + if (rpDescriptor) { FocusHider aFocusHider (*this); mnPageIndex = (rpDescriptor->GetPage()->GetPageNum()-1)/2; @@ -170,7 +170,7 @@ bool FocusManager::IsFocusShowing() const void FocusManager::HideFocusIndicator (const model::SharedPageDescriptor& rpDescriptor) { - if (rpDescriptor.get() != nullptr) + if (rpDescriptor) { mrSlideSorter.GetView().SetState(rpDescriptor, model::PageDescriptor::ST_Focused, false); diff --git a/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx b/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx index f3aa7ad19edd..b9d428297c8a 100644 --- a/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx +++ b/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx @@ -125,7 +125,7 @@ void PageSelector::SetCoreSelection() void PageSelector::SelectPage (int nPageIndex) { SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nPageIndex)); - if (pDescriptor.get() != nullptr) + if (pDescriptor) SelectPage(pDescriptor); } @@ -133,7 +133,7 @@ void PageSelector::SelectPage (const SdPage* pPage) { const sal_Int32 nPageIndex (mrModel.GetIndex(pPage)); SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nPageIndex)); - if (pDescriptor.get()!=nullptr && pDescriptor->GetPage()==pPage) + if (pDescriptor && pDescriptor->GetPage()==pPage) SelectPage(pDescriptor); } @@ -163,7 +163,7 @@ void PageSelector::SelectPage (const SharedPageDescriptor& rpDescriptor) void PageSelector::DeselectPage (int nPageIndex) { model::SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nPageIndex)); - if (pDescriptor.get() != nullptr) + if (pDescriptor) DeselectPage(pDescriptor); } @@ -213,7 +213,7 @@ void PageSelector::CheckConsistency() const bool PageSelector::IsPageSelected(int nPageIndex) { SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nPageIndex)); - if (pDescriptor.get() != nullptr) + if (pDescriptor) return pDescriptor->HasState(PageDescriptor::ST_Selected); else return false; @@ -222,7 +222,7 @@ bool PageSelector::IsPageSelected(int nPageIndex) bool PageSelector::IsPageVisible(int nPageIndex) { SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nPageIndex)); - if (pDescriptor.get() != nullptr) + if (pDescriptor) return pDescriptor->HasState(PageDescriptor::ST_Visible); else return false; @@ -270,7 +270,7 @@ std::shared_ptr<PageSelector::PageSelection> PageSelector::GetPageSelection() co for (int nIndex=0; nIndex<nPageCount; nIndex++) { SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nIndex)); - if (pDescriptor.get()!=nullptr && pDescriptor->HasState(PageDescriptor::ST_Selected)) + if (pDescriptor && pDescriptor->HasState(PageDescriptor::ST_Selected)) pSelection->push_back(pDescriptor->GetPage()); } diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx index 1efdd922277a..0bf400aad1f7 100644 --- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx @@ -588,7 +588,7 @@ void SelectionFunction::GotoNextPage (int nOffset) { model::SharedPageDescriptor pDescriptor = mrController.GetCurrentSlideManager()->GetCurrentSlide(); - if (pDescriptor.get() != nullptr) + if (pDescriptor) { SdPage* pPage = pDescriptor->GetPage(); OSL_ASSERT(pPage!=nullptr); @@ -610,11 +610,11 @@ void SelectionFunction::GotoPage (int nIndex) mrController.GetFocusManager().SetFocusedPage(nIndex); model::SharedPageDescriptor pNextPageDescriptor ( mrSlideSorter.GetModel().GetPageDescriptor (nIndex)); - if (pNextPageDescriptor.get() != nullptr) + if (pNextPageDescriptor) mpModeHandler->SetCurrentPage(pNextPageDescriptor); else { - OSL_ASSERT(pNextPageDescriptor.get() != nullptr); + OSL_ASSERT(pNextPageDescriptor); } ResetShiftKeySelectionAnchor(); } @@ -930,7 +930,7 @@ void SelectionFunction::ModeHandler::SwitchView (const model::SharedPageDescript if (pViewShell==nullptr || !pViewShell->IsMainViewShell()) return; - if (rpDescriptor.get()!=nullptr && rpDescriptor->GetPage()!=nullptr) + if (rpDescriptor && rpDescriptor->GetPage()!=nullptr) { mrSlideSorter.GetModel().GetDocument()->SetSelected(rpDescriptor->GetPage(), true); pViewShell->GetFrameView()->SetSelectedPage( diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx index d8f8207aaf69..4847ff3114bd 100644 --- a/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx @@ -231,7 +231,7 @@ void SelectionManager::SelectionHasChanged () OSL_ASSERT(mrController.GetCurrentSlideManager()); SharedPageDescriptor pDescriptor(mrController.GetCurrentSlideManager()->GetCurrentSlide()); - if (pDescriptor.get() != nullptr) + if (pDescriptor) pViewShell->UpdatePreview(pDescriptor->GetPage()); // Tell the selection change listeners that the selection has changed. diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx index 27febd5dde42..bb8814fb6fa7 100644 --- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx @@ -952,7 +952,7 @@ IMPL_LINK(SlotManager, RenameSlideHdl, AbstractSvxNameDialog&, rDialog, bool) model::SharedPageDescriptor pDescriptor ( mrSlideSorter.GetController().GetCurrentSlideManager()->GetCurrentSlide()); SdPage* pCurrentPage = nullptr; - if (pDescriptor.get() != nullptr) + if (pDescriptor) pCurrentPage = pDescriptor->GetPage(); return (pCurrentPage!=nullptr && aNewName == pCurrentPage->GetName()) @@ -980,7 +980,7 @@ bool SlotManager::RenameSlideFromDrawViewShell( sal_uInt16 nPageId, const OUStri { model::SharedPageDescriptor pDescriptor ( mrSlideSorter.GetController().GetCurrentSlideManager()->GetCurrentSlide()); - if (pDescriptor.get() != nullptr) + if (pDescriptor) pPageToRename = pDescriptor->GetPage(); if (pPageToRename != nullptr) diff --git a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx index 0fe7fbdcbcaf..4afc516a9b84 100644 --- a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx +++ b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx @@ -200,7 +200,7 @@ sal_Int32 SlideSorterModel::GetIndex (const Reference<drawing::XDrawPage>& rxSli aNumber >>= nNumber; nNumber -= 1; SharedPageDescriptor pDescriptor (GetPageDescriptor(nNumber, false)); - if (pDescriptor.get() != nullptr + if (pDescriptor && pDescriptor->GetXDrawPage() == rxSlide) { return nNumber; @@ -244,7 +244,7 @@ sal_Int32 SlideSorterModel::GetIndex (const SdrPage* pPage) const // First try to guess the right index. sal_Int16 nNumber ((pPage->GetPageNum()-1)/2); SharedPageDescriptor pDescriptor (GetPageDescriptor(nNumber, false)); - if (pDescriptor.get() != nullptr + if (pDescriptor && pDescriptor->GetPage() == pPage) { return nNumber; diff --git a/sd/source/ui/slidesorter/model/SlsPageEnumeration.cxx b/sd/source/ui/slidesorter/model/SlsPageEnumeration.cxx index f434d8c5270d..a67f057e7e19 100644 --- a/sd/source/ui/slidesorter/model/SlsPageEnumeration.cxx +++ b/sd/source/ui/slidesorter/model/SlsPageEnumeration.cxx @@ -184,7 +184,7 @@ void PageEnumerationImpl::AdvanceToNextValidElement() SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(mnIndex)); // Test for the predicate being fulfilled. - if (pDescriptor.get()!=nullptr && maPredicate(pDescriptor)) + if (pDescriptor && maPredicate(pDescriptor)) { // This predicate is valid. break; diff --git a/sd/source/ui/slidesorter/shell/SlideSorter.cxx b/sd/source/ui/slidesorter/shell/SlideSorter.cxx index a0ef078f9953..5d933dcd379f 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorter.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorter.cxx @@ -208,19 +208,19 @@ SlideSorter::~SlideSorter() model::SlideSorterModel& SlideSorter::GetModel() const { - assert(mpSlideSorterModel.get()!=nullptr); + assert(mpSlideSorterModel); return *mpSlideSorterModel; } view::SlideSorterView& SlideSorter::GetView() const { - assert(mpSlideSorterView.get()!=nullptr); + assert(mpSlideSorterView); return *mpSlideSorterView; } controller::SlideSorterController& SlideSorter::GetController() const { - assert(mpSlideSorterController.get()!=nullptr); + assert(mpSlideSorterController); return *mpSlideSorterController; } @@ -364,7 +364,7 @@ void SlideSorter::RelocateToWindow (vcl::Window* pParentWindow) // view shell. (One is created earlier while the constructor of the base // class is executed. But because at that time the correct // accessibility object can not be constructed we do that now.) - if (mpContentWindow.get() !=nullptr) + if (mpContentWindow) { mpContentWindow->Hide(); mpContentWindow->Show(); diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index aae9af937627..4836ba3dd1b5 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -182,7 +182,7 @@ void SlideSorterViewShell::Init (bool bIsMainViewShell) pActiveWindow->Show(); mpSlideSorter->GetModel().UpdatePageList(); - if (mpContentWindow.get() != nullptr) + if (mpContentWindow) mpContentWindow->SetViewShell(this); } @@ -239,7 +239,7 @@ css::uno::Reference<css::accessibility::XAccessible> if (mpView == nullptr || mpSlideSorter == nullptr) return nullptr; - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); ::accessibility::AccessibleSlideSorterView *pAccessibleView = new ::accessibility::AccessibleSlideSorterView( @@ -267,7 +267,7 @@ void SlideSorterViewShell::SwitchViewFireFocus(const css::uno::Reference< css::a SlideSorter& SlideSorterViewShell::GetSlideSorter() const { - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); return *mpSlideSorter; } @@ -326,7 +326,7 @@ SdPage* SlideSorterViewShell::GetActualPage() { model::SharedPageDescriptor pDescriptor ( mpSlideSorter->GetController().GetCurrentSlideManager()->GetCurrentSlide()); - if (pDescriptor.get() != nullptr) + if (pDescriptor) pCurrentPage = pDescriptor->GetPage(); } @@ -336,32 +336,32 @@ SdPage* SlideSorterViewShell::GetActualPage() void SlideSorterViewShell::GetMenuState ( SfxItemSet& rSet) { ViewShell::GetMenuState(rSet); - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); mpSlideSorter->GetController().GetSlotManager()->GetMenuState(rSet); } void SlideSorterViewShell::GetClipboardState ( SfxItemSet& rSet) { ViewShell::GetMenuState(rSet); - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); mpSlideSorter->GetController().GetSlotManager()->GetClipboardState(rSet); } void SlideSorterViewShell::ExecCtrl (SfxRequest& rRequest) { - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); mpSlideSorter->GetController().ExecCtrl(rRequest); } void SlideSorterViewShell::GetCtrlState (SfxItemSet& rSet) { - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); mpSlideSorter->GetController().GetCtrlState(rSet); } void SlideSorterViewShell::FuSupport (SfxRequest& rRequest) { - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); mpSlideSorter->GetController().FuSupport(rRequest); } @@ -370,7 +370,7 @@ void SlideSorterViewShell::FuSupport (SfxRequest& rRequest) */ void SlideSorterViewShell::FuTemporary (SfxRequest& rRequest) { - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); switch (rRequest.GetSlot()) { case SID_MODIFYPAGE: @@ -394,19 +394,19 @@ void SlideSorterViewShell::FuTemporary (SfxRequest& rRequest) void SlideSorterViewShell::GetStatusBarState (SfxItemSet& rSet) { - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); mpSlideSorter->GetController().GetStatusBarState(rSet); } void SlideSorterViewShell::FuPermanent (SfxRequest& rRequest) { - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); mpSlideSorter->GetController().FuPermanent(rRequest); } void SlideSorterViewShell::GetAttrState (SfxItemSet& rSet) { - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); mpSlideSorter->GetController().GetAttrState(rSet); } @@ -428,7 +428,7 @@ void SlideSorterViewShell::ArrangeGUIElements() { if (IsActive()) { - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); mpSlideSorter->ArrangeGUIElements(maViewPos, maViewSize); mbIsArrangeGUIElementsPending = false; } @@ -482,14 +482,14 @@ void SlideSorterViewShell::Command ( const CommandEvent& rEvent, ::sd::Window* pWindow) { - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); if ( ! mpSlideSorter->GetController().Command (rEvent, pWindow)) ViewShell::Command (rEvent, pWindow); } void SlideSorterViewShell::ReadFrameViewData (FrameView* pFrameView) { - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); if (pFrameView != nullptr) { view::SlideSorterView& rView (mpSlideSorter->GetView()); @@ -525,7 +525,7 @@ void SlideSorterViewShell::ReadFrameViewData (FrameView* pFrameView) void SlideSorterViewShell::WriteFrameViewData() { - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); if (mpFrameView == nullptr) return; @@ -563,7 +563,7 @@ void SlideSorterViewShell::SetZoom (long int ) void SlideSorterViewShell::SetZoomRect (const ::tools::Rectangle& rZoomRect) { - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); Size aPageSize (mpSlideSorter->GetView().GetLayouter().GetPageObjectSize()); ::tools::Rectangle aRect(rZoomRect); @@ -611,7 +611,7 @@ void SlideSorterViewShell::StartDrag ( const Point& rDragPt, vcl::Window* pWindow ) { - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); mpSlideSorter->GetController().GetClipboard().StartDrag ( rDragPt, pWindow); @@ -624,7 +624,7 @@ sal_Int8 SlideSorterViewShell::AcceptDrop ( sal_uInt16 nPage, SdrLayerID nLayer) { - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); return mpSlideSorter->GetController().GetClipboard().AcceptDrop ( rEvt, rTargetHelper, @@ -640,7 +640,7 @@ sal_Int8 SlideSorterViewShell::ExecuteDrop ( sal_uInt16 nPage, SdrLayerID nLayer) { - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); return mpSlideSorter->GetController().GetClipboard().ExecuteDrop ( rEvt, rTargetHelper, @@ -652,28 +652,28 @@ sal_Int8 SlideSorterViewShell::ExecuteDrop ( std::shared_ptr<SlideSorterViewShell::PageSelection> SlideSorterViewShell::GetPageSelection() const { - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); return mpSlideSorter->GetController().GetPageSelector().GetPageSelection(); } void SlideSorterViewShell::SetPageSelection ( const std::shared_ptr<PageSelection>& rSelection) { - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); mpSlideSorter->GetController().GetPageSelector().SetPageSelection(rSelection, true); } void SlideSorterViewShell::AddSelectionChangeListener ( const Link<LinkParamNone*,void>& rCallback) { - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); mpSlideSorter->GetController().GetSelectionManager()->AddSelectionChangeListener(rCallback); } void SlideSorterViewShell::RemoveSelectionChangeListener ( const Link<LinkParamNone*,void>& rCallback) { - assert(mpSlideSorter.get()!=nullptr); + assert(mpSlideSorter); mpSlideSorter->GetController().GetSelectionManager()->RemoveSelectionChangeListener(rCallback); } diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx index 6b090fbe5f5a..46f1c00435ce 100644 --- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx +++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx @@ -445,7 +445,7 @@ void SlideSorterView::DeterminePageObjectVisibilities() for (long nIndex=aUnion.Min(); nIndex<=aUnion.Max(); nIndex++) { pDescriptor = mrModel.GetPageDescriptor(nIndex); - if (pDescriptor.get() != nullptr) + if (pDescriptor) SetState( pDescriptor, PageDescriptor::ST_Visible, @@ -484,7 +484,7 @@ void SlideSorterView::UpdatePreciousFlags() for (int nIndex=0; nIndex<=nPageCount; ++nIndex) { pDescriptor = mrModel.GetPageDescriptor(nIndex); - if (pDescriptor.get() != nullptr) + if (pDescriptor) { pCache->SetPreciousFlag( pDescriptor->GetPage(), diff --git a/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx b/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx index 96e0c4d57b40..ce27cec28dc3 100644 --- a/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx +++ b/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx @@ -45,7 +45,7 @@ ViewCacheContext::~ViewCacheContext() void ViewCacheContext::NotifyPreviewCreation(cache::CacheKey aKey) { const model::SharedPageDescriptor pDescriptor (GetDescriptor(aKey)); - if (pDescriptor.get() != nullptr) + if (pDescriptor) { // Force a repaint that will trigger their re-creation. mrSlideSorter.GetView().RequestRepaint(pDescriptor); diff --git a/sd/source/ui/view/FormShellManager.cxx b/sd/source/ui/view/FormShellManager.cxx index 9b4ff79b717b..522efec6fcfd 100644 --- a/sd/source/ui/view/FormShellManager.cxx +++ b/sd/source/ui/view/FormShellManager.cxx @@ -73,7 +73,7 @@ FormShellManager::~FormShellManager() Link<sd::tools::EventMultiplexerEvent&,void> aLink (LINK(this, FormShellManager, ConfigurationUpdateHandler)); mrBase.GetEventMultiplexer()->RemoveEventListener(aLink); - if (mpSubShellFactory.get() != nullptr) + if (mpSubShellFactory) { ViewShell* pShell = mrBase.GetMainViewShell().get(); if (pShell != nullptr) diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index c4b4c208a8bb..df1091cced75 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -266,7 +266,7 @@ ViewShellBase::~ViewShellBase() xSlideShow.clear(); // Tell the controller that the ViewShellBase is not available anymore. - if (mpImpl->mpController.get() != nullptr) + if (mpImpl->mpController) mpImpl->mpController->ReleaseViewShellBase(); // We have to hide the main window to prevent SFX complaining after a diff --git a/sd/source/ui/view/ViewShellManager.cxx b/sd/source/ui/view/ViewShellManager.cxx index eb9b0ff40a27..3b9308d8c5f0 100644 --- a/sd/source/ui/view/ViewShellManager.cxx +++ b/sd/source/ui/view/ViewShellManager.cxx @@ -1017,14 +1017,14 @@ void ViewShellManager::Implementation::DestroyViewShell ( maShellFactories.erase(aRange.first, aRange.second); // Release the shell. - if (rDescriptor.mpFactory.get() != nullptr) + if (rDescriptor.mpFactory) rDescriptor.mpFactory->ReleaseShell(rDescriptor.mpShell); } void ViewShellManager::Implementation::DestroySubShell ( const ShellDescriptor& rDescriptor) { - OSL_ASSERT(rDescriptor.mpFactory.get() != nullptr); + OSL_ASSERT(rDescriptor.mpFactory); rDescriptor.mpFactory->ReleaseShell(rDescriptor.mpShell); } diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index afe8b0f9d9fa..c99163f62817 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -575,7 +575,7 @@ void DrawViewShell::UpdateHRuler() Invalidate( SID_RULER_OBJECT ); Invalidate( SID_RULER_TEXT_RIGHT_TO_LEFT ); - if (mpHorizontalRuler.get() != nullptr) + if (mpHorizontalRuler) mpHorizontalRuler->ForceUpdate(); } @@ -589,7 +589,7 @@ void DrawViewShell::UpdateVRuler() Invalidate( SID_RULER_PAGE_POS ); Invalidate( SID_RULER_OBJECT ); - if (mpVerticalRuler.get() != nullptr) + if (mpVerticalRuler) mpVerticalRuler->ForceUpdate(); } diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index e88e8683ae3f..9839d3d799e5 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -310,7 +310,7 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin) { bool bInsideOtherWindow = false; - if (mpContentWindow.get() != nullptr) + if (mpContentWindow) { aOutputArea = ::tools::Rectangle(Point(0,0), mpContentWindow->GetOutputSizePixel()); @@ -791,19 +791,19 @@ void DrawViewShell::ShowMousePosInfo(const ::tools::Rectangle& rRect, long nVOffs = 0; sal_uInt16 nCnt; - if (mpHorizontalRuler.get() != nullptr) + if (mpHorizontalRuler) mpHorizontalRuler->SetLines(); - if (mpVerticalRuler.get() != nullptr) + if (mpVerticalRuler) mpVerticalRuler->SetLines(); - if (mpHorizontalRuler.get() != nullptr) + if (mpHorizontalRuler) { nHOffs = mpHorizontalRuler->GetNullOffset() + mpHorizontalRuler->GetPageOffset(); } - if (mpVerticalRuler.get() != nullptr) + if (mpVerticalRuler) { nVOffs = mpVerticalRuler->GetNullOffset() + mpVerticalRuler->GetPageOffset(); @@ -820,9 +820,9 @@ void DrawViewShell::ShowMousePosInfo(const ::tools::Rectangle& rRect, nCnt++; } - if (mpHorizontalRuler.get() != nullptr) + if (mpHorizontalRuler) mpHorizontalRuler->SetLines(nCnt, pHLines); - if (mpVerticalRuler.get() != nullptr) + if (mpVerticalRuler) mpVerticalRuler->SetLines(nCnt, pVLines); } diff --git a/sd/source/ui/view/grviewsh.cxx b/sd/source/ui/view/grviewsh.cxx index 9ab5501c14e6..b914b2da8cbd 100644 --- a/sd/source/ui/view/grviewsh.cxx +++ b/sd/source/ui/view/grviewsh.cxx @@ -67,7 +67,7 @@ void GraphicViewShell::ChangeEditMode ( void GraphicViewShell::ArrangeGUIElements() { - if (mpLayerTabBar.get()!=nullptr && mpLayerTabBar->IsVisible()) + if (mpLayerTabBar && mpLayerTabBar->IsVisible()) { Size aSize = mpLayerTabBar->GetSizePixel(); const Size aFrameSize (GetViewFrame()->GetWindow().GetOutputSizePixel()); diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx index 9ce31a6cba29..47ac53f680c0 100644 --- a/sd/source/ui/view/viewshe2.cxx +++ b/sd/source/ui/view/viewshe2.cxx @@ -71,7 +71,7 @@ namespace sd { */ void ViewShell::UpdateScrollBars() { - if (mpHorizontalScrollBar.get() != nullptr) + if (mpHorizontalScrollBar) { long nW = static_cast<long>(mpContentWindow->GetVisibleWidth() * 32000); long nX = static_cast<long>(mpContentWindow->GetVisibleX() * 32000); @@ -84,7 +84,7 @@ void ViewShell::UpdateScrollBars() mpHorizontalScrollBar->SetPageSize(nPage); } - if (mpVerticalScrollBar.get() != nullptr) + if (mpVerticalScrollBar) { long nH = static_cast<long>(mpContentWindow->GetVisibleHeight() * 32000); long nY = static_cast<long>(mpContentWindow->GetVisibleY() * 32000); @@ -317,13 +317,13 @@ void ViewShell::SetZoom(long nZoom) Fraction aUIScale(nZoom, 100); aUIScale *= GetDoc()->GetUIScale(); - if (mpHorizontalRuler.get() != nullptr) + if (mpHorizontalRuler) mpHorizontalRuler->SetZoom(aUIScale); - if (mpVerticalRuler.get() != nullptr) + if (mpVerticalRuler) mpVerticalRuler->SetZoom(aUIScale); - if (mpContentWindow.get() != nullptr) + if (mpContentWindow) { mpContentWindow->SetZoomIntegral(nZoom); @@ -369,13 +369,13 @@ void ViewShell::SetZoomRect(const ::tools::Rectangle& rZoomRect) Point aPos = GetActiveWindow()->GetWinViewPos(); - if (mpHorizontalRuler.get() != nullptr) + if (mpHorizontalRuler) mpHorizontalRuler->SetZoom(aUIScale); - if (mpVerticalRuler.get() != nullptr) + if (mpVerticalRuler) mpVerticalRuler->SetZoom(aUIScale); - if (mpContentWindow.get() != nullptr) + if (mpContentWindow) { Point aNewPos = mpContentWindow->GetWinViewPos(); aNewPos.setX( aPos.X() ); @@ -409,7 +409,7 @@ void ViewShell::SetZoomRect(const ::tools::Rectangle& rZoomRect) void ViewShell::InitWindows(const Point& rViewOrigin, const Size& rViewSize, const Point& rWinPos, bool bUpdate) { - if (mpContentWindow.get() != nullptr) + if (mpContentWindow) { mpContentWindow->SetViewOrigin(rViewOrigin); mpContentWindow->SetViewSize(rViewSize); @@ -438,7 +438,7 @@ void ViewShell::InitWindows(const Point& rViewOrigin, const Size& rViewSize, */ void ViewShell::InvalidateWindows() { - if (mpContentWindow.get() != nullptr) + if (mpContentWindow) mpContentWindow->Invalidate(); } @@ -447,7 +447,7 @@ void ViewShell::InvalidateWindows() */ void ViewShell::DrawMarkRect(const ::tools::Rectangle& rRect) const { - if (mpContentWindow.get() != nullptr) + if (mpContentWindow) { mpContentWindow->InvertTracking(rRect, ShowTrackFlags::Object | ShowTrackFlags::TrackWindow); } @@ -822,7 +822,7 @@ void ViewShell::SetRuler(bool bRuler) { mbHasRulers = ( bRuler && !GetDocSh()->IsPreview() ); // no rulers on preview mode - if (mpHorizontalRuler.get() != nullptr) + if (mpHorizontalRuler) { if (mbHasRulers) { @@ -834,7 +834,7 @@ void ViewShell::SetRuler(bool bRuler) } } - if (mpVerticalRuler.get() != nullptr) + if (mpVerticalRuler) { if (mbHasRulers) { @@ -853,13 +853,13 @@ void ViewShell::SetRuler(bool bRuler) void ViewShell::SetScrollBarsVisible(bool bVisible) { - if (mpVerticalScrollBar.get() != nullptr) + if (mpVerticalScrollBar) mpVerticalScrollBar->Show( bVisible ); - if (mpHorizontalScrollBar.get() != nullptr) + if (mpHorizontalScrollBar) mpHorizontalScrollBar->Show( bVisible ); - if (mpScrollBarBox.get() != nullptr) + if (mpScrollBarBox) mpScrollBarBox->Show(bVisible); } @@ -916,7 +916,7 @@ void ViewShell::VisAreaChanged(const ::tools::Rectangle& /*rRect*/) void ViewShell::SetWinViewPos(const Point& rWinPos) { - if (mpContentWindow.get() != nullptr) + if (mpContentWindow) { mpContentWindow->SetWinViewPos(rWinPos); diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index ca99e3f7a214..9ba96ff29a87 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -111,7 +111,7 @@ namespace sd { bool ViewShell::IsPageFlipMode() const { - return dynamic_cast< const DrawViewShell *>( this ) != nullptr && mpContentWindow.get() != nullptr && + return dynamic_cast< const DrawViewShell *>( this ) != nullptr && mpContentWindow && mpContentWindow->GetVisibleHeight() >= 1.0; } @@ -149,7 +149,7 @@ ViewShell::~ViewShell() mpLayerTabBar.disposeAndClear(); - if (mpImpl->mpSubShellFactory.get() != nullptr) + if (mpImpl->mpSubShellFactory) GetViewShellBase().GetViewShellManager()->RemoveSubShellFactory( this,mpImpl->mpSubShellFactory); @@ -299,9 +299,9 @@ void ViewShell::Activate(bool bIsMDIActivate) is sent sometimes asynchronous, it can happen, that the wrong window gets the focus. */ - if (mpHorizontalRuler.get() != nullptr) + if (mpHorizontalRuler) mpHorizontalRuler->SetActive(); - if (mpVerticalRuler.get() != nullptr) + if (mpVerticalRuler) mpVerticalRuler->SetActive(); if (bIsMDIActivate) @@ -376,9 +376,9 @@ void ViewShell::Deactivate(bool bIsMDIActivate) GetCurrentFunction()->Deactivate(); } - if (mpHorizontalRuler.get() != nullptr) + if (mpHorizontalRuler) mpHorizontalRuler->SetActive(false); - if (mpVerticalRuler.get() != nullptr) + if (mpVerticalRuler) mpVerticalRuler->SetActive(false); SfxShell::Deactivate(bIsMDIActivate); @@ -762,7 +762,7 @@ bool ViewShell::HandleScrollCommand(const CommandEvent& rCEvt, ::sd::Window* pWi void ViewShell::SetupRulers() { - if(!(mbHasRulers && (mpContentWindow.get() != nullptr) && !SlideShow::IsRunning(GetViewShellBase()))) + if(!(mbHasRulers && mpContentWindow && !SlideShow::IsRunning(GetViewShellBase()))) return; long nHRulerOfs = 0; @@ -770,7 +770,7 @@ void ViewShell::SetupRulers() if ( mpVerticalRuler.get() == nullptr ) { mpVerticalRuler.reset(CreateVRuler(GetActiveWindow())); - if ( mpVerticalRuler.get() != nullptr ) + if ( mpVerticalRuler ) { nHRulerOfs = mpVerticalRuler->GetSizePixel().Width(); mpVerticalRuler->SetActive(); @@ -780,7 +780,7 @@ void ViewShell::SetupRulers() if ( mpHorizontalRuler.get() == nullptr ) { mpHorizontalRuler.reset(CreateHRuler(GetActiveWindow())); - if ( mpHorizontalRuler.get() != nullptr ) + if ( mpHorizontalRuler ) { mpHorizontalRuler->SetWinPos(nHRulerOfs); mpHorizontalRuler->SetActive(); @@ -899,26 +899,26 @@ SvBorder ViewShell::GetBorder() SvBorder aBorder; // Horizontal scrollbar. - if (mpHorizontalScrollBar.get()!=nullptr + if (mpHorizontalScrollBar && mpHorizontalScrollBar->IsVisible()) { aBorder.Bottom() = maScrBarWH.Height(); } // Vertical scrollbar. - if (mpVerticalScrollBar.get()!=nullptr + if (mpVerticalScrollBar && mpVerticalScrollBar->IsVisible()) { aBorder.Right() = maScrBarWH.Width(); } // Place horizontal ruler below tab bar. - if (mbHasRulers && mpContentWindow.get() != nullptr) + if (mbHasRulers && mpContentWindow) { SetupRulers(); - if (mpHorizontalRuler.get() != nullptr) + if (mpHorizontalRuler) aBorder.Top() = mpHorizontalRuler->GetSizePixel().Height(); - if (mpVerticalRuler.get() != nullptr) + if (mpVerticalRuler) aBorder.Left() = mpVerticalRuler->GetSizePixel().Width(); } @@ -940,11 +940,11 @@ void ViewShell::ArrangeGUIElements() long nBottom = maViewPos.Y() + maViewSize.Height(); // Horizontal scrollbar. - if (mpHorizontalScrollBar.get()!=nullptr + if (mpHorizontalScrollBar && mpHorizontalScrollBar->IsVisible()) { nBottom -= maScrBarWH.Height(); - if (mpLayerTabBar.get()!=nullptr && mpLayerTabBar->IsVisible()) + if (mpLayerTabBar && mpLayerTabBar->IsVisible()) nBottom -= mpLayerTabBar->GetSizePixel().Height(); mpHorizontalScrollBar->SetPosSizePixel ( Point(nLeft, nBottom), @@ -952,7 +952,7 @@ void ViewShell::ArrangeGUIElements() } // Vertical scrollbar. - if (mpVerticalScrollBar.get()!=nullptr + if (mpVerticalScrollBar && mpVerticalScrollBar->IsVisible()) { nRight -= maScrBarWH.Width(); @@ -962,11 +962,11 @@ void ViewShell::ArrangeGUIElements() } // Filler in the lower right corner. - if (mpScrollBarBox.get() != nullptr) + if (mpScrollBarBox) { - if (mpHorizontalScrollBar.get()!=nullptr + if (mpHorizontalScrollBar && mpHorizontalScrollBar->IsVisible() - && mpVerticalScrollBar.get()!=nullptr + && mpVerticalScrollBar && mpVerticalScrollBar->IsVisible()) { mpScrollBarBox->Show(); @@ -977,20 +977,20 @@ void ViewShell::ArrangeGUIElements() } // Place horizontal ruler below tab bar. - if (mbHasRulers && mpContentWindow.get() != nullptr) + if (mbHasRulers && mpContentWindow) { - if (mpHorizontalRuler.get() != nullptr) + if (mpHorizontalRuler) { Size aRulerSize = mpHorizontalRuler->GetSizePixel(); aRulerSize.setWidth( nRight - nLeft ); mpHorizontalRuler->SetPosSizePixel ( Point(nLeft,nTop), aRulerSize); - if (mpVerticalRuler.get() != nullptr) + if (mpVerticalRuler) mpHorizontalRuler->SetBorderPos( mpVerticalRuler->GetSizePixel().Width()-1); nTop += aRulerSize.Height(); } - if (mpVerticalRuler.get() != nullptr) + if (mpVerticalRuler) { Size aRulerSize = mpVerticalRuler->GetSizePixel(); aRulerSize.setHeight( nBottom - nTop ); @@ -1021,7 +1021,7 @@ void ViewShell::ArrangeGUIElements() Size(maViewSize.Width()-maScrBarWH.Width(), maViewSize.Height()-maScrBarWH.Height())); - if (mpContentWindow.get() != nullptr) + if (mpContentWindow) mpContentWindow->UpdateMapOrigin(); UpdateScrollBars(); @@ -1032,10 +1032,10 @@ void ViewShell::ArrangeGUIElements() void ViewShell::SetUIUnit(FieldUnit eUnit) { // Set unit at horizontal and vertical rulers. - if (mpHorizontalRuler.get() != nullptr) + if (mpHorizontalRuler) mpHorizontalRuler->SetUnit(eUnit); - if (mpVerticalRuler.get() != nullptr) + if (mpVerticalRuler) mpVerticalRuler->SetUnit(eUnit); } @@ -1044,7 +1044,7 @@ void ViewShell::SetUIUnit(FieldUnit eUnit) */ void ViewShell::SetDefTabHRuler( sal_uInt16 nDefTab ) { - if (mpHorizontalRuler.get() != nullptr) + if (mpHorizontalRuler) mpHorizontalRuler->SetDefTabDist( nDefTab ); } @@ -1499,23 +1499,23 @@ void ViewShell::ShowUIControls (bool bVisible) { if (mbHasRulers) { - if (mpHorizontalRuler.get() != nullptr) + if (mpHorizontalRuler) mpHorizontalRuler->Show( bVisible ); - if (mpVerticalRuler.get() != nullptr) + if (mpVerticalRuler) mpVerticalRuler->Show( bVisible ); } - if (mpVerticalScrollBar.get() != nullptr) + if (mpVerticalScrollBar) mpVerticalScrollBar->Show( bVisible ); - if (mpHorizontalScrollBar.get() != nullptr) + if (mpHorizontalScrollBar) mpHorizontalScrollBar->Show( bVisible ); - if (mpScrollBarBox.get() != nullptr) + if (mpScrollBarBox) mpScrollBarBox->Show(bVisible); - if (mpContentWindow.get() != nullptr) + if (mpContentWindow) mpContentWindow->Show( bVisible ); } @@ -1525,14 +1525,14 @@ bool ViewShell::RelocateToParentWindow (vcl::Window* pParentWindow) mpParentWindow->SetBackground (Wallpaper()); - if (mpContentWindow.get() != nullptr) + if (mpContentWindow) mpContentWindow->SetParent(pParentWindow); - if (mpHorizontalScrollBar.get() != nullptr) + if (mpHorizontalScrollBar) mpHorizontalScrollBar->SetParent(mpParentWindow); - if (mpVerticalScrollBar.get() != nullptr) + if (mpVerticalScrollBar) mpVerticalScrollBar->SetParent(mpParentWindow); - if (mpScrollBarBox.get() != nullptr) + if (mpScrollBarBox) mpScrollBarBox->SetParent(mpParentWindow); return true; |