diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:23:02 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:31:38 +0100 |
commit | 92c697c0e3e4bde88424322875c993c161696b1e (patch) | |
tree | ea1be62a0cb8fd7f7e63dd03a52441cedd8e96eb /sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx | |
parent | 65464ed0985802edb96dbcbd1c3eed996f3778bd (diff) |
loplugin:nullptr (automatic rewrite)
Change-Id: If1b80da64ba575f07b31dce9bc0e34b7eb9f11a4
Diffstat (limited to 'sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx')
-rw-r--r-- | sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index 8cfe7a0304d6..32becf587f21 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -105,7 +105,7 @@ std::shared_ptr<SlideSorterViewShell> SlideSorterViewShell::Create ( pViewShell.reset( new SlideSorterViewShell(pFrame,rViewShellBase,pParentWindow,pFrameViewArgument)); pViewShell->Initialize(); - if (pViewShell->mpSlideSorter.get() == NULL) + if (pViewShell->mpSlideSorter.get() == nullptr) pViewShell.reset(); } catch(Exception&) @@ -126,7 +126,7 @@ SlideSorterViewShell::SlideSorterViewShell ( { meShellType = ST_SLIDE_SORTER; - if (pFrameViewArgument != NULL) + if (pFrameViewArgument != nullptr) mpFrameView = pFrameViewArgument; else mpFrameView = new FrameView(GetDoc()); @@ -144,7 +144,7 @@ SlideSorterViewShell::~SlideSorterViewShell() try { ::sd::Window* pWindow = GetActiveWindow(); - if (pWindow!=NULL) + if (pWindow!=nullptr) { css::uno::Reference<css::lang::XComponent> xComponent ( pWindow->GetAccessible(false), @@ -198,13 +198,13 @@ void SlideSorterViewShell::Init (bool bIsMainViewShell) pActiveWindow->Show(); mpSlideSorter->GetModel().UpdatePageList(); - if (mpContentWindow.get() != NULL) + if (mpContentWindow.get() != nullptr) mpContentWindow->SetViewShell(this); } SlideSorterViewShell* SlideSorterViewShell::GetSlideSorter (ViewShellBase& rBase) { - SlideSorterViewShell* pViewShell = NULL; + SlideSorterViewShell* pViewShell = nullptr; // Test the center and left pane for showing a slide sorter. OUString aPaneURLs[] = { @@ -217,7 +217,7 @@ SlideSorterViewShell* SlideSorterViewShell::GetSlideSorter (ViewShellBase& rBase { std::shared_ptr<FrameworkHelper> pFrameworkHelper (FrameworkHelper::Instance(rBase)); if (pFrameworkHelper->IsValid()) - for (int i=0; pViewShell==NULL && !aPaneURLs[i].isEmpty(); ++i) + for (int i=0; pViewShell==nullptr && !aPaneURLs[i].isEmpty(); ++i) { pViewShell = dynamic_cast<SlideSorterViewShell*>( pFrameworkHelper->GetViewShell(aPaneURLs[i]).get()); @@ -252,10 +252,10 @@ css::uno::Reference<css::accessibility::XAccessible> { // When the view is not set then the initialization is not yet complete // and we can not yet provide an accessibility object. - if (mpView == NULL || mpSlideSorter.get() == NULL) - return NULL; + if (mpView == nullptr || mpSlideSorter.get() == nullptr) + return nullptr; - OSL_ASSERT(mpSlideSorter.get()!=NULL); + OSL_ASSERT(mpSlideSorter.get()!=nullptr); ::accessibility::AccessibleSlideSorterView *pAccessibleView = new ::accessibility::AccessibleSlideSorterView( @@ -284,7 +284,7 @@ void SlideSorterViewShell::SwitchViewFireFocus(css::uno::Reference< css::accessi SlideSorter& SlideSorterViewShell::GetSlideSorter() const { - OSL_ASSERT(mpSlideSorter.get()!=NULL); + OSL_ASSERT(mpSlideSorter.get()!=nullptr); return *mpSlideSorter; } @@ -294,10 +294,10 @@ bool SlideSorterViewShell::RelocateToParentWindow (vcl::Window* pParentWindow) if ( ! mpSlideSorter) return false; - if (pParentWindow == NULL) + if (pParentWindow == nullptr) WriteFrameViewData(); const bool bSuccess (mpSlideSorter->RelocateToWindow(pParentWindow)); - if (pParentWindow != NULL) + if (pParentWindow != nullptr) ReadFrameViewData(mpFrameView); return bSuccess; @@ -306,7 +306,7 @@ bool SlideSorterViewShell::RelocateToParentWindow (vcl::Window* pParentWindow) ::svl::IUndoManager* SlideSorterViewShell::ImpGetUndoManager() const { SfxShell* pObjectBar = GetViewShellBase().GetViewShellManager()->GetTopShell(); - if (pObjectBar != NULL) + if (pObjectBar != nullptr) { // When it exists then return the undo manager of the currently // active object bar. The object bar is missing when the @@ -331,26 +331,26 @@ SdPage* SlideSorterViewShell::getCurrentPage() const SdPage* SlideSorterViewShell::GetActualPage() { - SdPage* pCurrentPage = NULL; + SdPage* pCurrentPage = nullptr; // 1. Try to get the current page from the view shell in the center pane // (if we are that not ourself). if ( ! IsMainViewShell()) { std::shared_ptr<ViewShell> pMainViewShell = GetViewShellBase().GetMainViewShell(); - if (pMainViewShell.get() != NULL) + if (pMainViewShell.get() != nullptr) pCurrentPage = pMainViewShell->GetActualPage(); } - if (pCurrentPage == NULL) + if (pCurrentPage == nullptr) { model::SharedPageDescriptor pDescriptor ( mpSlideSorter->GetController().GetCurrentSlideManager()->GetCurrentSlide()); - if (pDescriptor.get() != NULL) + if (pDescriptor.get() != nullptr) pCurrentPage = pDescriptor->GetPage(); } - if (pCurrentPage == NULL) + if (pCurrentPage == nullptr) { } @@ -361,32 +361,32 @@ SdPage* SlideSorterViewShell::GetActualPage() void SlideSorterViewShell::GetMenuState ( SfxItemSet& rSet) { ViewShell::GetMenuState(rSet); - OSL_ASSERT(mpSlideSorter.get()!=NULL); + OSL_ASSERT(mpSlideSorter.get()!=nullptr); mpSlideSorter->GetController().GetSlotManager()->GetMenuState(rSet); } void SlideSorterViewShell::GetClipboardState ( SfxItemSet& rSet) { ViewShell::GetMenuState(rSet); - OSL_ASSERT(mpSlideSorter.get()!=NULL); + OSL_ASSERT(mpSlideSorter.get()!=nullptr); mpSlideSorter->GetController().GetSlotManager()->GetClipboardState(rSet); } void SlideSorterViewShell::ExecCtrl (SfxRequest& rRequest) { - OSL_ASSERT(mpSlideSorter.get()!=NULL); + OSL_ASSERT(mpSlideSorter.get()!=nullptr); mpSlideSorter->GetController().ExecCtrl(rRequest); } void SlideSorterViewShell::GetCtrlState (SfxItemSet& rSet) { - OSL_ASSERT(mpSlideSorter.get()!=NULL); + OSL_ASSERT(mpSlideSorter.get()!=nullptr); mpSlideSorter->GetController().GetCtrlState(rSet); } void SlideSorterViewShell::FuSupport (SfxRequest& rRequest) { - OSL_ASSERT(mpSlideSorter.get()!=NULL); + OSL_ASSERT(mpSlideSorter.get()!=nullptr); mpSlideSorter->GetController().FuSupport(rRequest); } @@ -395,13 +395,13 @@ void SlideSorterViewShell::FuSupport (SfxRequest& rRequest) */ void SlideSorterViewShell::FuTemporary (SfxRequest& rRequest) { - OSL_ASSERT(mpSlideSorter.get()!=NULL); + OSL_ASSERT(mpSlideSorter.get()!=nullptr); switch (rRequest.GetSlot()) { case SID_MODIFYPAGE: { SdPage* pCurrentPage = GetActualPage(); - if (pCurrentPage != NULL) + if (pCurrentPage != nullptr) mpImpl->ProcessModifyPageSlot ( rRequest, pCurrentPage, @@ -419,19 +419,19 @@ void SlideSorterViewShell::FuTemporary (SfxRequest& rRequest) void SlideSorterViewShell::GetStatusBarState (SfxItemSet& rSet) { - OSL_ASSERT(mpSlideSorter.get()!=NULL); + OSL_ASSERT(mpSlideSorter.get()!=nullptr); mpSlideSorter->GetController().GetStatusBarState(rSet); } void SlideSorterViewShell::FuPermanent (SfxRequest& rRequest) { - OSL_ASSERT(mpSlideSorter.get()!=NULL); + OSL_ASSERT(mpSlideSorter.get()!=nullptr); mpSlideSorter->GetController().FuPermanent(rRequest); } void SlideSorterViewShell::GetAttrState (SfxItemSet& rSet) { - OSL_ASSERT(mpSlideSorter.get()!=NULL); + OSL_ASSERT(mpSlideSorter.get()!=nullptr); mpSlideSorter->GetController().GetAttrState(rSet); } @@ -453,7 +453,7 @@ void SlideSorterViewShell::ArrangeGUIElements() { if (IsActive()) { - OSL_ASSERT(mpSlideSorter.get()!=NULL); + OSL_ASSERT(mpSlideSorter.get()!=nullptr); mpSlideSorter->ArrangeGUIElements(maViewPos, maViewSize); mbIsArrangeGUIElementsPending = false; } @@ -481,10 +481,10 @@ void SlideSorterViewShell::Activate (bool bIsMDIActivate) case ViewShell::ST_NOTES: case ViewShell::ST_DRAW: eContext = EnumContext::Context_DrawPage; - if( 0 != dynamic_cast< const DrawViewShell *>( pMainViewShell.get() )) + if( nullptr != dynamic_cast< const DrawViewShell *>( pMainViewShell.get() )) { DrawViewShell* pDrawViewShell = dynamic_cast<DrawViewShell*>(pMainViewShell.get()); - if (pDrawViewShell != NULL) + if (pDrawViewShell != nullptr) eContext = EnumContext::GetContextEnum(pDrawViewShell->GetSidebarContextName()); } break; @@ -507,15 +507,15 @@ void SlideSorterViewShell::Command ( const CommandEvent& rEvent, ::sd::Window* pWindow) { - OSL_ASSERT(mpSlideSorter.get()!=NULL); + OSL_ASSERT(mpSlideSorter.get()!=nullptr); if ( ! mpSlideSorter->GetController().Command (rEvent, pWindow)) ViewShell::Command (rEvent, pWindow); } void SlideSorterViewShell::ReadFrameViewData (FrameView* pFrameView) { - OSL_ASSERT(mpSlideSorter.get()!=NULL); - if (pFrameView != NULL) + OSL_ASSERT(mpSlideSorter.get()!=nullptr); + if (pFrameView != nullptr) { view::SlideSorterView& rView (mpSlideSorter->GetView()); @@ -542,7 +542,7 @@ void SlideSorterViewShell::ReadFrameViewData (FrameView* pFrameView) if ( ! IsMainViewShell()) { std::shared_ptr<ViewShell> pMainViewShell = GetViewShellBase().GetMainViewShell(); - if (pMainViewShell.get() != NULL) + if (pMainViewShell.get() != nullptr) mpSlideSorter->GetController().GetCurrentSlideManager()->NotifyCurrentSlideChange( pMainViewShell->getCurrentPage()); } @@ -550,8 +550,8 @@ void SlideSorterViewShell::ReadFrameViewData (FrameView* pFrameView) void SlideSorterViewShell::WriteFrameViewData() { - OSL_ASSERT(mpSlideSorter.get()!=NULL); - if (mpFrameView != NULL) + OSL_ASSERT(mpSlideSorter.get()!=nullptr); + if (mpFrameView != nullptr) { view::SlideSorterView& rView (mpSlideSorter->GetView()); mpFrameView->SetSlidesPerRow((sal_uInt16)rView.GetLayouter().GetColumnCount()); @@ -561,7 +561,7 @@ void SlideSorterViewShell::WriteFrameViewData() mpFrameView->SetDrawMode( GetActiveWindow()->GetDrawMode() ); SdPage* pActualPage = GetActualPage(); - if (pActualPage != NULL) + if (pActualPage != nullptr) { if (IsMainViewShell()) mpFrameView->SetSelectedPage((pActualPage->GetPageNum()- 1) / 2); @@ -588,7 +588,7 @@ void SlideSorterViewShell::SetZoom (long int ) void SlideSorterViewShell::SetZoomRect (const Rectangle& rZoomRect) { - OSL_ASSERT(mpSlideSorter.get()!=NULL); + OSL_ASSERT(mpSlideSorter.get()!=nullptr); Size aPageSize (mpSlideSorter->GetView().GetLayouter().GetPageObjectSize()); Rectangle aRect(rZoomRect); @@ -636,7 +636,7 @@ void SlideSorterViewShell::StartDrag ( const Point& rDragPt, vcl::Window* pWindow ) { - OSL_ASSERT(mpSlideSorter.get()!=NULL); + OSL_ASSERT(mpSlideSorter.get()!=nullptr); mpSlideSorter->GetController().GetClipboard().StartDrag ( rDragPt, pWindow); @@ -649,7 +649,7 @@ sal_Int8 SlideSorterViewShell::AcceptDrop ( sal_uInt16 nPage, sal_uInt16 nLayer) { - OSL_ASSERT(mpSlideSorter.get()!=NULL); + OSL_ASSERT(mpSlideSorter.get()!=nullptr); return mpSlideSorter->GetController().GetClipboard().AcceptDrop ( rEvt, rTargetHelper, @@ -665,7 +665,7 @@ sal_Int8 SlideSorterViewShell::ExecuteDrop ( sal_uInt16 nPage, sal_uInt16 nLayer) { - OSL_ASSERT(mpSlideSorter.get()!=NULL); + OSL_ASSERT(mpSlideSorter.get()!=nullptr); return mpSlideSorter->GetController().GetClipboard().ExecuteDrop ( rEvt, rTargetHelper, @@ -677,28 +677,28 @@ sal_Int8 SlideSorterViewShell::ExecuteDrop ( std::shared_ptr<SlideSorterViewShell::PageSelection> SlideSorterViewShell::GetPageSelection() const { - OSL_ASSERT(mpSlideSorter.get()!=NULL); + OSL_ASSERT(mpSlideSorter.get()!=nullptr); return mpSlideSorter->GetController().GetPageSelector().GetPageSelection(); } void SlideSorterViewShell::SetPageSelection ( const std::shared_ptr<PageSelection>& rSelection) { - OSL_ASSERT(mpSlideSorter.get()!=NULL); + OSL_ASSERT(mpSlideSorter.get()!=nullptr); mpSlideSorter->GetController().GetPageSelector().SetPageSelection(rSelection); } void SlideSorterViewShell::AddSelectionChangeListener ( const Link<LinkParamNone*,void>& rCallback) { - OSL_ASSERT(mpSlideSorter.get()!=NULL); + OSL_ASSERT(mpSlideSorter.get()!=nullptr); mpSlideSorter->GetController().GetSelectionManager()->AddSelectionChangeListener(rCallback); } void SlideSorterViewShell::RemoveSelectionChangeListener ( const Link<LinkParamNone*,void>& rCallback) { - OSL_ASSERT(mpSlideSorter.get()!=NULL); + OSL_ASSERT(mpSlideSorter.get()!=nullptr); mpSlideSorter->GetController().GetSelectionManager()->RemoveSelectionChangeListener(rCallback); } @@ -722,10 +722,10 @@ void SlideSorterViewShell::GetStateMovePageFirst (SfxItemSet& rSet) if ( ! IsMainViewShell()) { std::shared_ptr<ViewShell> pMainViewShell = GetViewShellBase().GetMainViewShell(); - if (pMainViewShell.get() != NULL && 0 != dynamic_cast< const DrawViewShell *>( pMainViewShell.get() )) + if (pMainViewShell.get() != nullptr && nullptr != dynamic_cast< const DrawViewShell *>( pMainViewShell.get() )) { DrawViewShell* pDrawViewShell = dynamic_cast<DrawViewShell*>(pMainViewShell.get()); - if (pDrawViewShell != NULL && pDrawViewShell->GetPageKind() == PK_HANDOUT) + if (pDrawViewShell != nullptr && pDrawViewShell->GetPageKind() == PK_HANDOUT) { rSet.DisableItem( SID_MOVE_PAGE_FIRST ); rSet.DisableItem( SID_MOVE_PAGE_UP ); @@ -839,10 +839,10 @@ void SlideSorterViewShell::ExecMovePageLast (SfxRequest& /*rReq*/) void SlideSorterViewShell::GetStateMovePageLast (SfxItemSet& rSet) { std::shared_ptr<ViewShell> pMainViewShell = GetViewShellBase().GetMainViewShell(); - if (pMainViewShell.get() != NULL && 0 != dynamic_cast< const DrawViewShell *>( pMainViewShell.get() )) + if (pMainViewShell.get() != nullptr && nullptr != dynamic_cast< const DrawViewShell *>( pMainViewShell.get() )) { DrawViewShell* pDrawViewShell = dynamic_cast<DrawViewShell*>(pMainViewShell.get()); - if (pDrawViewShell != NULL && pDrawViewShell->GetPageKind() == PK_HANDOUT) + if (pDrawViewShell != nullptr && pDrawViewShell->GetPageKind() == PK_HANDOUT) { rSet.DisableItem( SID_MOVE_PAGE_LAST ); rSet.DisableItem( SID_MOVE_PAGE_DOWN ); |