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/view | |
parent | 65464ed0985802edb96dbcbd1c3eed996f3778bd (diff) |
loplugin:nullptr (automatic rewrite)
Change-Id: If1b80da64ba575f07b31dce9bc0e34b7eb9f11a4
Diffstat (limited to 'sd/source/ui/view')
52 files changed, 862 insertions, 862 deletions
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index fdd578d15971..fd2b69cca58d 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -76,7 +76,7 @@ namespace { bool IsWarningOrientation() const { - return GetBoolValue(NULL, true); + return GetBoolValue(nullptr, true); } bool IsPrintPageName() const @@ -298,11 +298,11 @@ namespace { // Set the visible layers SdrPageView* pPageView = rPrintView.GetSdrPageView(); - OSL_ASSERT(pPageView!=NULL); + OSL_ASSERT(pPageView!=nullptr); pPageView->SetVisibleLayers(rVisibleLayers); pPageView->SetPrintableLayers(rPrintableLayers); - if (pView!=NULL && bPrintMarkedOnly) + if (pView!=nullptr && bPrintMarkedOnly) pView->DrawMarkedObj(rPrinter); else rPrintView.CompleteRedraw(&rPrinter, @@ -783,7 +783,7 @@ namespace { { (void)rViewShell; SdPage* pPageToPrint = rDocument.GetSdPage(mnPageIndex, mePageKind); - if (pPageToPrint==NULL) + if (pPageToPrint==nullptr) return; MapMode aMap (rPrinter.GetMapMode()); @@ -973,7 +973,7 @@ namespace { int nHangoverCount = 0; while (aPageObjIter != aHandoutPageObjects.end()) { - (*aPageObjIter++)->SetReferencedPage(0L); + (*aPageObjIter++)->SetReferencedPage(nullptr); nHangoverCount++; } @@ -1036,7 +1036,7 @@ namespace { while (aShapeIter.IsMore()) { SdrPathObj* pPathObj = dynamic_cast<SdrPathObj*>(aShapeIter.Next()); - if (pPathObj != NULL) + if (pPathObj != nullptr) pPathObj->SetMergedItem(XLineStyleItem(drawing::LineStyle_SOLID)); } } @@ -1134,7 +1134,7 @@ public: : mxObjectShell(rBase.GetDocShell()) , mrBase(rBase) , mbIsDisposed(false) - , mpPrinter(NULL) + , mpPrinter(nullptr) , mpOptions() , maPrinterPages() , mpPrintView() @@ -1155,7 +1155,7 @@ public: virtual void Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint) override { const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); - if (pSimpleHint != NULL + if (pSimpleHint != nullptr && pSimpleHint->GetId() == SFX_HINT_DYING && &rBroadcaster == &static_cast<SfxBroadcaster&>(mrBase)) { @@ -1252,13 +1252,13 @@ public: return; SdDrawDocument* pDocument = pViewShell->GetDoc(); - OSL_ASSERT(pDocument!=NULL); + OSL_ASSERT(pDocument!=nullptr); std::shared_ptr<DrawViewShell> pDrawViewShell( std::dynamic_pointer_cast<DrawViewShell>(mrBase.GetMainViewShell())); if (!mpPrintView) - mpPrintView.reset(new DrawView(mrBase.GetDocShell(), &rPrinter, NULL)); + mpPrintView.reset(new DrawView(mrBase.GetDocShell(), &rPrinter, nullptr)); if (nIndex<0 || sal::static_int_cast<sal_uInt32>(nIndex)>=maPrinterPages.size()) return; @@ -1304,7 +1304,7 @@ public: rPrinter, *pDocument, *pViewShell, - pDrawViewShell ? pDrawViewShell->GetView() : NULL, + pDrawViewShell ? pDrawViewShell->GetView() : nullptr, *mpPrintView, pViewShell->GetFrameView()->GetVisibleLayers(), pViewShell->GetFrameView()->GetPrintableLayers()); @@ -1337,7 +1337,7 @@ private: sal_Int32 GetCurrentPageIndex() const { const ViewShell *pShell = mrBase.GetMainViewShell().get(); - const SdPage *pCurrentPage = pShell ? pShell->getCurrentPage() : NULL; + const SdPage *pCurrentPage = pShell ? pShell->getCurrentPage() : nullptr; return pCurrentPage ? (pCurrentPage->GetPageNum()-1)/2 : -1; } @@ -1405,7 +1405,7 @@ private: PrintInfo aInfo (mpPrinter, mpOptions->IsPrintMarkedOnly()); - if (aInfo.mpPrinter!=nullptr && pShell!=NULL) + if (aInfo.mpPrinter!=nullptr && pShell!=nullptr) { MapMode aMap (aInfo.mpPrinter->GetMapMode()); @@ -1570,17 +1570,17 @@ private: const sal_Int32 nPageIndex, const PageKind ePageKind) const { - OSL_ASSERT(mrBase.GetDocument() != NULL); + OSL_ASSERT(mrBase.GetDocument() != nullptr); OSL_ASSERT(nPageIndex>=0); SdPage* pPage = mrBase.GetDocument()->GetSdPage( sal::static_int_cast<sal_uInt16>(nPageIndex), ePageKind); - if (pPage == NULL) - return NULL; + if (pPage == nullptr) + return nullptr; if ( ! pPage->IsExcluded() || mpOptions->IsPrintExcluded()) return pPage; else - return NULL; + return nullptr; } /** Prepare the outline of the document for printing. There is no fixed @@ -1631,19 +1631,19 @@ private: pOutliner->Clear(); pOutliner->SetFirstPageNumber(aPages[nIndex]+1); - Paragraph* pPara = NULL; + Paragraph* pPara = nullptr; sal_Int32 nH (0); while (nH < nPageH && nIndex<nCount) { SdPage* pPage = GetFilteredPage(aPages[nIndex], PK_STANDARD); ++nIndex; - if (pPage == NULL) + if (pPage == nullptr) continue; - SdrTextObj* pTextObj = NULL; + SdrTextObj* pTextObj = nullptr; size_t nObj (0); - while (pTextObj==NULL && nObj < pPage->GetObjCount()) + while (pTextObj==nullptr && nObj < pPage->GetObjCount()) { SdrObject* pObj = pPage->GetObj(nObj++); if (pObj->GetObjInventor() == SdrInventor @@ -1655,7 +1655,7 @@ private: pPara = pOutliner->GetParagraph(pOutliner->GetParagraphCount() - 1); - if (pTextObj!=NULL + if (pTextObj!=nullptr && !pTextObj->IsEmptyPresObj() && pTextObj->GetOutlinerParaObject()) { @@ -1664,10 +1664,10 @@ private: else pOutliner->Insert(OUString()); - pTextObj = NULL; + pTextObj = nullptr; nObj = 0; - while (pTextObj==NULL && nObj<pPage->GetObjCount()) + while (pTextObj==nullptr && nObj<pPage->GetObjCount()) { SdrObject* pObj = pPage->GetObj(nObj++); if (pObj->GetObjInventor() == SdrInventor @@ -1686,7 +1686,7 @@ private: sal_Int32 nParaCount1 = pOutliner->GetParagraphCount(); - if (pTextObj!=NULL + if (pTextObj!=nullptr && !pTextObj->IsEmptyPresObj() && pTextObj->GetOutlinerParaObject()) { @@ -1699,7 +1699,7 @@ private: for (sal_Int32 nPara=nParaCount1; nPara<nParaCount2; ++nPara) { Paragraph* pP = pOutliner->GetParagraph(nPara); - if (pP!=NULL && pOutliner->GetDepth(nPara) > 0) + if (pP!=nullptr && pOutliner->GetDepth(nPara) > 0) pOutliner->SetDepth(pP, 0); } } @@ -1709,7 +1709,7 @@ private: // Remove the last paragraph when that does not fit completely on // the current page. - if (nH > nPageH && pPara!=NULL) + if (nH > nPageH && pPara!=nullptr) { sal_Int32 nCnt = pOutliner->GetAbsPos( pOutliner->GetParagraph( pOutliner->GetParagraphCount() - 1 ) ); @@ -1746,7 +1746,7 @@ private: void PrepareHandout (PrintInfo& rInfo) { SdDrawDocument* pDocument = mrBase.GetDocument(); - OSL_ASSERT(pDocument != NULL); + OSL_ASSERT(pDocument != nullptr); SdPage& rHandoutPage (*pDocument->GetSdPage(0, PK_HANDOUT)); const bool bScalePage (mpOptions->IsPageSize()); @@ -1903,7 +1903,7 @@ private: ++it) { SdPage* pPage = GetFilteredPage(*it, ePageKind); - if (pPage == NULL) + if (pPage == nullptr) continue; MapMode aMap (rInfo.maMap); @@ -2030,7 +2030,7 @@ private: ++it) { SdPage* pPage = GetFilteredPage(*it, ePageKind); - if (pPage != NULL) + if (pPage != nullptr) aPageVector.push_back(*it); } diff --git a/sd/source/ui/view/FormShellManager.cxx b/sd/source/ui/view/FormShellManager.cxx index 37c2352ec6d8..d978012620e1 100644 --- a/sd/source/ui/view/FormShellManager.cxx +++ b/sd/source/ui/view/FormShellManager.cxx @@ -49,11 +49,11 @@ private: FormShellManager::FormShellManager (ViewShellBase& rBase) : mrBase(rBase), - mpFormShell(NULL), + mpFormShell(nullptr), mbFormShellAboveViewShell(false), mpSubShellFactory(), mbIsMainViewChangePending(false), - mpMainViewShellWindow(NULL) + mpMainViewShellWindow(nullptr) { // Register at the EventMultiplexer to be informed about changes in the // center pane. @@ -69,17 +69,17 @@ FormShellManager::FormShellManager (ViewShellBase& rBase) FormShellManager::~FormShellManager() { - SetFormShell(NULL); + SetFormShell(nullptr); UnregisterAtCenterPane(); // Unregister from the EventMultiplexer. Link<sd::tools::EventMultiplexerEvent&,void> aLink (LINK(this, FormShellManager, ConfigurationUpdateHandler)); mrBase.GetEventMultiplexer()->RemoveEventListener(aLink); - if (mpSubShellFactory.get() != NULL) + if (mpSubShellFactory.get() != nullptr) { ViewShell* pShell = mrBase.GetMainViewShell().get(); - if (pShell != NULL) + if (pShell != nullptr) mrBase.GetViewShellManager()->RemoveSubShellFactory(pShell,mpSubShellFactory); } } @@ -89,17 +89,17 @@ void FormShellManager::SetFormShell (FmFormShell* pFormShell) if (mpFormShell != pFormShell) { // Disconnect from the old form shell. - if (mpFormShell != NULL) + if (mpFormShell != nullptr) { mpFormShell->SetControlActivationHandler(Link<LinkParamNone*,void>()); EndListening(*mpFormShell); - mpFormShell->SetView(NULL); + mpFormShell->SetView(nullptr); } mpFormShell = pFormShell; // Connect to the new form shell. - if (mpFormShell != NULL) + if (mpFormShell != nullptr) { mpFormShell->SetControlActivationHandler( LINK( @@ -109,7 +109,7 @@ void FormShellManager::SetFormShell (FmFormShell* pFormShell) StartListening(*mpFormShell); ViewShell* pMainViewShell = mrBase.GetMainViewShell().get(); - if (pMainViewShell != NULL) + if (pMainViewShell != nullptr) { // Prevent setting the view twice at the FmFormShell. FmFormView* pFormView = static_cast<FmFormView*>(pMainViewShell->GetView()); @@ -129,7 +129,7 @@ void FormShellManager::SetFormShell (FmFormShell* pFormShell) void FormShellManager::RegisterAtCenterPane() { ViewShell* pShell = mrBase.GetMainViewShell().get(); - if (pShell == NULL) + if (pShell == nullptr) return; // No form shell for the slide sorter. Besides that it is not @@ -150,7 +150,7 @@ void FormShellManager::RegisterAtCenterPane() WindowEventHandler)); // Create a shell factory and with it activate the form shell. - OSL_ASSERT(mpSubShellFactory.get()==NULL); + OSL_ASSERT(mpSubShellFactory.get()==nullptr); mpSubShellFactory.reset(new FormShellManagerFactory(*pShell, *this)); mrBase.GetViewShellManager()->AddSubShellFactory(pShell,mpSubShellFactory); mrBase.GetViewShellManager()->ActivateSubShell(*pShell, RID_FORMLAYER_TOOLBOX); @@ -166,15 +166,15 @@ void FormShellManager::UnregisterAtCenterPane() this, FormShellManager, WindowEventHandler)); - mpMainViewShellWindow = NULL; + mpMainViewShellWindow = nullptr; } // Unregister form at the form shell. - SetFormShell(NULL); + SetFormShell(nullptr); // Deactivate the form shell and destroy the shell factory. ViewShell* pShell = mrBase.GetMainViewShell().get(); - if (pShell != NULL) + if (pShell != nullptr) { mrBase.GetViewShellManager()->DeactivateSubShell(*pShell, RID_FORMLAYER_TOOLBOX); mrBase.GetViewShellManager()->RemoveSubShellFactory(pShell, mpSubShellFactory); @@ -189,7 +189,7 @@ IMPL_LINK_NOARG_TYPED(FormShellManager, FormControlActivated, LinkParamNone*, vo // slot calls the form shell is moved to the top of the object bar shell // stack. ViewShell* pShell = mrBase.GetMainViewShell().get(); - if (pShell!=NULL && !mbFormShellAboveViewShell) + if (pShell!=nullptr && !mbFormShellAboveViewShell) { mbFormShellAboveViewShell = true; @@ -233,7 +233,7 @@ IMPL_LINK_TYPED(FormShellManager, WindowEventHandler, VclWindowEvent&, rEvent, v // the form shell is moved to the bottom of the object bar // stack. ViewShell* pShell = mrBase.GetMainViewShell().get(); - if (pShell!=NULL && mbFormShellAboveViewShell) + if (pShell!=nullptr && mbFormShellAboveViewShell) { mbFormShellAboveViewShell = false; ViewShellManager::UpdateLock aLock (mrBase.GetViewShellManager()); @@ -254,7 +254,7 @@ IMPL_LINK_TYPED(FormShellManager, WindowEventHandler, VclWindowEvent&, rEvent, v break; case VCLEVENT_OBJECT_DYING: - mpMainViewShellWindow = NULL; + mpMainViewShellWindow = nullptr; break; } } @@ -262,18 +262,18 @@ IMPL_LINK_TYPED(FormShellManager, WindowEventHandler, VclWindowEvent&, rEvent, v void FormShellManager::Notify(SfxBroadcaster&, const SfxHint& rHint) { const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); - if (pSimpleHint!=NULL && pSimpleHint->GetId()==SFX_HINT_DYING) + if (pSimpleHint!=nullptr && pSimpleHint->GetId()==SFX_HINT_DYING) { // If all goes well this listener is called after the // FormShellManager was notified about the dying form shell by the // FormShellManagerFactory. - OSL_ASSERT(mpFormShell==NULL); - if (mpFormShell != NULL) + OSL_ASSERT(mpFormShell==nullptr); + if (mpFormShell != nullptr) { - mpFormShell = NULL; + mpFormShell = nullptr; mrBase.GetViewShellManager()->SetFormShell( mrBase.GetMainViewShell().get(), - NULL, + nullptr, false); } } @@ -296,7 +296,7 @@ FmFormShell* FormShellManagerFactory::CreateShell ( vcl::Window*, ::sd::FrameView*) { - FmFormShell* pShell = NULL; + FmFormShell* pShell = nullptr; ::sd::View* pView = mrViewShell.GetView(); if (nId == RID_FORMLAYER_TOOLBOX) @@ -310,9 +310,9 @@ FmFormShell* FormShellManagerFactory::CreateShell ( void FormShellManagerFactory::ReleaseShell (SfxShell* pShell) { - if (pShell != NULL) + if (pShell != nullptr) { - mrFormShellManager.SetFormShell(NULL); + mrFormShellManager.SetFormShell(nullptr); delete pShell; } } diff --git a/sd/source/ui/view/GraphicObjectBar.cxx b/sd/source/ui/view/GraphicObjectBar.cxx index 15f037d582b0..6e20c21a04be 100644 --- a/sd/source/ui/view/GraphicObjectBar.cxx +++ b/sd/source/ui/view/GraphicObjectBar.cxx @@ -81,7 +81,7 @@ GraphicObjectBar::GraphicObjectBar ( GraphicObjectBar::~GraphicObjectBar() { - SetRepeatTarget( NULL ); + SetRepeatTarget( nullptr ); } void GraphicObjectBar::GetAttrState( SfxItemSet& rSet ) diff --git a/sd/source/ui/view/MediaObjectBar.cxx b/sd/source/ui/view/MediaObjectBar.cxx index a0df58bfecd3..3e028c9c6797 100644 --- a/sd/source/ui/view/MediaObjectBar.cxx +++ b/sd/source/ui/view/MediaObjectBar.cxx @@ -74,7 +74,7 @@ MediaObjectBar::MediaObjectBar( ViewShell* pSdViewShell, ::sd::View* pSdView ) : MediaObjectBar::~MediaObjectBar() { - SetRepeatTarget( NULL ); + SetRepeatTarget( nullptr ); } void MediaObjectBar::GetState( SfxItemSet& rSet ) @@ -119,7 +119,7 @@ void MediaObjectBar::Execute( SfxRequest& rReq ) const SfxPoolItem* pItem; if( !pArgs || ( SfxItemState::SET != pArgs->GetItemState( SID_AVMEDIA_TOOLBOX, false, &pItem ) ) ) - pItem = NULL; + pItem = nullptr; if( pItem ) { diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index 8ae295065634..04b80c290f2b 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -138,9 +138,9 @@ Outliner::Outliner( SdDrawDocument* pDoc, sal_uInt16 nMode ) : SdrOutliner( &pDoc->GetItemPool(), nMode ), mpImpl(new Implementation()), meMode(SEARCH), - mpView(NULL), + mpView(nullptr), mpWeakViewShell(), - mpWindow(NULL), + mpWindow(nullptr), mpDrawDocument(pDoc), mnConversionLanguage(LANGUAGE_NONE), mnIgnoreCurrentPageChangesLevel(0), @@ -155,17 +155,17 @@ Outliner::Outliner( SdDrawDocument* pDoc, sal_uInt16 nMode ) mbRestrictSearchToSelection(false), maMarkListCopy(), mbProcessCurrentViewOnly(false), - mpObj(NULL), - mpFirstObj(NULL), - mpTextObj(NULL), + mpObj(nullptr), + mpFirstObj(nullptr), + mpTextObj(nullptr), mnText(0), - mpParaObj(NULL), + mpParaObj(nullptr), meStartViewMode(PK_STANDARD), meStartEditMode(EM_PAGE), mnStartPageIndex((sal_uInt16)-1), - mpStartEditedObject(NULL), + mpStartEditedObject(nullptr), maStartSelection(), - mpSearchItem(NULL), + mpSearchItem(nullptr), maObjectIterator(), maCurrentPosition(), maSearchStartPosition(), @@ -260,7 +260,7 @@ void Outliner::PrepareSpelling() mbPrepareSpellingPending = false; ViewShellBase* pBase = dynamic_cast< ViewShellBase *>( SfxViewShell::Current() ); - if (pBase != NULL) + if (pBase != nullptr) SetViewShell (pBase->GetMainViewShell()); SetRefDevice( SD_MOD()->GetRefDevice( *mpDrawDocument->GetDocSh() ) ); @@ -290,7 +290,7 @@ void Outliner::StartSpelling() { meMode = SPELL; mbDirectionIsForward = true; - mpSearchItem = NULL; + mpSearchItem = nullptr; } /** Free all resources acquired during the search/spell check. After a @@ -303,7 +303,7 @@ void Outliner::EndSpelling() std::shared_ptr<ViewShell> pOldViewShell (pViewShell); ViewShellBase* pBase = dynamic_cast< ViewShellBase *>( SfxViewShell::Current() ); - if (pBase != NULL) + if (pBase != nullptr) pViewShell = pBase->GetMainViewShell(); else pViewShell.reset(); @@ -311,7 +311,7 @@ void Outliner::EndSpelling() // When in <member>PrepareSpelling()</member> a new outline view has // been created then delete it here. - bool bViewIsDrawViewShell(pViewShell && 0 != dynamic_cast< const DrawViewShell *>( pViewShell.get() )); + bool bViewIsDrawViewShell(pViewShell && nullptr != dynamic_cast< const DrawViewShell *>( pViewShell.get() )); if (bViewIsDrawViewShell) { SetStatusEventHdl(Link<EditStatus&,void>()); @@ -326,7 +326,7 @@ void Outliner::EndSpelling() // Remove and, if previously created by us, delete the outline // view. OutlinerView* pOutlinerView = mpImpl->GetOutlinerView(); - if (pOutlinerView != NULL) + if (pOutlinerView != nullptr) { RemoveView(pOutlinerView); mpImpl->ReleaseOutlinerView(); @@ -354,15 +354,15 @@ void Outliner::EndSpelling() RestoreStartPosition (); mpWeakViewShell.reset(); - mpView = NULL; - mpWindow = NULL; + mpView = nullptr; + mpWindow = nullptr; mnStartPageIndex = (sal_uInt16) -1; } bool Outliner::SpellNextDocument() { std::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock()); - if( 0 != dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) + if( nullptr != dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) { // When doing a spell check in the outline view then there is // only one document. @@ -379,7 +379,7 @@ bool Outliner::SpellNextDocument() mpWindow = pViewShell->GetActiveWindow(); OutlinerView* pOutlinerView = mpImpl->GetOutlinerView(); - if (pOutlinerView != NULL) + if (pOutlinerView != nullptr) pOutlinerView->SetWindow(mpWindow); ProvideNextTextObject (); @@ -409,7 +409,7 @@ svx::SpellPortions Outliner::GetNextSpellSentence() while ( ! bFoundNextSentence) { OutlinerView* pOutlinerView = GetView(0); - if (pOutlinerView != NULL) + if (pOutlinerView != nullptr) { ESelection aCurrentSelection (pOutlinerView->GetSelection()); if ( ! mbMatchMayExist @@ -451,11 +451,11 @@ bool Outliner::StartSearchAndReplace (const SvxSearchItem* pSearchItem) // Determine whether we have to abort the search. This is necessary // when the main view shell does not support searching. bool bAbort = false; - if (pBase != NULL) + if (pBase != nullptr) { std::shared_ptr<ViewShell> pShell (pBase->GetMainViewShell()); SetViewShell(pShell); - if (pShell.get() == NULL) + if (pShell.get() == nullptr) bAbort = true; else switch (pShell->GetShellType()) @@ -545,7 +545,7 @@ void Outliner::Initialize (bool bDirectionIsForward) // In case we are searching in an outline view then first remove the // current selection and place cursor at its start or end. - if( 0 != dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) + if( nullptr != dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) { ESelection aSelection = mpImpl->GetOutlinerView()->GetSelection (); if (mbDirectionIsForward) @@ -606,7 +606,7 @@ bool Outliner::SearchAndReplaceAll() } std::vector<SearchSelection> aSelections; - if( 0 != dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) + if( nullptr != dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) { // Put the cursor to the beginning/end of the outliner. mpImpl->GetOutlinerView()->SetSelection (GetSearchStartPosition ()); @@ -614,7 +614,7 @@ bool Outliner::SearchAndReplaceAll() // The outliner does all the work for us when we are in this mode. SearchAndReplaceOnce(); } - else if( 0 != dynamic_cast< const DrawViewShell *>( pViewShell.get() )) + else if( nullptr != dynamic_cast< const DrawViewShell *>( pViewShell.get() )) { // Go to beginning/end of document. maObjectIterator = ::sd::outliner::OutlinerContainer(this).begin(); @@ -698,20 +698,20 @@ bool Outliner::SearchAndReplaceOnce(std::vector<SearchSelection>* pSelections) DetectChange (); OutlinerView* pOutlinerView = mpImpl->GetOutlinerView(); - DBG_ASSERT(pOutlinerView!=NULL && GetEditEngine().HasView( &pOutlinerView->GetEditView() ), + DBG_ASSERT(pOutlinerView!=nullptr && GetEditEngine().HasView( &pOutlinerView->GetEditView() ), "SearchAndReplace without valid view!" ); - if( NULL == pOutlinerView || !GetEditEngine().HasView( &pOutlinerView->GetEditView() ) ) + if( nullptr == pOutlinerView || !GetEditEngine().HasView( &pOutlinerView->GetEditView() ) ) return true; std::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock()); - if (pViewShell != 0) + if (pViewShell != nullptr) { mpView = pViewShell->GetView(); mpWindow = pViewShell->GetActiveWindow(); pOutlinerView->SetWindow(mpWindow); - if( 0 != dynamic_cast< const DrawViewShell *>( pViewShell.get() )) + if( nullptr != dynamic_cast< const DrawViewShell *>( pViewShell.get() )) { // When replacing we first check if there is a selection // indicating a match. If there is then replace it. The @@ -756,7 +756,7 @@ bool Outliner::SearchAndReplaceOnce(std::vector<SearchSelection>* pSelections) } } } - else if( 0 != dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) + else if( nullptr != dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) { mpDrawDocument->GetDocSh()->SetWaitCursor(false); // The following loop is executed more than once only when a @@ -833,7 +833,7 @@ void Outliner::DetectChange() std::dynamic_pointer_cast<DrawViewShell>(pViewShell)); // Detect whether the view has been switched from the outside. - if (pDrawViewShell.get() != NULL + if (pDrawViewShell.get() != nullptr && (aPosition.meEditMode != pDrawViewShell->GetEditMode() || aPosition.mePageKind != pDrawViewShell->GetPageKind())) { @@ -841,12 +841,12 @@ void Outliner::DetectChange() SetStatusEventHdl(Link<EditStatus&,void>()); SdrPageView* pPageView = mpView->GetSdrPageView(); - if (pPageView != NULL) + if (pPageView != nullptr) mpView->UnmarkAllObj (pPageView); mpView->SdrEndTextEdit(); SetUpdateMode(false); OutlinerView* pOutlinerView = mpImpl->GetOutlinerView(); - if (pOutlinerView != NULL) + if (pOutlinerView != nullptr) pOutlinerView->SetOutputArea( Rectangle( Point(), Size(1, 1) ) ); if (meMode == SPELL) SetPaperSize( Size(1, 1) ); @@ -890,7 +890,7 @@ bool Outliner::DetectSelectionChange() // If mpObj is NULL then we have not yet found our first match. // Detecting a change makes no sense. - if (mpObj != NULL) + if (mpObj != nullptr) { const size_t nMarkCount = mpView ? mpView->GetMarkedObjectList().GetMarkCount() : 0; switch (nMarkCount) @@ -903,10 +903,10 @@ bool Outliner::DetectSelectionChange() case 1: // Check if the only selected object is not the one that we // had selected. - if (mpView != NULL) + if (mpView != nullptr) { SdrMark* pMark = mpView->GetMarkedObjectList().GetMark(0); - if (pMark != NULL) + if (pMark != nullptr) bSelectionHasChanged = (mpObj != pMark->GetMarkedSdrObj ()); } break; @@ -932,27 +932,27 @@ void Outliner::RememberStartPosition() if ( mnStartPageIndex != (sal_uInt16) -1 ) return; - if( 0 != dynamic_cast< const DrawViewShell *>( pViewShell.get() )) + if( nullptr != dynamic_cast< const DrawViewShell *>( pViewShell.get() )) { std::shared_ptr<DrawViewShell> pDrawViewShell ( std::dynamic_pointer_cast<DrawViewShell>(pViewShell)); - if (pDrawViewShell.get() != NULL) + if (pDrawViewShell.get() != nullptr) { meStartViewMode = pDrawViewShell->GetPageKind(); meStartEditMode = pDrawViewShell->GetEditMode(); mnStartPageIndex = pDrawViewShell->GetCurPageId() - 1; } - if (mpView != NULL) + if (mpView != nullptr) { mpStartEditedObject = mpView->GetTextEditObject(); - if (mpStartEditedObject != NULL) + if (mpStartEditedObject != nullptr) { // Try to retrieve current caret position only when there is an // edited object. ::Outliner* pOutliner = static_cast<DrawView*>(mpView)->GetTextEditOutliner(); - if (pOutliner!=NULL && pOutliner->GetViewCount()>0) + if (pOutliner!=nullptr && pOutliner->GetViewCount()>0) { OutlinerView* pOutlinerView = pOutliner->GetView(0); maStartSelection = pOutlinerView->GetSelection(); @@ -960,11 +960,11 @@ void Outliner::RememberStartPosition() } } } - else if( 0 != dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) + else if( nullptr != dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) { // Remember the current cursor position. OutlinerView* pView = GetView(0); - if (pView != NULL) + if (pView != nullptr) pView->GetSelection(); } else @@ -982,17 +982,17 @@ void Outliner::RestoreStartPosition() bRestore = false; // Dont't restore when the view shell is not valid. std::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock()); - if (pViewShell == 0) + if (pViewShell == nullptr) bRestore = false; if (bRestore) { - if( 0 != dynamic_cast< const DrawViewShell *>( pViewShell.get() )) + if( nullptr != dynamic_cast< const DrawViewShell *>( pViewShell.get() )) { std::shared_ptr<DrawViewShell> pDrawViewShell ( std::dynamic_pointer_cast<DrawViewShell>(pViewShell)); SetViewMode (meStartViewMode); - if (pDrawViewShell.get() != NULL) + if (pDrawViewShell.get() != nullptr) { SetPage (meStartEditMode, mnStartPageIndex); mpObj = mpStartEditedObject; @@ -1005,11 +1005,11 @@ void Outliner::RestoreStartPosition() } } } - else if( 0 != dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) + else if( nullptr != dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) { // Set cursor to its old position. OutlinerView* pView = GetView(0); - if (pView != NULL) + if (pView != nullptr) pView->SetSelection (maStartSelection); } } @@ -1038,19 +1038,19 @@ void Outliner::ProvideNextTextObject() } SetUpdateMode(false); OutlinerView* pOutlinerView = mpImpl->GetOutlinerView(); - if (pOutlinerView != NULL) + if (pOutlinerView != nullptr) pOutlinerView->SetOutputArea( Rectangle( Point(), Size(1, 1) ) ); if (meMode == SPELL) SetPaperSize( Size(1, 1) ); SetText(OUString(), GetParagraph(0)); - mpTextObj = NULL; + mpTextObj = nullptr; // Iterate until a valid text object has been found or the search ends. do { - mpObj = NULL; - mpParaObj = NULL; + mpObj = nullptr; + mpParaObj = nullptr; if (maObjectIterator != ::sd::outliner::OutlinerContainer(this).end()) { @@ -1066,12 +1066,12 @@ void Outliner::ProvideNextTextObject() } ++maObjectIterator; - if (mpObj != NULL) + if (mpObj != nullptr) { PutTextIntoOutliner (); std::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock()); - if (pViewShell != 0) + if (pViewShell != nullptr) switch (meMode) { case SEARCH: @@ -1111,7 +1111,7 @@ void Outliner::EndOfSearch() // Before we display a dialog we first jump to where the last valid text // object was found. All page and view mode switching since then was // temporary and should not be visible to the user. - if( 0 == dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) + if( nullptr == dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) SetObject (maLastValidPosition); if (mbRestrictSearchToSelection) @@ -1131,11 +1131,11 @@ void Outliner::EndOfSearch() mbMatchMayExist = false; // Everything back to beginning (or end?) of the document. maObjectIterator = ::sd::outliner::OutlinerContainer(this).begin(); - if( 0 != dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) + if( nullptr != dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) { // Set cursor to first character of the document. OutlinerView* pOutlinerView = mpImpl->GetOutlinerView(); - if (pOutlinerView != NULL) + if (pOutlinerView != nullptr) pOutlinerView->SetSelection (GetSearchStartPosition ()); } @@ -1223,7 +1223,7 @@ bool Outliner::ShowWrapArroundDialog() bool Outliner::IsValidTextObject (const ::sd::outliner::IteratorPosition& rPosition) { SdrTextObj* pObject = dynamic_cast< SdrTextObj* >( rPosition.mxObject.get() ); - return (pObject != NULL) && pObject->HasText() && ! pObject->IsEmptyPresObj(); + return (pObject != nullptr) && pObject->HasText() && ! pObject->IsEmptyPresObj(); } void Outliner::PutTextIntoOutliner() @@ -1232,9 +1232,9 @@ void Outliner::PutTextIntoOutliner() if ( mpTextObj && mpTextObj->HasText() && !mpTextObj->IsEmptyPresObj() ) { SdrText* pText = mpTextObj->getText( mnText ); - mpParaObj = pText ? pText->GetOutlinerParaObject() : NULL; + mpParaObj = pText ? pText->GetOutlinerParaObject() : nullptr; - if (mpParaObj != NULL) + if (mpParaObj != nullptr) { SetText(*mpParaObj); @@ -1243,7 +1243,7 @@ void Outliner::PutTextIntoOutliner() } else { - mpTextObj = NULL; + mpTextObj = nullptr; } } @@ -1296,7 +1296,7 @@ void Outliner::PrepareSearchAndReplace() // Start search at the right end of the current object's text // depending on the search direction. OutlinerView* pOutlinerView = mpImpl->GetOutlinerView(); - if (pOutlinerView != NULL) + if (pOutlinerView != nullptr) pOutlinerView->SetSelection (GetSearchStartPosition ()); } } @@ -1306,7 +1306,7 @@ void Outliner::SetViewMode (PageKind ePageKind) std::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock()); std::shared_ptr<DrawViewShell> pDrawViewShell( std::dynamic_pointer_cast<DrawViewShell>(pViewShell)); - if (pDrawViewShell.get()!=NULL && ePageKind != pDrawViewShell->GetPageKind()) + if (pDrawViewShell.get()!=nullptr && ePageKind != pDrawViewShell->GetPageKind()) { // Restore old edit mode. pDrawViewShell->ChangeEditMode(mpImpl->meOriginalEditMode, false); @@ -1359,8 +1359,8 @@ void Outliner::SetViewMode (PageKind ePageKind) // Save edit mode so that it can be restored when switching the view // shell again. pDrawViewShell = std::dynamic_pointer_cast<DrawViewShell>(pViewShell); - OSL_ASSERT(pDrawViewShell.get()!=NULL); - if (pDrawViewShell.get() != NULL) + OSL_ASSERT(pDrawViewShell.get()!=nullptr); + if (pDrawViewShell.get() != nullptr) mpImpl->meOriginalEditMode = pDrawViewShell->GetEditMode(); } } @@ -1372,8 +1372,8 @@ void Outliner::SetPage (EditMode eEditMode, sal_uInt16 nPageIndex) std::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock()); std::shared_ptr<DrawViewShell> pDrawViewShell( std::dynamic_pointer_cast<DrawViewShell>(pViewShell)); - OSL_ASSERT(pDrawViewShell.get()!=NULL); - if (pDrawViewShell.get() != NULL) + OSL_ASSERT(pDrawViewShell.get()!=nullptr); + if (pDrawViewShell.get() != nullptr) { pDrawViewShell->ChangeEditMode(eEditMode, false); pDrawViewShell->SwitchPage(nPageIndex); @@ -1445,7 +1445,7 @@ bool Outliner::HasNoPreviousMatch() { OutlinerView* pOutlinerView = mpImpl->GetOutlinerView(); - DBG_ASSERT (pOutlinerView!=NULL, "outline view in Outliner::HasNoPreviousMatch is NULL"); + DBG_ASSERT (pOutlinerView!=nullptr, "outline view in Outliner::HasNoPreviousMatch is NULL"); // Detect whether the cursor stands at the beginning // resp. at the end of the text. @@ -1457,7 +1457,7 @@ bool Outliner::HandleFailedSearch() bool bContinueSearch = false; OutlinerView* pOutlinerView = mpImpl->GetOutlinerView(); - if (pOutlinerView != NULL && mpSearchItem != NULL) + if (pOutlinerView != nullptr && mpSearchItem != nullptr) { // Detect whether there is/may be a prior match. If there is then // ask the user whether to wrap around. Otherwise tell the user @@ -1506,13 +1506,13 @@ void Outliner::SetViewShell (const std::shared_ptr<ViewShell>& rpViewShell) mpImpl->ProvideOutlinerView(*this, rpViewShell, mpWindow); OutlinerView* pOutlinerView = mpImpl->GetOutlinerView(); - if (pOutlinerView != NULL) + if (pOutlinerView != nullptr) pOutlinerView->SetWindow(mpWindow); } else { - mpView = NULL; - mpWindow = NULL; + mpView = nullptr; + mpWindow = nullptr; } } } @@ -1543,17 +1543,17 @@ void Outliner::StartConversion( sal_Int16 nSourceLanguage, sal_Int16 nTargetLan const vcl::Font *pTargetFont, sal_Int32 nOptions, bool bIsInteractive ) { std::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock()); - bool bMultiDoc = 0 != dynamic_cast< const DrawViewShell *>( pViewShell.get() ); + bool bMultiDoc = nullptr != dynamic_cast< const DrawViewShell *>( pViewShell.get() ); meMode = TEXT_CONVERSION; mbDirectionIsForward = true; - mpSearchItem = NULL; + mpSearchItem = nullptr; mnConversionLanguage = nSourceLanguage; BeginConversion(); OutlinerView* pOutlinerView = mpImpl->GetOutlinerView(); - if (pOutlinerView != NULL) + if (pOutlinerView != nullptr) { pOutlinerView->StartTextConversion( nSourceLanguage, @@ -1596,7 +1596,7 @@ void Outliner::BeginConversion() SetRefDevice( SD_MOD()->GetRefDevice( *mpDrawDocument->GetDocSh() ) ); ViewShellBase* pBase = dynamic_cast<ViewShellBase*>( SfxViewShell::Current() ); - if (pBase != NULL) + if (pBase != nullptr) SetViewShell (pBase->GetMainViewShell()); std::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock()); @@ -1628,7 +1628,7 @@ void Outliner::EndConversion() bool Outliner::ConvertNextDocument() { std::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock()); - if (pViewShell && 0 != dynamic_cast< const OutlineViewShell *>( pViewShell.get() ) ) + if (pViewShell && nullptr != dynamic_cast< const OutlineViewShell *>( pViewShell.get() ) ) return false; mpDrawDocument->GetDocSh()->SetWaitCursor( true ); @@ -1636,7 +1636,7 @@ bool Outliner::ConvertNextDocument() Initialize ( true ); OutlinerView* pOutlinerView = mpImpl->GetOutlinerView(); - if (pOutlinerView != NULL) + if (pOutlinerView != nullptr) { mpWindow = pViewShell->GetActiveWindow(); pOutlinerView->SetWindow(mpWindow); @@ -1669,8 +1669,8 @@ sal_uInt16 Outliner::ShowModalMessageBox (Dialog& rMessageBox) // while the message box is being shown. We also have to take into // account that we are called during a spell check and the search dialog // is not available. - vcl::Window* pSearchDialog = NULL; - SfxChildWindow* pChildWindow = NULL; + vcl::Window* pSearchDialog = nullptr; + SfxChildWindow* pChildWindow = nullptr; switch (meMode) { case SEARCH: @@ -1689,15 +1689,15 @@ sal_uInt16 Outliner::ShowModalMessageBox (Dialog& rMessageBox) break; } - if (pChildWindow != NULL) + if (pChildWindow != nullptr) pSearchDialog = pChildWindow->GetWindow(); - if (pSearchDialog != NULL) + if (pSearchDialog != nullptr) pSearchDialog->EnableInput(false); sal_uInt16 nResult = rMessageBox.Execute(); // Unlock the search dialog. - if (pSearchDialog != NULL) + if (pSearchDialog != nullptr) pSearchDialog->EnableInput(); return nResult; @@ -1708,17 +1708,17 @@ sal_uInt16 Outliner::ShowModalMessageBox (Dialog& rMessageBox) Outliner::Implementation::Implementation() : meOriginalEditMode(EM_PAGE), mbOwnOutlineView(false), - mpOutlineView(NULL) + mpOutlineView(nullptr) { } Outliner::Implementation::~Implementation() { - if (mbOwnOutlineView && mpOutlineView!=NULL) + if (mbOwnOutlineView && mpOutlineView!=nullptr) { - mpOutlineView->SetWindow(NULL); + mpOutlineView->SetWindow(nullptr); delete mpOutlineView; - mpOutlineView = NULL; + mpOutlineView = nullptr; } } @@ -1732,7 +1732,7 @@ void Outliner::Implementation::ProvideOutlinerView ( const std::shared_ptr<ViewShell>& rpViewShell, vcl::Window* pWindow) { - if (rpViewShell.get() != NULL) + if (rpViewShell.get() != nullptr) { switch (rpViewShell->GetShellType()) { @@ -1743,9 +1743,9 @@ void Outliner::Implementation::ProvideOutlinerView ( { // Create a new outline view to do the search on. bool bInsert = false; - if (mpOutlineView!=NULL && !mbOwnOutlineView) - mpOutlineView = NULL; - if (mpOutlineView == NULL) + if (mpOutlineView!=nullptr && !mbOwnOutlineView) + mpOutlineView = nullptr; + if (mpOutlineView == nullptr) { mpOutlineView = new OutlinerView(&rOutliner, pWindow); mbOwnOutlineView = true; @@ -1770,7 +1770,7 @@ void Outliner::Implementation::ProvideOutlinerView ( case ViewShell::ST_OUTLINE: { - if (mpOutlineView!=NULL && mbOwnOutlineView) + if (mpOutlineView!=nullptr && mbOwnOutlineView) delete mpOutlineView; mpOutlineView = rOutliner.GetView(0); mbOwnOutlineView = false; @@ -1791,17 +1791,17 @@ void Outliner::Implementation::ReleaseOutlinerView() if (mbOwnOutlineView) { OutlinerView* pView = mpOutlineView; - mpOutlineView = NULL; + mpOutlineView = nullptr; mbOwnOutlineView = false; - if (pView != NULL) + if (pView != nullptr) { - pView->SetWindow(NULL); + pView->SetWindow(nullptr); delete pView; } } else { - mpOutlineView = NULL; + mpOutlineView = nullptr; } } diff --git a/sd/source/ui/view/OutlinerIterator.cxx b/sd/source/ui/view/OutlinerIterator.cxx index 1186b60527c7..61f8ddd802bc 100644 --- a/sd/source/ui/view/OutlinerIterator.cxx +++ b/sd/source/ui/view/OutlinerIterator.cxx @@ -80,12 +80,12 @@ bool IteratorPosition::operator== (const IteratorPosition& aPosition) const Iterator::Iterator() { - mpIterator = NULL; + mpIterator = nullptr; } Iterator::Iterator (const Iterator& rIterator) { - mpIterator = rIterator.mpIterator ? rIterator.mpIterator->Clone() : NULL; + mpIterator = rIterator.mpIterator ? rIterator.mpIterator->Clone() : nullptr; } Iterator::Iterator (IteratorImplBase* pObject) @@ -103,23 +103,23 @@ Iterator& Iterator::operator= (const Iterator& rIterator) if (this != &rIterator) { delete mpIterator; - if (rIterator.mpIterator != NULL) + if (rIterator.mpIterator != nullptr) mpIterator = rIterator.mpIterator->Clone(); else - mpIterator = NULL; + mpIterator = nullptr; } return *this; } const IteratorPosition& Iterator::operator* () const { - DBG_ASSERT (mpIterator!=NULL, "::sd::outliner::Iterator::operator* : missing implementation object"); + DBG_ASSERT (mpIterator!=nullptr, "::sd::outliner::Iterator::operator* : missing implementation object"); return mpIterator->GetPosition(); } Iterator& Iterator::operator++ () { - if (mpIterator!=NULL) + if (mpIterator!=nullptr) mpIterator->GotoNextText(); return *this; } @@ -127,14 +127,14 @@ Iterator& Iterator::operator++ () Iterator Iterator::operator++ (int) { Iterator aTmp (*this); - if (mpIterator!=NULL) + if (mpIterator!=nullptr) mpIterator->GotoNextText(); return aTmp; } bool Iterator::operator== (const Iterator& rIterator) { - if (mpIterator == NULL || rIterator.mpIterator==NULL) + if (mpIterator == nullptr || rIterator.mpIterator==nullptr) return mpIterator == rIterator.mpIterator; else return *mpIterator == *rIterator.mpIterator; @@ -147,7 +147,7 @@ bool Iterator::operator!= (const Iterator& rIterator) void Iterator::Reverse() { - if (mpIterator != NULL) + if (mpIterator != nullptr) mpIterator->Reverse(); } @@ -334,7 +334,7 @@ sal_Int32 OutlinerContainer::GetPageIndex ( else { const SdPage* pPage = rpViewShell->GetActualPage(); - if (pPage != NULL) + if (pPage != nullptr) nPageIndex = (pPage->GetPageNum()-1)/2; else nPageIndex = 0; @@ -421,7 +421,7 @@ const IteratorPosition& IteratorImplBase::GetPosition() IteratorImplBase* IteratorImplBase::Clone (IteratorImplBase* pObject) const { - if (pObject != NULL) + if (pObject != nullptr) { pObject->maPosition = maPosition; pObject->mpDocument = mpDocument; @@ -456,7 +456,7 @@ SelectionIteratorImpl::~SelectionIteratorImpl() IteratorImplBase* SelectionIteratorImpl::Clone (IteratorImplBase* pObject) const { SelectionIteratorImpl* pIterator = static_cast<SelectionIteratorImpl*>(pObject); - if (pIterator == NULL) + if (pIterator == nullptr) pIterator = new SelectionIteratorImpl ( mrObjectList, mnObjectIndex, mpDocument, mpViewShellWeak, mbDirectionIsForward); return pIterator; @@ -546,8 +546,8 @@ ViewIteratorImpl::ViewIteratorImpl ( bool bDirectionIsForward) : IteratorImplBase (pDocument, rpViewShellWeak, bDirectionIsForward), mbPageChangeOccurred(false), - mpPage(NULL), - mpObjectIterator(NULL) + mpPage(nullptr), + mpObjectIterator(nullptr) { SetPage (nPageIndex); } @@ -561,8 +561,8 @@ ViewIteratorImpl::ViewIteratorImpl ( EditMode eEditMode) : IteratorImplBase (pDocument, rpViewShellWeak, bDirectionIsForward, ePageKind, eEditMode), mbPageChangeOccurred(false), - mpPage(NULL), - mpObjectIterator(NULL) + mpPage(nullptr), + mpObjectIterator(nullptr) { SetPage (nPageIndex); } @@ -575,23 +575,23 @@ IteratorImplBase* ViewIteratorImpl::Clone (IteratorImplBase* pObject) const { ViewIteratorImpl* pIterator = static_cast<ViewIteratorImpl*>(pObject); - if (pIterator == NULL) + if (pIterator == nullptr) pIterator = new ViewIteratorImpl ( maPosition.mnPageIndex, mpDocument, mpViewShellWeak, mbDirectionIsForward); IteratorImplBase::Clone (pObject); - if (mpObjectIterator != NULL) + if (mpObjectIterator != nullptr) { pIterator->mpObjectIterator = new SdrObjListIter(*mpPage, IM_DEEPNOGROUPS, !mbDirectionIsForward); // No direct way to set the object iterator to the current object. - pIterator->maPosition.mxObject.reset(NULL); + pIterator->maPosition.mxObject.reset(nullptr); while (pIterator->mpObjectIterator->IsMore() && pIterator->maPosition.mxObject!=maPosition.mxObject) pIterator->maPosition.mxObject.reset(pIterator->mpObjectIterator->Next()); } else - pIterator->mpObjectIterator = NULL; + pIterator->mpObjectIterator = nullptr; return pIterator; } @@ -615,10 +615,10 @@ void ViewIteratorImpl::GotoNextText() } } - if (mpObjectIterator != NULL && mpObjectIterator->IsMore()) + if (mpObjectIterator != nullptr && mpObjectIterator->IsMore()) maPosition.mxObject.reset(mpObjectIterator->Next()); else - maPosition.mxObject.reset(NULL); + maPosition.mxObject.reset(nullptr); if (!maPosition.mxObject.is() ) { @@ -627,12 +627,12 @@ void ViewIteratorImpl::GotoNextText() else SetPage (maPosition.mnPageIndex-1); - if (mpPage != NULL) + if (mpPage != nullptr) mpObjectIterator = new SdrObjListIter(*mpPage, IM_DEEPNOGROUPS, !mbDirectionIsForward); - if (mpObjectIterator!=NULL && mpObjectIterator->IsMore()) + if (mpObjectIterator!=nullptr && mpObjectIterator->IsMore()) maPosition.mxObject.reset(mpObjectIterator->Next()); else - maPosition.mxObject.reset(NULL); + maPosition.mxObject.reset(nullptr); } maPosition.mnText = 0; @@ -675,20 +675,20 @@ void ViewIteratorImpl::SetPage (sal_Int32 nPageIndex) maPosition.mePageKind); } else - mpPage = NULL; + mpPage = nullptr; } // Set up object list iterator. - if (mpPage != NULL) + if (mpPage != nullptr) mpObjectIterator = new SdrObjListIter(*mpPage, IM_DEEPNOGROUPS, ! mbDirectionIsForward); else - mpObjectIterator = NULL; + mpObjectIterator = nullptr; // Get object pointer. - if (mpObjectIterator!=NULL && mpObjectIterator->IsMore()) + if (mpObjectIterator!=nullptr && mpObjectIterator->IsMore()) maPosition.mxObject.reset( mpObjectIterator->Next() ); else - maPosition.mxObject.reset( NULL ); + maPosition.mxObject.reset( nullptr ); maPosition.mnText = 0; if( !mbDirectionIsForward && maPosition.mxObject.is() ) @@ -705,16 +705,16 @@ void ViewIteratorImpl::Reverse() IteratorImplBase::Reverse (); // Create reversed object list iterator. - if (mpObjectIterator != NULL) + if (mpObjectIterator != nullptr) delete mpObjectIterator; - if (mpPage != NULL) + if (mpPage != nullptr) mpObjectIterator = new SdrObjListIter(*mpPage, IM_DEEPNOGROUPS, ! mbDirectionIsForward); else - mpObjectIterator = NULL; + mpObjectIterator = nullptr; // Move iterator to the current object. SdrObjectWeakRef xObject = maPosition.mxObject; - maPosition.mxObject.reset(NULL); + maPosition.mxObject.reset(nullptr); if (!mpObjectIterator) return; @@ -746,7 +746,7 @@ DocumentIteratorImpl::~DocumentIteratorImpl() IteratorImplBase* DocumentIteratorImpl::Clone (IteratorImplBase* pObject) const { DocumentIteratorImpl* pIterator = static_cast<DocumentIteratorImpl*>(pObject); - if (pIterator == NULL) + if (pIterator == nullptr) pIterator = new DocumentIteratorImpl ( maPosition.mnPageIndex, maPosition.mePageKind, maPosition.meEditMode, mpDocument, mpViewShellWeak, mbDirectionIsForward); diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx index 8058cff1de90..93b9340a7200 100644 --- a/sd/source/ui/view/ToolBarManager.cxx +++ b/sd/source/ui/view/ToolBarManager.cxx @@ -368,13 +368,13 @@ ToolBarManager::~ToolBarManager() void ToolBarManager::Shutdown() { - if (mpImpl.get() != NULL) + if (mpImpl.get() != nullptr) mpImpl.reset(); } void ToolBarManager::ResetToolBars (ToolBarGroup eGroup) { - if (mpImpl.get() != NULL) + if (mpImpl.get() != nullptr) { UpdateLock aLock (shared_from_this()); mpImpl->ResetToolBars(eGroup); @@ -383,7 +383,7 @@ void ToolBarManager::ResetToolBars (ToolBarGroup eGroup) void ToolBarManager::ResetAllToolBars() { - if (mpImpl.get() != NULL) + if (mpImpl.get() != nullptr) { UpdateLock aLock (shared_from_this()); mpImpl->ResetAllToolBars(); @@ -394,7 +394,7 @@ void ToolBarManager::AddToolBar ( ToolBarGroup eGroup, const OUString& rsToolBarName) { - if (mpImpl.get() != NULL) + if (mpImpl.get() != nullptr) { UpdateLock aLock (shared_from_this()); mpImpl->AddToolBar(eGroup,rsToolBarName); @@ -405,7 +405,7 @@ void ToolBarManager::AddToolBarShell ( ToolBarGroup eGroup, ShellId nToolBarId) { - if (mpImpl.get() != NULL) + if (mpImpl.get() != nullptr) { UpdateLock aLock (shared_from_this()); mpImpl->AddToolBarShell(eGroup,nToolBarId); @@ -416,7 +416,7 @@ void ToolBarManager::RemoveToolBar ( ToolBarGroup eGroup, const OUString& rsToolBarName) { - if (mpImpl.get() != NULL) + if (mpImpl.get() != nullptr) { UpdateLock aLock (shared_from_this()); mpImpl->RemoveToolBar(eGroup,rsToolBarName); @@ -427,7 +427,7 @@ void ToolBarManager::SetToolBar ( ToolBarGroup eGroup, const OUString& rsToolBarName) { - if (mpImpl.get() != NULL) + if (mpImpl.get() != nullptr) { UpdateLock aLock (shared_from_this()); mpImpl->ResetToolBars(eGroup); @@ -439,7 +439,7 @@ void ToolBarManager::SetToolBarShell ( ToolBarGroup eGroup, ShellId nToolBarId) { - if (mpImpl.get() != NULL) + if (mpImpl.get() != nullptr) { UpdateLock aLock (shared_from_this()); mpImpl->ResetToolBars(eGroup); @@ -449,37 +449,37 @@ void ToolBarManager::SetToolBarShell ( void ToolBarManager::PreUpdate() { - if (mpImpl.get()!=NULL) + if (mpImpl.get()!=nullptr) mpImpl->PreUpdate(); } void ToolBarManager::RequestUpdate() { - if (mpImpl.get()!=NULL) + if (mpImpl.get()!=nullptr) mpImpl->RequestUpdate(); } void ToolBarManager::LockViewShellManager() { - if (mpImpl.get() != NULL) + if (mpImpl.get() != nullptr) mpImpl->LockViewShellManager(); } void ToolBarManager::LockUpdate() { - if (mpImpl.get()!=NULL) + if (mpImpl.get()!=nullptr) mpImpl->LockUpdate(); } void ToolBarManager::UnlockUpdate() { - if (mpImpl.get()!=NULL) + if (mpImpl.get()!=nullptr) mpImpl->UnlockUpdate(); } void ToolBarManager::MainViewShellChanged (ViewShell::ShellType nShellType) { - if (mpImpl.get() != NULL) + if (mpImpl.get() != nullptr) { mpImpl->ReleaseAllToolBarShells(); mpImpl->GetToolBarRules().MainViewShellChanged(nShellType); @@ -488,7 +488,7 @@ void ToolBarManager::MainViewShellChanged (ViewShell::ShellType nShellType) void ToolBarManager::MainViewShellChanged (const ViewShell& rMainViewShell) { - if (mpImpl.get() != NULL) + if (mpImpl.get() != nullptr) { mpImpl->ReleaseAllToolBarShells(); mpImpl->GetToolBarRules().MainViewShellChanged(rMainViewShell); @@ -499,13 +499,13 @@ void ToolBarManager::SelectionHasChanged ( const ViewShell& rViewShell, const SdrView& rView) { - if (mpImpl.get() != NULL) + if (mpImpl.get() != nullptr) mpImpl->GetToolBarRules().SelectionHasChanged(rViewShell,rView); } void ToolBarManager::ToolBarsDestroyed() { - if (mpImpl.get() != NULL) + if (mpImpl.get() != nullptr) mpImpl->ToolBarsDestroyed(); } @@ -524,15 +524,15 @@ ToolBarManager::Implementation::Implementation ( mbIsValid(false), maToolBarList(), maToolBarShellList(), - mxLayouter(NULL), + mxLayouter(nullptr), mnLockCount(0), mbPreUpdatePending(false), mbPostUpdatePending(false), mpSynchronousLayouterLock(), mpAsynchronousLayouterLock(), mpViewShellManagerLock(), - mnPendingUpdateCall(0), - mnPendingSetValidCall(0), + mnPendingUpdateCall(nullptr), + mnPendingSetValidCall(nullptr), maToolBarRules(rpToolBarManager,rpViewShellManager) { Link<tools::EventMultiplexerEvent&,void> aLink (LINK(this,ToolBarManager::Implementation,EventMultiplexerCallback)); @@ -554,9 +554,9 @@ ToolBarManager::Implementation::~Implementation() mpEventMultiplexer->RemoveEventListener(aLink); // Abort pending user calls. - if (mnPendingUpdateCall != 0) + if (mnPendingUpdateCall != nullptr) Application::RemoveUserEvent(mnPendingUpdateCall); - if (mnPendingSetValidCall != 0) + if (mnPendingSetValidCall != nullptr) Application::RemoveUserEvent(mnPendingSetValidCall); } @@ -577,7 +577,7 @@ void ToolBarManager::Implementation::SetValid (bool bValid) if (mbIsValid) { Reference<frame::XFrame> xFrame; - if (mrBase.GetViewFrame() != NULL) + if (mrBase.GetViewFrame() != nullptr) xFrame = mrBase.GetViewFrame()->GetFrame().GetFrameInterface(); try { @@ -594,7 +594,7 @@ void ToolBarManager::Implementation::SetValid (bool bValid) else { ResetAllToolBars(); - mxLayouter = NULL; + mxLayouter = nullptr; } } } @@ -651,7 +651,7 @@ void ToolBarManager::Implementation::AddToolBarShell ( ShellId nToolBarId) { ViewShell* pMainViewShell = mrBase.GetMainViewShell().get(); - if (pMainViewShell != NULL) + if (pMainViewShell != nullptr) { maToolBarShellList.AddShellId(eGroup,nToolBarId); GetToolBarRules().SubShellAdded(eGroup, nToolBarId); @@ -666,7 +666,7 @@ void ToolBarManager::Implementation::ReleaseAllToolBarShells() void ToolBarManager::Implementation::RequestUpdate() { - if (mnPendingUpdateCall == 0) + if (mnPendingUpdateCall == nullptr) { mnPendingUpdateCall = Application::PostUserEvent( LINK(this,ToolBarManager::Implementation,UpdateCallback)); @@ -738,7 +738,7 @@ void ToolBarManager::Implementation::PostUpdate() void ToolBarManager::Implementation::LockViewShellManager() { - if (mpViewShellManagerLock.get() == NULL) + if (mpViewShellManagerLock.get() == nullptr) mpViewShellManagerLock.reset( new ViewShellManager::UpdateLock(mrBase.GetViewShellManager())); } @@ -751,7 +751,7 @@ void ToolBarManager::Implementation::LockUpdate() DBG_ASSERT(mnLockCount<100, "ToolBarManager lock count unusually high"); if (mnLockCount == 0) { - OSL_ASSERT(mpSynchronousLayouterLock.get()==NULL); + OSL_ASSERT(mpSynchronousLayouterLock.get()==nullptr); mpSynchronousLayouterLock.reset(new LayouterLock(mxLayouter)); } @@ -784,10 +784,10 @@ void ToolBarManager::Implementation::Update ( // initialization (by initializing the mxLayouter member.) We do // this here so that we do not have to wait for the next Update() // call to show the tool bars. - if (mnPendingSetValidCall != 0) + if (mnPendingSetValidCall != nullptr) { Application::RemoveUserEvent(mnPendingSetValidCall); - mnPendingSetValidCall = 0; + mnPendingSetValidCall = nullptr; SetValid(true); } @@ -803,7 +803,7 @@ void ToolBarManager::Implementation::Update ( // functionality. Those that are not used anymore are // deactivated now. Those that are missing are activated in the // next step together with the view shells. - if (mpViewShellManagerLock.get() == NULL) + if (mpViewShellManagerLock.get() == nullptr) mpViewShellManagerLock.reset( new ViewShellManager::UpdateLock(mrBase.GetViewShellManager())); maToolBarShellList.UpdateShells( @@ -828,7 +828,7 @@ void ToolBarManager::Implementation::Update ( // Note that the lock count may have been increased since // entering this method. In that case one of the next // UnlockUpdate() calls will post the UpdateCallback. - if (mnPendingUpdateCall==0 && mnLockCount==0) + if (mnPendingUpdateCall==nullptr && mnLockCount==0) { mpAsynchronousLayouterLock = std::move(pLocalLayouterLock); mnPendingUpdateCall = Application::PostUserEvent( @@ -849,7 +849,7 @@ void ToolBarManager::Implementation::Update ( IMPL_LINK_NOARG_TYPED(ToolBarManager::Implementation, UpdateCallback, void*, void) { - mnPendingUpdateCall = 0; + mnPendingUpdateCall = nullptr; if (mnLockCount == 0) { if (mbPreUpdatePending) @@ -867,7 +867,7 @@ IMPL_LINK_TYPED(ToolBarManager::Implementation,EventMultiplexerCallback, switch (rEvent.meEventId) { case tools::EventMultiplexerEvent::EID_CONTROLLER_ATTACHED: - if (mnPendingSetValidCall == 0) + if (mnPendingSetValidCall == nullptr) mnPendingSetValidCall = Application::PostUserEvent(LINK(this,Implementation,SetValidCallback)); break; @@ -884,7 +884,7 @@ IMPL_LINK_TYPED(ToolBarManager::Implementation,EventMultiplexerCallback, IMPL_LINK_NOARG_TYPED(ToolBarManager::Implementation, SetValidCallback, void*, void) { - mnPendingSetValidCall = 0; + mnPendingSetValidCall = nullptr; SetValid(true); } @@ -905,15 +905,15 @@ bool ToolBarManager::Implementation::CheckPlugInMode (const OUString& rsName) co do { SfxObjectShell* pObjectShell = mrBase.GetObjectShell(); - if (pObjectShell == NULL) + if (pObjectShell == nullptr) break; SfxMedium* pMedium = pObjectShell->GetMedium(); - if (pMedium == NULL) + if (pMedium == nullptr) break; const SfxBoolItem* pViewOnlyItem = SfxItemSet::GetItem<SfxBoolItem>(pMedium->GetItemSet(), SID_VIEWONLY, false); - if (pViewOnlyItem == NULL) + if (pViewOnlyItem == nullptr) break; bIsPlugInMode = pViewOnlyItem->GetValue(); @@ -964,7 +964,7 @@ ToolBarRules::ToolBarRules ( void ToolBarRules::Update (ViewShellBase& rBase) { ViewShell* pMainViewShell = rBase.GetMainViewShell().get(); - if (pMainViewShell != NULL) + if (pMainViewShell != nullptr) { MainViewShellChanged(pMainViewShell->GetShellType()); if (pMainViewShell->GetView()) @@ -1054,7 +1054,7 @@ void ToolBarRules::MainViewShellChanged (const ViewShell& rMainViewShell) { const DrawViewShell* pDrawViewShell = dynamic_cast<const DrawViewShell*>(&rMainViewShell); - if (pDrawViewShell != NULL) + if (pDrawViewShell != nullptr) { if (pDrawViewShell->GetEditMode() == EM_MASTERPAGE) mpToolBarManager->AddToolBar( @@ -1400,7 +1400,7 @@ void ToolBarShellList::UpdateShells ( const std::shared_ptr<ViewShell>& rpMainViewShell, const std::shared_ptr<ViewShellManager>& rpManager) { - if (rpMainViewShell.get() != NULL) + if (rpMainViewShell.get() != nullptr) { GroupedShellList aList; diff --git a/sd/source/ui/view/ViewClipboard.cxx b/sd/source/ui/view/ViewClipboard.cxx index 063dfaf69ff0..d6fd07e9cb16 100644 --- a/sd/source/ui/view/ViewClipboard.cxx +++ b/sd/source/ui/view/ViewClipboard.cxx @@ -50,7 +50,7 @@ void ViewClipboard::HandlePageDrop (const SdTransferable& rTransferable) // Determine whether to insert the given set of slides or to assign a // given master page. SdPage* pMasterPage = GetFirstMasterPage (rTransferable); - if (pMasterPage != NULL) + if (pMasterPage != nullptr) AssignMasterPage (rTransferable, pMasterPage); else InsertSlides (rTransferable, DetermineInsertPosition (rTransferable)); @@ -58,7 +58,7 @@ void ViewClipboard::HandlePageDrop (const SdTransferable& rTransferable) SdPage* ViewClipboard::GetFirstMasterPage (const SdTransferable& rTransferable) { - SdPage* pFirstMasterPage = NULL; + SdPage* pFirstMasterPage = nullptr; if (rTransferable.HasPageBookmarks()) { @@ -70,11 +70,11 @@ SdPage* ViewClipboard::GetFirstMasterPage (const SdTransferable& rTransferable) break; DrawDocShell* pDocShell = rTransferable.GetPageDocShell(); - if (pDocShell == NULL) + if (pDocShell == nullptr) break; SdDrawDocument* pDocument = pDocShell->GetDoc(); - if (pDocument == NULL) + if (pDocument == nullptr) break; std::vector<OUString>::const_iterator pIter; @@ -92,10 +92,10 @@ SdPage* ViewClipboard::GetFirstMasterPage (const SdTransferable& rTransferable) { // At least one regular slide: return NULL to indicate // that not all bookmarks point to master pages. - pFirstMasterPage = NULL; + pFirstMasterPage = nullptr; break; } - else if (pFirstMasterPage == NULL) + else if (pFirstMasterPage == nullptr) { // Remember the first master page for later. if (nBMPage != SDRPAGE_NOTFOUND) @@ -114,16 +114,16 @@ void ViewClipboard::AssignMasterPage ( const SdTransferable& rTransferable, SdPage* pMasterPage) { - if (pMasterPage == NULL) + if (pMasterPage == nullptr) return; // Get the target page to which the master page is assigned. SdrPageView* pPageView = mrView.GetSdrPageView(); - if (pPageView == NULL) + if (pPageView == nullptr) return; SdPage* pPage = static_cast<SdPage*>(pPageView->GetPage()); - if (pPage == NULL) + if (pPage == nullptr) return; SdDrawDocument& rDocument = mrView.GetDoc(); @@ -132,11 +132,11 @@ void ViewClipboard::AssignMasterPage ( return; DrawDocShell* pDataDocShell = rTransferable.GetPageDocShell(); - if (pDataDocShell == NULL) + if (pDataDocShell == nullptr) return; SdDrawDocument* pSourceDocument = pDataDocShell->GetDoc(); - if (pSourceDocument == NULL) + if (pSourceDocument == nullptr) return; // We have to remove the layout suffix from the layout name which is @@ -186,7 +186,7 @@ sal_uInt16 ViewClipboard::InsertSlides ( bool bMergeMasterPages = !rTransferable.HasSourceDoc( &rDoc ); // Prepare the insertion. - const std::vector<OUString> *pBookmarkList = NULL; + const std::vector<OUString> *pBookmarkList = nullptr; DrawDocShell* pDataDocSh; if (rTransferable.HasPageBookmarks()) { @@ -204,7 +204,7 @@ sal_uInt16 ViewClipboard::InsertSlides ( pDataDocSh = static_cast<DrawDocShell*>(pShell); SdDrawDocument* pDataDoc = pDataDocSh->GetDoc(); - if (pDataDoc!=NULL && pDataDoc->GetSdPageCount(PK_STANDARD)) + if (pDataDoc!=nullptr && pDataDoc->GetSdPageCount(PK_STANDARD)) nInsertPgCnt = pDataDoc->GetSdPageCount(PK_STANDARD); } if (nInsertPgCnt > 0) @@ -218,7 +218,7 @@ sal_uInt16 ViewClipboard::InsertSlides ( rDoc.InsertBookmarkAsPage( pBookmarkList ? *pBookmarkList : std::vector<OUString>(), - NULL, + nullptr, false, false, nInsertPosition, diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 58d75681656e..6cc54d5746b1 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -235,8 +235,8 @@ ViewShellBase::ViewShellBase ( | SfxViewShellFlags::HAS_PRINTOPTIONS), maMutex(), mpImpl(), - mpDocShell (NULL), - mpDocument (NULL) + mpDocShell (nullptr), + mpDocument (nullptr) { mpImpl.reset(new Implementation(*this)); mpImpl->mpViewWindow = VclPtr<FocusForwardingWindow>::Create(_pFrame->GetWindow(),*this); @@ -245,10 +245,10 @@ ViewShellBase::ViewShellBase ( _pFrame->GetWindow().SetBackground(Application::GetSettings().GetStyleSettings().GetLightColor()); // Set up the members in the correct order. - if (0 != dynamic_cast< DrawDocShell *>( GetViewFrame()->GetObjectShell() )) + if (nullptr != dynamic_cast< DrawDocShell *>( GetViewFrame()->GetObjectShell() )) mpDocShell = static_cast<DrawDocShell*>( GetViewFrame()->GetObjectShell()); - if (mpDocShell != NULL) + if (mpDocShell != nullptr) mpDocument = mpDocShell->GetDoc(); mpImpl->mpViewShellManager.reset(new ViewShellManager(*this)); @@ -270,15 +270,15 @@ ViewShellBase::~ViewShellBase() xSlideShow.clear(); // Tell the controller that the ViewShellBase is not available anymore. - if (mpImpl->mpController.get() != NULL) + if (mpImpl->mpController.get() != nullptr) mpImpl->mpController->ReleaseViewShellBase(); // We have to hide the main window to prevent SFX complaining after a // reload about it being already visible. ViewShell* pShell = GetMainViewShell().get(); - if (pShell!=NULL - && pShell->GetActiveWindow()!=NULL - && pShell->GetActiveWindow()->GetParent()!=NULL) + if (pShell!=nullptr + && pShell->GetActiveWindow()!=nullptr + && pShell->GetActiveWindow()->GetParent()!=nullptr) { pShell->GetActiveWindow()->GetParent()->Hide(); } @@ -289,7 +289,7 @@ ViewShellBase::~ViewShellBase() EndListening(*GetViewFrame()); EndListening(*GetDocShell()); - SetWindow(NULL); + SetWindow(nullptr); mpImpl->mpFormShellManager.reset(); } @@ -337,7 +337,7 @@ void ViewShellBase::LateInit (const OUString& rsDefaultView) // has been created. sd::framework::ConfigurationController* pConfigurationController = dynamic_cast<sd::framework::ConfigurationController*>(xConfigurationController.get()); - if (pConfigurationController != NULL) + if (pConfigurationController != nullptr) { while ( ! pConfigurationController->getResource(xCenterViewId).is() @@ -359,10 +359,10 @@ void ViewShellBase::LateInit (const OUString& rsDefaultView) // Remember the type of the current main view shell in the frame view. ViewShell* pViewShell = GetMainViewShell().get(); - if (pViewShell != NULL) + if (pViewShell != nullptr) { FrameView* pFrameView = pViewShell->GetFrameView(); - if (pFrameView != NULL) + if (pFrameView != nullptr) pFrameView->SetViewShellTypeOnLoad(pViewShell->GetShellType()); } } @@ -377,7 +377,7 @@ std::shared_ptr<ViewShell> ViewShellBase::GetMainViewShell() const std::shared_ptr<ViewShell> pMainViewShell ( framework::FrameworkHelper::Instance(*const_cast<ViewShellBase*>(this)) ->GetViewShell(framework::FrameworkHelper::msCenterPaneURL)); - if (pMainViewShell.get() == NULL) + if (pMainViewShell.get() == nullptr) pMainViewShell = framework::FrameworkHelper::Instance(*const_cast<ViewShellBase*>(this)) ->GetViewShell(framework::FrameworkHelper::msFullScreenPaneURL); return pMainViewShell; @@ -385,14 +385,14 @@ std::shared_ptr<ViewShell> ViewShellBase::GetMainViewShell() const ViewShellBase* ViewShellBase::GetViewShellBase (SfxViewFrame* pViewFrame) { - ViewShellBase* pBase = NULL; + ViewShellBase* pBase = nullptr; - if (pViewFrame != NULL) + if (pViewFrame != nullptr) { // Get the view shell for the frame and cast it to // sd::ViewShellBase. SfxViewShell* pSfxViewShell = pViewFrame->GetViewShell(); - if (pSfxViewShell!=NULL && dynamic_cast< ::sd::ViewShellBase *>( pSfxViewShell ) != nullptr) + if (pSfxViewShell!=nullptr && dynamic_cast< ::sd::ViewShellBase *>( pSfxViewShell ) != nullptr) pBase = static_cast<ViewShellBase*>(pSfxViewShell); } @@ -474,13 +474,13 @@ void ViewShellBase::OuterResizePixel (const Point& rOrigin, const Size &rSize) void ViewShellBase::Rearrange() { - OSL_ASSERT(GetViewFrame()!=NULL); + OSL_ASSERT(GetViewFrame()!=nullptr); // There is a bug in the communication between embedded objects and the // framework::LayoutManager that leads to missing resize updates. The // following workaround enforces such an update by cycling the border to // zero and back to the current value. - if (GetWindow() != NULL) + if (GetWindow() != nullptr) { SetBorderPixel(SvBorder()); UpdateBorder(true); @@ -498,7 +498,7 @@ ErrCode ViewShellBase::DoVerb (long nVerb) ErrCode aResult = ERRCODE_NONE; ::sd::ViewShell* pShell = GetMainViewShell().get(); - if (pShell != NULL) + if (pShell != nullptr) aResult = pShell->DoVerb (nVerb); return aResult; @@ -513,7 +513,7 @@ Reference<view::XRenderable> ViewShellBase::GetRenderable() SfxPrinter* ViewShellBase::GetPrinter (bool bCreate) { - OSL_ASSERT(mpImpl.get()!=NULL); + OSL_ASSERT(mpImpl.get()!=nullptr); return GetDocShell()->GetPrinter (bCreate); } @@ -523,7 +523,7 @@ sal_uInt16 ViewShellBase::SetPrinter ( SfxPrinterChangeFlags nDiffFlags, bool bIsAPI) { - OSL_ASSERT(mpImpl.get()!=NULL); + OSL_ASSERT(mpImpl.get()!=nullptr); GetDocShell()->SetPrinter(pNewPrinter); @@ -660,7 +660,7 @@ void ViewShellBase::GetState (SfxItemSet& rSet) { mpImpl->GetSlotState(rSet); - FuBullet::GetSlotState( rSet, 0, GetViewFrame() ); + FuBullet::GetSlotState( rSet, nullptr, GetViewFrame() ); } void ViewShellBase::WriteUserDataSequence ( @@ -669,7 +669,7 @@ void ViewShellBase::WriteUserDataSequence ( { // Forward call to main sub shell. ViewShell* pShell = GetMainViewShell().get(); - if (pShell != NULL) + if (pShell != nullptr) pShell->WriteUserDataSequence (rSequence, bBrowse); } @@ -679,7 +679,7 @@ void ViewShellBase::ReadUserDataSequence ( { // Forward call to main sub shell. ViewShell* pShell = GetMainViewShell().get(); - if (pShell != NULL) + if (pShell != nullptr) { pShell->ReadUserDataSequence (rSequence, bBrowse); @@ -746,7 +746,7 @@ void ViewShellBase::SetZoomFactor ( SfxViewShell::SetZoomFactor (rZoomX, rZoomY); // Forward call to main sub shell. ViewShell* pShell = GetMainViewShell().get(); - if (pShell != NULL) + if (pShell != nullptr) pShell->SetZoomFactor (rZoomX, rZoomY); } @@ -760,7 +760,7 @@ bool ViewShellBase::PrepareClose (bool bUI) // Forward call to main sub shell. ViewShell* pShell = GetMainViewShell().get(); - if (pShell != NULL) + if (pShell != nullptr) bResult = pShell->PrepareClose (bUI); } @@ -773,7 +773,7 @@ void ViewShellBase::WriteUserData (OUString& rString, bool bBrowse) // Forward call to main sub shell. ViewShell* pShell = GetMainViewShell().get(); - if (pShell != NULL) + if (pShell != nullptr) pShell->WriteUserData (rString); } @@ -783,7 +783,7 @@ void ViewShellBase::ReadUserData (const OUString& rString, bool bBrowse) // Forward call to main sub shell. ViewShell* pShell = GetMainViewShell().get(); - if (pShell != NULL) + if (pShell != nullptr) pShell->ReadUserData (rString); } @@ -791,7 +791,7 @@ SdrView* ViewShellBase::GetDrawView() const { // Forward call to main sub shell. ViewShell* pShell = GetMainViewShell().get(); - if (pShell != NULL) + if (pShell != nullptr) return pShell->GetDrawView (); else return SfxViewShell::GetDrawView(); @@ -804,7 +804,7 @@ void ViewShellBase::AdjustPosSizePixel (const Point &rOfs, const Size &rSize) void ViewShellBase::SetBusyState (bool bBusy) { - if (GetDocShell() != NULL) + if (GetDocShell() != nullptr) GetDocShell()->SetWaitCursor (bBusy); } @@ -817,7 +817,7 @@ void ViewShellBase::UpdateBorder ( bool bForce /* = false */ ) // We have to check the existence of the window, too. // The SfxViewFrame accesses the window without checking it. ViewShell* pMainViewShell = GetMainViewShell().get(); - if (pMainViewShell != NULL && GetWindow()!=NULL) + if (pMainViewShell != nullptr && GetWindow()!=nullptr) { SvBorder aCurrentBorder (GetBorderPixel()); bool bOuterResize ( ! GetDocShell()->IsInPlaceActive()); @@ -838,7 +838,7 @@ void ViewShellBase::ShowUIControls (bool bVisible) mpImpl->mpViewTabBar->GetTabControl()->Show(bVisible); ViewShell* pMainViewShell = GetMainViewShell().get(); - if (pMainViewShell != NULL) + if (pMainViewShell != nullptr) pMainViewShell->ShowUIControls (bVisible); UpdateBorder(); @@ -911,8 +911,8 @@ OUString ViewShellBase::GetInitialViewShellType() std::shared_ptr<tools::EventMultiplexer> ViewShellBase::GetEventMultiplexer() { - OSL_ASSERT(mpImpl.get()!=NULL); - OSL_ASSERT(mpImpl->mpEventMultiplexer.get()!=NULL); + OSL_ASSERT(mpImpl.get()!=nullptr); + OSL_ASSERT(mpImpl->mpEventMultiplexer.get()!=nullptr); return mpImpl->mpEventMultiplexer; } @@ -924,37 +924,37 @@ const Rectangle& ViewShellBase::getClientRectangle() const std::shared_ptr<ToolBarManager> ViewShellBase::GetToolBarManager() const { - OSL_ASSERT(mpImpl.get()!=NULL); - OSL_ASSERT(mpImpl->mpToolBarManager.get()!=NULL); + OSL_ASSERT(mpImpl.get()!=nullptr); + OSL_ASSERT(mpImpl->mpToolBarManager.get()!=nullptr); return mpImpl->mpToolBarManager; } std::shared_ptr<FormShellManager> ViewShellBase::GetFormShellManager() const { - OSL_ASSERT(mpImpl.get()!=NULL); - OSL_ASSERT(mpImpl->mpFormShellManager.get()!=NULL); + OSL_ASSERT(mpImpl.get()!=nullptr); + OSL_ASSERT(mpImpl->mpFormShellManager.get()!=nullptr); return mpImpl->mpFormShellManager; } DrawController& ViewShellBase::GetDrawController() const { - OSL_ASSERT(mpImpl.get()!=NULL); + OSL_ASSERT(mpImpl.get()!=nullptr); return *mpImpl->mpController; } void ViewShellBase::SetViewTabBar (const ::rtl::Reference<ViewTabBar>& rViewTabBar) { - OSL_ASSERT(mpImpl.get()!=NULL); + OSL_ASSERT(mpImpl.get()!=nullptr); mpImpl->mpViewTabBar = rViewTabBar; } vcl::Window* ViewShellBase::GetViewWindow() { - OSL_ASSERT(mpImpl.get()!=NULL); + OSL_ASSERT(mpImpl.get()!=nullptr); return mpImpl->mpViewWindow.get(); } @@ -1022,8 +1022,8 @@ ViewShellBase::Implementation::Implementation (ViewShellBase& rBase) ViewShellBase::Implementation::~Implementation() { - mpController = NULL; - mpViewTabBar = NULL; + mpController = nullptr; + mpViewTabBar = nullptr; mpViewWindow.disposeAndClear(); mpToolBarManager.reset(); } @@ -1036,10 +1036,10 @@ void ViewShellBase::Implementation::LateInit() void ViewShellBase::Implementation::ProcessRestoreEditingViewSlot() { ViewShell* pViewShell = mrBase.GetMainViewShell().get(); - if (pViewShell != NULL) + if (pViewShell != nullptr) { FrameView* pFrameView = pViewShell->GetFrameView(); - if (pFrameView != NULL) + if (pFrameView != nullptr) { // Set view shell, edit mode, and page kind. pFrameView->SetViewShEditMode( @@ -1086,7 +1086,7 @@ void ViewShellBase::Implementation::ResizePixel ( // Calculate and set the border before the controls are placed. SvBorder aBorder; - if (pMainViewShell != NULL) + if (pMainViewShell != nullptr) aBorder = pMainViewShell->GetBorder(bOuterResize); aBorder += mrBase.GetBorder(bOuterResize); if (mrBase.GetBorderPixel() != aBorder) @@ -1134,7 +1134,7 @@ void ViewShellBase::Implementation::SetPaneVisibility ( const SfxItemSet* pArguments = rRequest.GetArgs(); bool bShowChildWindow; sal_uInt16 nSlotId = rRequest.GetSlot(); - if (pArguments != NULL) + if (pArguments != nullptr) bShowChildWindow = static_cast<const SfxBoolItem&>( pArguments->Get(nSlotId)).GetValue(); else @@ -1318,14 +1318,14 @@ CurrentPageSetter::CurrentPageSetter (ViewShellBase& rBase) void CurrentPageSetter::operator() (bool) { - FrameView* pFrameView = NULL; + FrameView* pFrameView = nullptr; - if (mrBase.GetMainViewShell() != 0) + if (mrBase.GetMainViewShell() != nullptr) { pFrameView = mrBase.GetMainViewShell()->GetFrameView(); } - if (pFrameView!=NULL) + if (pFrameView!=nullptr) { try { @@ -1395,10 +1395,10 @@ void FocusForwardingWindow::dispose() void FocusForwardingWindow::KeyInput (const KeyEvent& rKEvt) { std::shared_ptr<ViewShell> pViewShell = mrBase.GetMainViewShell(); - if (pViewShell.get() != NULL) + if (pViewShell.get() != nullptr) { vcl::Window* pWindow = pViewShell->GetActiveWindow(); - if (pWindow != NULL) + if (pWindow != nullptr) { // Forward the focus so that the window is called directly the // next time. @@ -1412,10 +1412,10 @@ void FocusForwardingWindow::KeyInput (const KeyEvent& rKEvt) void FocusForwardingWindow::Command (const CommandEvent& rEvent) { std::shared_ptr<ViewShell> pViewShell = mrBase.GetMainViewShell(); - if (pViewShell.get() != NULL) + if (pViewShell.get() != nullptr) { vcl::Window* pWindow = pViewShell->GetActiveWindow(); - if (pWindow != NULL) + if (pWindow != nullptr) { pWindow->Command(rEvent); } diff --git a/sd/source/ui/view/ViewShellImplementation.cxx b/sd/source/ui/view/ViewShellImplementation.cxx index 4df152a283d1..b523e03d5345 100644 --- a/sd/source/ui/view/ViewShellImplementation.cxx +++ b/sd/source/ui/view/ViewShellImplementation.cxx @@ -78,7 +78,7 @@ ViewShell::Implementation::~Implementation() if ( ! mpUpdateLockForMouse.expired()) { std::shared_ptr<ToolBarManagerLock> pLock(mpUpdateLockForMouse); - if (pLock.get() != NULL) + if (pLock.get() != nullptr) { // Force the ToolBarManagerLock to be released even when the // IsUICaptured() returns <TRUE/>. @@ -98,7 +98,7 @@ void ViewShell::Implementation::ProcessModifyPageSlot ( sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(SD_RESSTR(STR_LAYER_BCKGRNDOBJ), false); SetOfByte aVisibleLayers; bool bHandoutMode = false; - SdPage* pHandoutMPage = NULL; + SdPage* pHandoutMPage = nullptr; OUString aNewName; AutoLayout aNewAutoLayout; @@ -107,14 +107,14 @@ void ViewShell::Implementation::ProcessModifyPageSlot ( bool bBObjsVisible; const SfxItemSet* pArgs = rRequest.GetArgs(); - if (pCurrentPage != NULL && pCurrentPage->TRG_HasMasterPage()) + if (pCurrentPage != nullptr && pCurrentPage->TRG_HasMasterPage()) aVisibleLayers = pCurrentPage->TRG_GetMasterPageVisibleLayers(); else aVisibleLayers.SetAll(); do { - if (pCurrentPage == NULL) + if (pCurrentPage == nullptr) break; if (!pArgs || pArgs->Count() == 1 || pArgs->Count() == 2 ) @@ -192,7 +192,7 @@ void ViewShell::Implementation::ProcessModifyPageSlot ( { sal_uInt16 nPage = (pCurrentPage->GetPageNum()-1) / 2; SdPage* pNotesPage = pDocument->GetSdPage(nPage, PK_NOTES); - if (pNotesPage != NULL) + if (pNotesPage != nullptr) pNotesPage->SetName(aNewName); } } @@ -241,13 +241,13 @@ void ViewShell::Implementation::AssignLayout ( SfxRequest& rRequest, PageKind eP if( !pDocument ) return; - SdPage* pPage = 0; + SdPage* pPage = nullptr; if( pWhatPage ) { pPage = pDocument->GetSdPage(static_cast<sal_uInt16>(pWhatPage->GetValue()), ePageKind); } - if( pPage == 0 ) + if( pPage == nullptr ) pPage = mrViewShell.getCurrentPage(); if( pPage ) @@ -314,10 +314,10 @@ sal_uInt16 ViewShell::Implementation::GetViewId() SvxIMapDlg* ViewShell::Implementation::GetImageMapDialog() { - SvxIMapDlg* pDialog = NULL; + SvxIMapDlg* pDialog = nullptr; SfxChildWindow* pChildWindow = SfxViewFrame::Current()->GetChildWindow( SvxIMapDlgChildWindow::GetChildWindowId()); - if (pChildWindow != NULL) + if (pChildWindow != nullptr) pDialog = dynamic_cast<SvxIMapDlg*>(pChildWindow->GetWindow()); return pDialog; } diff --git a/sd/source/ui/view/ViewShellManager.cxx b/sd/source/ui/view/ViewShellManager.cxx index 3def66fa7213..ded5aa5d3349 100644 --- a/sd/source/ui/view/ViewShellManager.cxx +++ b/sd/source/ui/view/ViewShellManager.cxx @@ -265,7 +265,7 @@ void ViewShellManager::ActivateViewShell (ViewShell* pViewShell) void ViewShellManager::DeactivateViewShell (const ViewShell* pShell) { - if (mbValid && pShell!=NULL) + if (mbValid && pShell!=nullptr) mpImpl->DeactivateViewShell(*pShell); } @@ -298,13 +298,13 @@ void ViewShellManager::InvalidateAllSubShells (ViewShell* pViewShell) void ViewShellManager::ActivateShell (SfxShell* pShell) { - if (mbValid && pShell!=NULL) + if (mbValid && pShell!=nullptr) mpImpl->ActivateShell(*pShell); } void ViewShellManager::DeactivateShell (const SfxShell* pShell) { - if (mbValid && pShell!=NULL) + if (mbValid && pShell!=nullptr) mpImpl->DeactivateShell(*pShell); } @@ -319,7 +319,7 @@ SfxShell* ViewShellManager::GetShell (ShellId nId) const if (mbValid) return mpImpl->GetShell(nId); else - return NULL; + return nullptr; } SfxShell* ViewShellManager::GetTopShell() const @@ -327,7 +327,7 @@ SfxShell* ViewShellManager::GetTopShell() const if (mbValid) return mpImpl->GetTopShell(); else - return NULL; + return nullptr; } SfxShell* ViewShellManager::GetTopViewShell() const @@ -335,7 +335,7 @@ SfxShell* ViewShellManager::GetTopViewShell() const if (mbValid) return mpImpl->GetTopViewShell(); else - return NULL; + return nullptr; } void ViewShellManager::Shutdown() @@ -369,11 +369,11 @@ ViewShellManager::Implementation::Implementation ( mnUpdateLockCount(0), mbKeepMainViewShellOnTop(false), mbShellStackIsUpToDate(true), - mpFormShell(NULL), - mpFormShellParent(NULL), + mpFormShell(nullptr), + mpFormShellParent(nullptr), mbFormShellAboveParent(true), - mpTopShell(NULL), - mpTopViewShell(NULL) + mpTopShell(nullptr), + mpTopViewShell(nullptr) { (void)rManager; } @@ -427,10 +427,10 @@ void ViewShellManager::Implementation::ActivateViewShell (ViewShell* pViewShell) // Register as window listener so that the shells of the current // window can be moved to the top of the shell stack. - if (aResult.mpShell != NULL) + if (aResult.mpShell != nullptr) { vcl::Window* pWindow = aResult.GetWindow(); - if (pWindow != NULL) + if (pWindow != nullptr) { pWindow->AddEventListener( LINK(this, ViewShellManager::Implementation, WindowEventHandler)); @@ -491,7 +491,7 @@ void ViewShellManager::Implementation::ActivateShell (SfxShell& rShell) void ViewShellManager::Implementation::ActivateShell (const ShellDescriptor& rDescriptor) { // Put shell on top of the active view shells. - if (rDescriptor.mpShell != NULL) + if (rDescriptor.mpShell != nullptr) { // Determine where to put the view shell on the stack. By default // it is put on top of the stack. When the view shell of the center @@ -571,7 +571,7 @@ void ViewShellManager::Implementation::ActivateSubShell ( // Add just the id of the sub shell. The actual shell is created // later in CreateShells(). UpdateLock aLock (*this); - rList.push_back(ShellDescriptor(NULL, nId)); + rList.push_back(ShellDescriptor(nullptr, nId)); } void ViewShellManager::Implementation::DeactivateSubShell ( @@ -592,7 +592,7 @@ void ViewShellManager::Implementation::DeactivateSubShell ( if (iShell == rList.end()) return; SfxShell* pShell = iShell->mpShell; - if (pShell == NULL) + if (pShell == nullptr) return; UpdateLock aLock (*this); @@ -615,7 +615,7 @@ void ViewShellManager::Implementation::MoveToTop (const SfxShell& rShell) // initialized. Without dispatcher we can not rebuild the shell stack // to move the requested shell to the top. So return right away instead // of making a mess without being able to clean up afterwards. - if (mrBase.GetDispatcher() == NULL) + if (mrBase.GetDispatcher() == nullptr) return; ActiveShellList::iterator iShell (::std::find_if ( @@ -682,7 +682,7 @@ SfxShell* ViewShellManager::Implementation::GetShell (ShellId nId) const { ::osl::MutexGuard aGuard (maMutex); - SfxShell* pShell = NULL; + SfxShell* pShell = nullptr; // First search the active view shells. ActiveShellList::const_iterator iShell ( @@ -759,16 +759,16 @@ void ViewShellManager::Implementation::UpdateShellStack() // Remember the undo manager from the top-most shell on the stack. SfxShell* pTopMostShell = mrBase.GetSubShell(0); - ::svl::IUndoManager* pUndoManager = (pTopMostShell!=NULL) + ::svl::IUndoManager* pUndoManager = (pTopMostShell!=nullptr) ? pTopMostShell->GetUndoManager() - : NULL; + : nullptr; // 1. Create the missing shells. CreateShells(); // Update the pointer to the top-most active view shell. mpTopViewShell = (maActiveViewShells.empty()) - ? 0 : maActiveViewShells.begin()->mpShell; + ? nullptr : maActiveViewShells.begin()->mpShell; // 2. Create the internal target stack. @@ -778,7 +778,7 @@ void ViewShellManager::Implementation::UpdateShellStack() // 3. Get SFX shell stack. ShellStack aSfxShellStack; sal_uInt16 nIndex (0); - while (mrBase.GetSubShell(nIndex)!=NULL) + while (mrBase.GetSubShell(nIndex)!=nullptr) ++nIndex; aSfxShellStack.reserve(nIndex); while (nIndex-- > 0) @@ -827,13 +827,13 @@ void ViewShellManager::Implementation::UpdateShellStack() if (mbShellStackIsUpToDate) break; } - if (mrBase.GetDispatcher() != NULL) + if (mrBase.GetDispatcher() != nullptr) mrBase.GetDispatcher()->Flush(); // Update the pointer to the top-most shell and set its undo manager // to the one of the previous top-most shell. mpTopShell = mrBase.GetSubShell(0); - if (mpTopShell!=NULL && pUndoManager!=NULL && mpTopShell->GetUndoManager()==NULL) + if (mpTopShell!=nullptr && pUndoManager!=nullptr && mpTopShell->GetUndoManager()==nullptr) mpTopShell->SetUndoManager(pUndoManager); // Finally tell an invocation of this method on a higher level that it can (has @@ -852,9 +852,9 @@ void ViewShellManager::Implementation::TakeShellsFromStack (const SfxShell* pShe // Remember the undo manager from the top-most shell on the stack. SfxShell* pTopMostShell = mrBase.GetSubShell(0); - ::svl::IUndoManager* pUndoManager = (pTopMostShell!=NULL) + ::svl::IUndoManager* pUndoManager = (pTopMostShell!=nullptr) ? pTopMostShell->GetUndoManager() - : NULL; + : nullptr; #if OSL_DEBUG_LEVEL >= 2 SAL_INFO("sd.view", OSL_THIS_FUNC << "TakeShellsFromStack( " << pShell << ")"); @@ -866,18 +866,18 @@ void ViewShellManager::Implementation::TakeShellsFromStack (const SfxShell* pShe for (sal_uInt16 nIndex=0; true; nIndex++) { SfxShell* pShellOnStack = mrBase.GetSubShell(nIndex); - if (pShellOnStack == NULL) + if (pShellOnStack == nullptr) { // Set pShell to NULL to indicate the following code that the // shell is not on the stack. - pShell = NULL; + pShell = nullptr; break; } else if (pShellOnStack == pShell) break; } - if (pShell != NULL) + if (pShell != nullptr) { // 1. Deactivate our shells on the stack before they are removed so // that during the Deactivation() calls the stack is still intact. @@ -900,13 +900,13 @@ void ViewShellManager::Implementation::TakeShellsFromStack (const SfxShell* pShe } // 3. Update the stack. - if (mrBase.GetDispatcher() != NULL) + if (mrBase.GetDispatcher() != nullptr) mrBase.GetDispatcher()->Flush(); // Update the pointer to the top-most shell and set its undo manager // to the one of the previous top-most shell. mpTopShell = mrBase.GetSubShell(0); - if (mpTopShell!=NULL && pUndoManager!=NULL && mpTopShell->GetUndoManager()==NULL) + if (mpTopShell!=nullptr && pUndoManager!=nullptr && mpTopShell->GetUndoManager()==nullptr) mpTopShell->SetUndoManager(pUndoManager); } @@ -934,9 +934,9 @@ void ViewShellManager::Implementation::CreateShells() SubShellSubList::iterator iSubShell; for (iSubShell=rList.begin(); iSubShell!=rList.end(); ++iSubShell) { - if (iSubShell->mpShell == NULL) + if (iSubShell->mpShell == nullptr) { - *iSubShell = CreateSubShell(iShell->mpShell,iSubShell->mnId,NULL,NULL); + *iSubShell = CreateSubShell(iShell->mpShell,iSubShell->mnId,nullptr,nullptr); } } } @@ -954,7 +954,7 @@ void ViewShellManager::Implementation::CreateTargetStack (ShellStack& rStack) co { // Possibly place the form shell below the current view shell. if ( ! mbFormShellAboveParent - && mpFormShell!=NULL + && mpFormShell!=nullptr && iViewShell->mpShell==mpFormShellParent) { rStack.push_back(mpFormShell); @@ -965,7 +965,7 @@ void ViewShellManager::Implementation::CreateTargetStack (ShellStack& rStack) co // Possibly place the form shell above the current view shell. if (mbFormShellAboveParent - && mpFormShell!=NULL + && mpFormShell!=nullptr && iViewShell->mpShell==mpFormShellParent) { rStack.push_back(mpFormShell); @@ -1044,11 +1044,11 @@ ShellDescriptor ViewShellManager::Implementation::CreateSubShell ( for (FactoryList::const_iterator iFactory=aRange.first; iFactory!=aRange.second; ++iFactory) { SharedShellFactory pFactory = iFactory->second; - if (pFactory != 0) + if (pFactory != nullptr) aResult.mpShell = pFactory->CreateShell(nShellId, pParentWindow, pFrameView); // Exit the loop when the shell has been successfully created. - if (aResult.mpShell != NULL) + if (aResult.mpShell != nullptr) { aResult.mpFactory = pFactory; aResult.mnId = nShellId; @@ -1062,13 +1062,13 @@ ShellDescriptor ViewShellManager::Implementation::CreateSubShell ( void ViewShellManager::Implementation::DestroyViewShell ( ShellDescriptor& rDescriptor) { - OSL_ASSERT(rDescriptor.mpShell != NULL); + OSL_ASSERT(rDescriptor.mpShell != nullptr); if (rDescriptor.mbIsListenerAddedToWindow) { rDescriptor.mbIsListenerAddedToWindow = false; vcl::Window* pWindow = rDescriptor.GetWindow(); - if (pWindow != NULL) + if (pWindow != nullptr) { pWindow->RemoveEventListener( LINK(this, ViewShellManager::Implementation, WindowEventHandler)); @@ -1082,7 +1082,7 @@ void ViewShellManager::Implementation::DestroyViewShell ( maShellFactories.erase(aRange.first, aRange.second); // Release the shell. - if (rDescriptor.mpFactory.get() != NULL) + if (rDescriptor.mpFactory.get() != nullptr) rDescriptor.mpFactory->ReleaseShell(rDescriptor.mpShell); } @@ -1091,7 +1091,7 @@ void ViewShellManager::Implementation::DestroySubShell ( const ShellDescriptor& rDescriptor) { (void)rParentShell; - OSL_ASSERT(rDescriptor.mpFactory.get() != NULL); + OSL_ASSERT(rDescriptor.mpFactory.get() != nullptr); rDescriptor.mpFactory->ReleaseShell(rDescriptor.mpShell); } @@ -1105,7 +1105,7 @@ void ViewShellManager::Implementation::InvalidateAllSubShells (const SfxShell* p SubShellSubList& rList (iList->second); SubShellSubList::iterator iShell; for (iShell=rList.begin(); iShell!=rList.end(); ++iShell) - if (iShell->mpShell != NULL) + if (iShell->mpShell != nullptr) iShell->mpShell->Invalidate(); } } @@ -1122,10 +1122,10 @@ void ViewShellManager::Implementation::Shutdown() while ( ! maActiveViewShells.empty()) { SfxShell* pShell = maActiveViewShells.front().mpShell; - if (pShell != NULL) + if (pShell != nullptr) { ViewShell* pViewShell = dynamic_cast<ViewShell*>(pShell); - if (pViewShell != NULL) + if (pViewShell != nullptr) DeactivateViewShell(*pViewShell); else DeactivateShell(*pShell); @@ -1171,15 +1171,15 @@ void ViewShellManager::Implementation::DumpSfxShellStack() void ViewShellManager::Implementation::Deactivate (SfxShell* pShell) { - OSL_ASSERT(pShell!=NULL); + OSL_ASSERT(pShell!=nullptr); // We have to end a text edit for view shells that are to be taken from // the shell stack. ViewShell* pViewShell = dynamic_cast<ViewShell*>(pShell); - if (pViewShell != NULL) + if (pViewShell != nullptr) { sd::View* pView = pViewShell->GetView(); - if (pView!=NULL && pView->IsTextEdit()) + if (pView!=nullptr && pView->IsTextEdit()) { pView->SdrEndTextEdit(); pView->UnmarkAll(); @@ -1208,7 +1208,7 @@ void ViewShellManager::Implementation::SetFormShell ( namespace { ShellDescriptor::ShellDescriptor() - : mpShell(NULL), + : mpShell(nullptr), mnId(0), mpFactory(), mbIsListenerAddedToWindow(false) @@ -1248,7 +1248,7 @@ ShellDescriptor& ShellDescriptor::operator= (const ShellDescriptor& rDescriptor) bool ShellDescriptor::IsMainViewShell() const { ViewShell* pViewShell = dynamic_cast<ViewShell*>(mpShell); - if (pViewShell != NULL) + if (pViewShell != nullptr) return pViewShell->IsMainViewShell(); else return false; @@ -1257,10 +1257,10 @@ bool ShellDescriptor::IsMainViewShell() const vcl::Window* ShellDescriptor::GetWindow() const { ViewShell* pViewShell = dynamic_cast<ViewShell*>(mpShell); - if (pViewShell != NULL) + if (pViewShell != nullptr) return pViewShell->GetActiveWindow(); else - return NULL; + return nullptr; } } // end of anonymous namespace diff --git a/sd/source/ui/view/ViewTabBar.cxx b/sd/source/ui/view/ViewTabBar.cxx index a7b3372558e3..8591d2d9f967 100644 --- a/sd/source/ui/view/ViewTabBar.cxx +++ b/sd/source/ui/view/ViewTabBar.cxx @@ -82,9 +82,9 @@ ViewTabBar::ViewTabBar ( mpTabControl(VclPtr<TabBarControl>::Create(GetAnchorWindow(rxViewTabBarId,rxController), this)), mxController(rxController), maTabBarButtons(), - mpTabPage(NULL), + mpTabPage(nullptr), mxViewTabBarId(rxViewTabBarId), - mpViewShellBase(NULL) + mpViewShellBase(nullptr) { // Set one new tab page for all tab entries. We need it only to // determine the height of the tab bar. @@ -123,7 +123,7 @@ ViewTabBar::ViewTabBar ( mpTabControl->Show(); - if (mpViewShellBase != NULL + if (mpViewShellBase != nullptr && rxViewTabBarId->isBoundToURL( FrameworkHelper::msCenterPaneURL, AnchorBindingMode_DIRECT)) { @@ -137,11 +137,11 @@ ViewTabBar::~ViewTabBar() void ViewTabBar::disposing() { - if (mpViewShellBase != NULL + if (mpViewShellBase != nullptr && mxViewTabBarId->isBoundToURL( FrameworkHelper::msCenterPaneURL, AnchorBindingMode_DIRECT)) { - mpViewShellBase->SetViewTabBar(NULL); + mpViewShellBase->SetViewTabBar(nullptr); } if (mxConfigurationController.is()) @@ -156,27 +156,27 @@ void ViewTabBar::disposing() // Receiving a disposed exception is the normal case. Is there // a way to avoid it? } - mxConfigurationController = NULL; + mxConfigurationController = nullptr; } { const SolarMutexGuard aSolarGuard; // Set all references to the one tab page to NULL and delete the page. for (sal_uInt16 nIndex=0; nIndex<mpTabControl->GetPageCount(); ++nIndex) - mpTabControl->SetTabPage(nIndex, NULL); + mpTabControl->SetTabPage(nIndex, nullptr); mpTabPage.disposeAndClear(); mpTabControl.disposeAndClear(); } - mxController = NULL; + mxController = nullptr; } vcl::Window* ViewTabBar::GetAnchorWindow( const Reference<XResourceId>& rxViewTabBarId, const Reference<frame::XController>& rxController) { - vcl::Window* pWindow = NULL; - ViewShellBase* pBase = NULL; + vcl::Window* pWindow = nullptr; + ViewShellBase* pBase = nullptr; // Tunnel through the controller and use the ViewShellBase to obtain the // view frame. @@ -196,12 +196,12 @@ vcl::Window* ViewTabBar::GetAnchorWindow( && rxViewTabBarId->isBoundToURL( FrameworkHelper::msCenterPaneURL, AnchorBindingMode_DIRECT)) { - if (pBase != NULL && pBase->GetViewFrame() != NULL) + if (pBase != nullptr && pBase->GetViewFrame() != nullptr) pWindow = &pBase->GetViewFrame()->GetWindow(); } // The rest is (at the moment) just for the emergency case. - if (pWindow == NULL) + if (pWindow == nullptr) { Reference<XPane> xPane; try @@ -222,7 +222,7 @@ vcl::Window* ViewTabBar::GetAnchorWindow( Reference<lang::XUnoTunnel> xTunnel (xPane, UNO_QUERY_THROW); framework::Pane* pPane = reinterpret_cast<framework::Pane*>( xTunnel->getSomething(framework::Pane::getUnoTunnelId())); - if (pPane != NULL) + if (pPane != nullptr) pWindow = pPane->GetWindow()->GetParent(); } catch (const RuntimeException&) @@ -255,8 +255,8 @@ void SAL_CALL ViewTabBar::disposing( { if (rEvent.Source == mxConfigurationController) { - mxConfigurationController = NULL; - mxController = NULL; + mxConfigurationController = nullptr; + mxController = nullptr; } } @@ -361,10 +361,10 @@ bool ViewTabBar::ActivatePage() { } - Client* pIPClient = NULL; - if (mpViewShellBase != NULL) + Client* pIPClient = nullptr; + if (mpViewShellBase != nullptr) pIPClient = dynamic_cast<Client*>(mpViewShellBase->GetIPClient()); - if (pIPClient==NULL || ! pIPClient->IsObjectInPlaceActive()) + if (pIPClient==nullptr || ! pIPClient->IsObjectInPlaceActive()) { sal_uInt16 nIndex (mpTabControl->GetCurPageId() - 1); if (nIndex < maTabBarButtons.size()) @@ -400,7 +400,7 @@ int ViewTabBar::GetHeight() { TabPage* pActivePage (mpTabControl->GetTabPage( mpTabControl->GetCurPageId())); - if (pActivePage!=NULL && mpTabControl->IsReallyVisible()) + if (pActivePage!=nullptr && mpTabControl->IsReallyVisible()) nHeight = pActivePage->GetPosPixel().Y(); if (nHeight <= 0) @@ -511,7 +511,7 @@ css::uno::Sequence<css::drawing::framework::TabBarButton> void ViewTabBar::UpdateActiveButton() { Reference<XView> xView; - if (mpViewShellBase != NULL) + if (mpViewShellBase != nullptr) xView = FrameworkHelper::Instance(*mpViewShellBase)->GetView( mxViewTabBarId->getAnchor()); if (xView.is()) diff --git a/sd/source/ui/view/WindowUpdater.cxx b/sd/source/ui/view/WindowUpdater.cxx index 4a2e0aa0f6aa..3dac87aabae2 100644 --- a/sd/source/ui/view/WindowUpdater.cxx +++ b/sd/source/ui/view/WindowUpdater.cxx @@ -33,8 +33,8 @@ namespace sd { WindowUpdater::WindowUpdater() - : mpViewShell (NULL), - mpDocument (NULL) + : mpViewShell (nullptr), + mpDocument (nullptr) { maCTLOptions.AddListener(this); } @@ -46,7 +46,7 @@ WindowUpdater::~WindowUpdater() throw () void WindowUpdater::RegisterWindow (vcl::Window* pWindow) { - if (pWindow != NULL) + if (pWindow != nullptr) { tWindowList::iterator aWindowIterator ( ::std::find ( @@ -85,17 +85,17 @@ void WindowUpdater::Update ( OutputDevice* pDevice, SdDrawDocument* pDocument) const { - if (pDevice != NULL) + if (pDevice != nullptr) { UpdateWindow (pDevice); - if (pDocument != NULL) + if (pDocument != nullptr) pDocument->ReformatAllTextObjects(); } } void WindowUpdater::UpdateWindow (OutputDevice* pDevice) const { - if (pDevice != NULL) + if (pDevice != nullptr) { SvtCTLOptions::TextNumerals aNumeralMode (maCTLOptions.GetCTLTextNumerals()); @@ -132,7 +132,7 @@ void WindowUpdater::ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uI Update (*aWindowIterator++); // Reformat the document for the modified state to take effect. - if (mpDocument != NULL) + if (mpDocument != nullptr) mpDocument->ReformatAllTextObjects(); // Invalidate the windows to make the modified state visible. diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx index c2d914e94460..8fc4277bf7e9 100644 --- a/sd/source/ui/view/drawview.cxx +++ b/sd/source/ui/view/drawview.cxx @@ -83,7 +83,7 @@ DrawView::DrawView( DrawDocShell* pDocSh, OutputDevice* pOutDev, DrawViewShell* : ::sd::View(*pDocSh->GetDoc(), pOutDev, pShell) , mpDocShell(pDocSh) , mpDrawViewShell(pShell) -, mpVDev(NULL) +, mpVDev(nullptr) , mnPOCHSmph(0) { SetCurrentObj(OBJ_RECT); @@ -188,7 +188,7 @@ bool DrawView::SetAttributes(const SfxItemSet& rSet, pOV->CreateSelectionList(aSelList); std::vector<Paragraph*>::reverse_iterator iter = aSelList.rbegin(); - Paragraph* pPara = iter != aSelList.rend() ? *iter : NULL; + Paragraph* pPara = iter != aSelList.rend() ? *iter : nullptr; while (pPara) { @@ -234,7 +234,7 @@ bool DrawView::SetAttributes(const SfxItemSet& rSet, } ++iter; - pPara = iter != aSelList.rend() ? *iter : NULL; + pPara = iter != aSelList.rend() ? *iter : nullptr; bool bJumpToLevel1 = false; if( !pPara && nDepth > 0 && rSet.GetItemState( EE_PARA_NUMBULLET ) == SfxItemState::SET ) @@ -549,7 +549,7 @@ void DrawView::DeleteMarked() pUndoManager->EnterListAction(aUndo, aUndo); } - SdPage* pPage = 0; + SdPage* pPage = nullptr; bool bResetLayout = false; const size_t nMarkCount = GetMarkedObjectList().GetMarkCount(); @@ -583,7 +583,7 @@ void DrawView::DeleteMarked() SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( pObj ); bool bVertical = pTextObj && pTextObj->IsVerticalWriting(); Rectangle aRect( pObj->GetLogicRect() ); - SdrObject* pNewObj = pPage->InsertAutoLayoutShape( 0, ePresObjKind, bVertical, aRect, true ); + SdrObject* pNewObj = pPage->InsertAutoLayoutShape( nullptr, ePresObjKind, bVertical, aRect, true ); // pUndoManager should not be NULL (see assert above) // but since we have defensive code diff --git a/sd/source/ui/view/drbezob.cxx b/sd/source/ui/view/drbezob.cxx index 24c141789627..543a674a7870 100644 --- a/sd/source/ui/view/drbezob.cxx +++ b/sd/source/ui/view/drbezob.cxx @@ -79,7 +79,7 @@ BezierObjectBar::BezierObjectBar( BezierObjectBar::~BezierObjectBar() { - SetRepeatTarget(NULL); + SetRepeatTarget(nullptr); } /** @@ -96,12 +96,12 @@ void BezierObjectBar::GetAttrState(SfxItemSet& rSet) if(xFunc.is()) { - if( 0 != dynamic_cast< const FuSelection *>( xFunc.get() )) + if( nullptr != dynamic_cast< const FuSelection *>( xFunc.get() )) { sal_uInt16 nEditMode = static_cast<FuSelection*>(xFunc.get())->GetEditMode(); rSet.Put(SfxBoolItem(nEditMode, true)); } - else if( 0 != dynamic_cast< const FuConstructBezierPolygon *>( xFunc.get() )) + else if( nullptr != dynamic_cast< const FuConstructBezierPolygon *>( xFunc.get() )) { sal_uInt16 nEditMode = static_cast<FuConstructBezierPolygon*>(xFunc.get())->GetEditMode(); rSet.Put(SfxBoolItem(nEditMode, true)); @@ -128,7 +128,7 @@ void BezierObjectBar::GetAttrState(SfxItemSet& rSet) } else { - IPolyPolygonEditorController* pIPPEC = 0; + IPolyPolygonEditorController* pIPPEC = nullptr; if( mpView->GetMarkedObjectList().GetMarkCount() ) pIPPEC = mpView; else @@ -217,7 +217,7 @@ void BezierObjectBar::Execute(SfxRequest& rReq) { const SdrMarkList& rMarkList = mpView->GetMarkedObjectList(); - IPolyPolygonEditorController* pIPPEC = 0; + IPolyPolygonEditorController* pIPPEC = nullptr; if( rMarkList.GetMarkCount() ) pIPPEC = mpView; else @@ -302,11 +302,11 @@ void BezierObjectBar::Execute(SfxRequest& rReq) if(xFunc.is()) { - if( 0 != dynamic_cast< const FuSelection *>( xFunc.get() )) + if( nullptr != dynamic_cast< const FuSelection *>( xFunc.get() )) { static_cast<FuSelection*>(xFunc.get())->SetEditMode(rReq.GetSlot()); } - else if( 0 != dynamic_cast< const FuConstructBezierPolygon *>( xFunc.get() )) + else if( nullptr != dynamic_cast< const FuConstructBezierPolygon *>( xFunc.get() )) { static_cast<FuConstructBezierPolygon*>(xFunc.get())->SetEditMode(rReq.GetSlot()); } diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx index 4472d54187d6..29c1ef3d21bd 100644 --- a/sd/source/ui/view/drtxtob.cxx +++ b/sd/source/ui/view/drtxtob.cxx @@ -121,7 +121,7 @@ TextObjectBar::TextObjectBar ( TextObjectBar::~TextObjectBar() { - SetRepeatTarget(NULL); + SetRepeatTarget(nullptr); } void TextObjectBar::GetCharState( SfxItemSet& rSet ) @@ -277,7 +277,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) std::vector<Paragraph*> aSelList; pOLV->CreateSelectionList(aSelList); - Paragraph* pPara = aSelList.empty() ? NULL : *(aSelList.begin()); + Paragraph* pPara = aSelList.empty() ? nullptr : *(aSelList.begin()); // find out if we are a OutlineView bool bIsOutlineView(OUTLINERMODE_OUTLINEVIEW == pOLV->GetOutliner()->GetMode()); @@ -331,7 +331,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) } // disable when first para and 2nd is not a title - pPara = aSelList.empty() ? NULL : *(aSelList.begin()); + pPara = aSelList.empty() ? nullptr : *(aSelList.begin()); if(!bDisableDown && bIsOutlineView && pPara diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index a163d36fefd2..d18703f7cd07 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -83,7 +83,7 @@ namespace sd { void TextObjectBar::Execute( SfxRequest &rReq ) { const SfxItemSet* pArgs = rReq.GetArgs(); - const SfxPoolItem* pPoolItem = NULL; + const SfxPoolItem* pPoolItem = nullptr; sal_uInt16 nSlot = rReq.GetSlot(); OutlinerView* pOLV = mpView->GetTextEditOutlinerView(); @@ -145,10 +145,10 @@ void TextObjectBar::Execute( SfxRequest &rReq ) } for( sal_Int32 nPara = nStartPara; nPara <= nEndPara; nPara++ ) { - SfxStyleSheet* pStyleSheet = NULL; - if (pOLV->GetOutliner() != NULL) + SfxStyleSheet* pStyleSheet = nullptr; + if (pOLV->GetOutliner() != nullptr) pStyleSheet = pOLV->GetOutliner()->GetStyleSheet(nPara); - if (pStyleSheet != NULL) + if (pStyleSheet != nullptr) { SfxItemSet aAttr( pStyleSheet->GetItemSet() ); SfxItemSet aTmpSet( pOLV->GetOutliner()->GetParaAttribs( nPara ) ); @@ -344,7 +344,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) ::Outliner* pOL = pOLV->GetOutliner(); if (pOL) { - const SvxNumBulletItem *pItem = NULL; + const SvxNumBulletItem *pItem = nullptr; SfxStyleSheetBasePool* pSSPool = mpView->GetDocSh()->GetStyleSheetPool(); OUString sStyleName(SD_RESSTR(STR_PSEUDOSHEET_OUTLINE) + " 1"); SfxStyleSheetBase* pFirstStyleSheet = pSSPool->Find(sStyleName, SD_STYLE_FAMILY_PSEUDO); @@ -391,7 +391,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) case SID_SHRINK_FONT_SIZE: { const SvxFontListItem* pFonts = static_cast<const SvxFontListItem*>(mpViewShell->GetDocSh()->GetItem( SID_ATTR_CHAR_FONTLIST )); - const FontList* pFontList = pFonts ? pFonts->GetFontList(): 0; + const FontList* pFontList = pFonts ? pFonts->GetFontList(): nullptr; if( pFontList ) { FuText::ChangeFontSize( nSlot == SID_GROW_FONT_SIZE, pOLV, pFontList, mpView ); diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index e7b2bed58960..3c510e5fc313 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -106,7 +106,7 @@ void DrawViewShell::UIActivating( SfxInPlaceClient* pCli ) // Disable own controls maTabControl->Disable(); - if (GetLayerTabControl() != NULL) + if (GetLayerTabControl() != nullptr) GetLayerTabControl()->Disable(); } @@ -114,7 +114,7 @@ void DrawViewShell::UIDeactivated( SfxInPlaceClient* pCli ) { // Enable own controls maTabControl->Enable(); - if (GetLayerTabControl() != NULL) + if (GetLayerTabControl() != nullptr) GetLayerTabControl()->Enable(); ViewShell::UIDeactivated(pCli); @@ -165,7 +165,7 @@ void DrawViewShell::SelectionHasChanged() GetViewFrame()->GetDispatcher()->Execute( SID_3D_STATE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, &aItem, 0L ); - SdrOle2Obj* pOleObj = NULL; + SdrOle2Obj* pOleObj = nullptr; if ( mpDrawView->AreObjectsMarked() ) { @@ -338,7 +338,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive) } LayerTabBar* pLayerBar = GetLayerTabControl(); - if (pLayerBar != NULL) + if (pLayerBar != nullptr) pLayerBar->EndEditMode(); maTabControl->EndEditMode(); @@ -578,7 +578,7 @@ void DrawViewShell::UpdateHRuler() Invalidate( SID_RULER_OBJECT ); Invalidate( SID_RULER_TEXT_RIGHT_TO_LEFT ); - if (mpHorizontalRuler.get() != NULL) + if (mpHorizontalRuler.get() != nullptr) mpHorizontalRuler->ForceUpdate(); } @@ -592,7 +592,7 @@ void DrawViewShell::UpdateVRuler() Invalidate( SID_RULER_PAGE_POS ); Invalidate( SID_RULER_OBJECT ); - if (mpVerticalRuler.get() != NULL) + if (mpVerticalRuler.get() != nullptr) mpVerticalRuler->ForceUpdate(); } @@ -675,7 +675,7 @@ void DrawViewShell::ResetActualPage() // Update for TabControl maTabControl->Clear(); - SdPage* pPage = NULL; + SdPage* pPage = nullptr; for (sal_uInt16 i = 0; i < nPageCount; i++) { @@ -759,10 +759,10 @@ bool DrawViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb) bActivated = ViewShell::ActivateObject(pObj, nVerb); - OSL_ASSERT(GetViewShell()!=NULL); + OSL_ASSERT(GetViewShell()!=nullptr); Client* pClient = static_cast<Client*>(GetViewShell()->GetIPClient()); if (pClient) - pClient->SetSdrGrafObj(NULL); + pClient->SetSdrGrafObj(nullptr); } return bActivated; @@ -828,7 +828,7 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage) if (mpActualPage) { - SdPage* pNewPage = NULL; + SdPage* pNewPage = nullptr; if (meEditMode == EM_MASTERPAGE) { @@ -853,7 +853,7 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage) } else { - OSL_ASSERT(mpFrameView!=NULL); + OSL_ASSERT(mpFrameView!=nullptr); mpFrameView->SetSelectedPage(nSelectedPage); if (GetDoc()->GetSdPageCount(mePageKind) > nSelectedPage) @@ -863,7 +863,7 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage) { SdrPageView* pPV = mpDrawView->GetSdrPageView(); - SdPage* pCurrentPage = pPV ? dynamic_cast<SdPage*>(pPV->GetPage()) : NULL; + SdPage* pCurrentPage = pPV ? dynamic_cast<SdPage*>(pPV->GetPage()) : nullptr; if (pCurrentPage && pNewPage == pCurrentPage && maTabControl->GetPageText(nSelectedPage+1).equals(pNewPage->GetName())) @@ -877,7 +877,7 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage) mpDrawView->SdrEndTextEdit(); - mpActualPage = NULL; + mpActualPage = nullptr; if (meEditMode == EM_PAGE) { @@ -935,7 +935,7 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage) { // tighten VisArea, to possibly deactivate objects // !!! only if we are not in presentation mode (#96279) !!! - OSL_ASSERT (GetViewShell()!=NULL); + OSL_ASSERT (GetViewShell()!=nullptr); GetViewShell()->DisconnectAllClients(); VisAreaChanged(Rectangle(Point(), Size(1, 1))); } @@ -1079,7 +1079,7 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage) { // set pages for all available handout presentation objects sd::ShapeList& rShapeList = pMaster->GetPresentationShapeList(); - SdrObject* pObj = 0; + SdrObject* pObj = nullptr; rShapeList.seekShape(0); while( (pObj = rShapeList.getNextShape()) ) @@ -1088,7 +1088,7 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage) { // #i105146# We want no content to be displayed for PK_HANDOUT, // so just never set a page as content - static_cast<SdrPageObj*>(pObj)->SetReferencedPage(0); + static_cast<SdrPageObj*>(pObj)->SetReferencedPage(nullptr); } } } @@ -1124,7 +1124,7 @@ bool DrawViewShell::IsSwitchPageAllowed() const bool bOK = true; FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager()->GetFormShell(); - if (pFormShell != NULL && !pFormShell->PrepareClose(false)) + if (pFormShell != nullptr && !pFormShell->PrepareClose(false)) bOK = false; return bOK; @@ -1137,7 +1137,7 @@ bool DrawViewShell::IsSwitchPageAllowed() const void DrawViewShell::ResetActualLayer() { LayerTabBar* pLayerBar = GetLayerTabControl(); - if (pLayerBar != NULL) + if (pLayerBar != nullptr) { // remember old layer cound and current layer id // this is needed when one layer is renamed to diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 5006e6ff9161..cebb95bc1d91 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -328,7 +328,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) Cancel(); if(HasCurrentFunction(SID_BEZIER_EDIT) ) GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON); - if (pNewPage != NULL) + if (pNewPage != nullptr) SwitchPage((pNewPage->GetPageNum()-1)/2); rReq.Done (); } @@ -838,7 +838,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) for ( size_t i = 0; i < nCount; ++i ) { - SfxStyleSheet* pSheet = NULL; + SfxStyleSheet* pSheet = nullptr; SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); if (pObj->GetObjIdentifier() == OBJ_TITLETEXT) @@ -1392,7 +1392,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) aNewAttr.Put( SdAttrLayerThisPage() ); SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSdInsertLayerDlg> pDlg(pFact ? pFact->CreateSdInsertLayerDlg(NULL, aNewAttr, true, SD_RESSTR(STR_INSERTLAYER)) : 0); + std::unique_ptr<AbstractSdInsertLayerDlg> pDlg(pFact ? pFact->CreateSdInsertLayerDlg(nullptr, aNewAttr, true, SD_RESSTR(STR_INSERTLAYER)) : nullptr); if( pDlg ) { pDlg->SetHelpId( SD_MOD()->GetSlotPool()->GetSlot( SID_INSERTLAYER )->GetCommand() ); @@ -1560,7 +1560,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) aNewAttr.Put( SdAttrLayerThisPage() ); SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSdInsertLayerDlg> pDlg(pFact ? pFact->CreateSdInsertLayerDlg(NULL, aNewAttr, bDelete, SD_RESSTR(STR_MODIFYLAYER)) : 0); + std::unique_ptr<AbstractSdInsertLayerDlg> pDlg(pFact ? pFact->CreateSdInsertLayerDlg(nullptr, aNewAttr, bDelete, SD_RESSTR(STR_MODIFYLAYER)) : nullptr); if( pDlg ) { pDlg->SetHelpId( SD_MOD()->GetSlotPool()->GetSlot( SID_MODIFYLAYER )->GetCommand() ); @@ -1740,12 +1740,12 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if (pHLItem->GetInsertMode() == HLINK_FIELD) { InsertURLField(pHLItem->GetURL(), pHLItem->GetName(), - pHLItem->GetTargetFrame(), NULL); + pHLItem->GetTargetFrame(), nullptr); } else if (pHLItem->GetInsertMode() == HLINK_BUTTON) { InsertURLButton(pHLItem->GetURL(), pHLItem->GetName(), - pHLItem->GetTargetFrame(), NULL); + pHLItem->GetTargetFrame(), nullptr); } else if (pHLItem->GetInsertMode() == HLINK_DEFAULT) { @@ -1754,12 +1754,12 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if (pOlView) { InsertURLField(pHLItem->GetURL(), pHLItem->GetName(), - pHLItem->GetTargetFrame(), NULL); + pHLItem->GetTargetFrame(), nullptr); } else { InsertURLButton(pHLItem->GetURL(), pHLItem->GetName(), - pHLItem->GetTargetFrame(), NULL); + pHLItem->GetTargetFrame(), nullptr); } } } @@ -1898,13 +1898,13 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { const SvxFieldItem* pOldFldItem = pOLV->GetFieldAtSelection(); - if( pOldFldItem && ( 0 != dynamic_cast< const SvxURLField *>( pOldFldItem->GetField() ) || - 0 != dynamic_cast< const SvxDateField *>( pOldFldItem->GetField() ) || - 0 != dynamic_cast< const SvxTimeField *>( pOldFldItem->GetField() ) || - 0 != dynamic_cast< const SvxExtTimeField *>( pOldFldItem->GetField() ) || - 0 != dynamic_cast< const SvxExtFileField *>( pOldFldItem->GetField() ) || - 0 != dynamic_cast< const SvxAuthorField *>( pOldFldItem->GetField() ) || - 0 != dynamic_cast< const SvxPageField *>( pOldFldItem->GetField() ) ) ) + if( pOldFldItem && ( nullptr != dynamic_cast< const SvxURLField *>( pOldFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxDateField *>( pOldFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxTimeField *>( pOldFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxExtTimeField *>( pOldFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxExtFileField *>( pOldFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxAuthorField *>( pOldFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxPageField *>( pOldFldItem->GetField() ) ) ) { // select field, then it will be deleted when inserting ESelection aSel = pOLV->GetSelection(); @@ -1921,7 +1921,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) Outliner* pOutl = GetDoc()->GetInternalOutliner(); pOutl->Init( OUTLINERMODE_TEXTOBJECT ); sal_uInt16 nOutlMode = pOutl->GetMode(); - pOutl->SetStyleSheet( 0, NULL ); + pOutl->SetStyleSheet( 0, nullptr ); pOutl->QuickInsertField( *pFieldItem, ESelection() ); OutlinerParaObject* pOutlParaObject = pOutl->CreateParaObject(); @@ -1963,14 +1963,14 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { const SvxFieldItem* pFldItem = pOLV->GetFieldAtSelection(); - if( pFldItem && (0 != dynamic_cast< const SvxDateField *>( pFldItem->GetField() ) || - 0 != dynamic_cast< const SvxAuthorField *>( pFldItem->GetField() ) || - 0 != dynamic_cast< const SvxExtFileField *>( pFldItem->GetField() ) || - 0 != dynamic_cast< const SvxExtTimeField *>( pFldItem->GetField() ) ) ) + if( pFldItem && (nullptr != dynamic_cast< const SvxDateField *>( pFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxAuthorField *>( pFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxExtFileField *>( pFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxExtTimeField *>( pFldItem->GetField() ) ) ) { // Dialog... SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSdModifyFieldDlg> pDlg(pFact ? pFact->CreateSdModifyFieldDlg(GetActiveWindow(), pFldItem->GetField(), pOLV->GetAttribs() ) : 0); + std::unique_ptr<AbstractSdModifyFieldDlg> pDlg(pFact ? pFact->CreateSdModifyFieldDlg(GetActiveWindow(), pFldItem->GetField(), pOLV->GetAttribs() ) : nullptr); if( pDlg && pDlg->Execute() == RET_OK ) { // To make a correct SetAttribs() call at the utlinerView @@ -2079,7 +2079,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractSvxObjectNameDialog> pDlg(pFact->CreateSvxObjectNameDialog(NULL, aName)); + std::unique_ptr<AbstractSvxObjectNameDialog> pDlg(pFact->CreateSvxObjectNameDialog(nullptr, aName)); OSL_ENSURE(pDlg, "Dialog creation failed!"); pDlg->SetCheckNameHdl(LINK(this, DrawViewShell, NameObjectHdl)); @@ -2112,7 +2112,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog(NULL, aTitle, aDescription)); + std::unique_ptr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog(nullptr, aTitle, aDescription)); OSL_ENSURE(pDlg, "Dialog creation failed!"); if(RET_OK == pDlg->Execute()) @@ -2500,7 +2500,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) case SID_SELECTALL: // BASIC { - if( (dynamic_cast<FuSelection*>( GetOldFunction().get() ) != 0) && + if( (dynamic_cast<FuSelection*>( GetOldFunction().get() ) != nullptr) && !GetView()->IsFrameDragSingles() && GetView()->HasMarkablePoints()) { if ( !mpDrawView->IsAction() ) @@ -2531,7 +2531,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if( pStyleSheet && pStyleSheet->GetFamily() == SD_STYLE_FAMILY_MASTERPAGE) pStyleSheet = static_cast<SdStyleSheet*>(pStyleSheet)->GetPseudoStyleSheet(); - if( (pStyleSheet == NULL) && GetView()->IsTextEdit() ) + if( (pStyleSheet == nullptr) && GetView()->IsTextEdit() ) { GetView()->SdrEndTextEdit(); @@ -2540,7 +2540,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) pStyleSheet = static_cast<SdStyleSheet*>(pStyleSheet)->GetPseudoStyleSheet(); } - if( pStyleSheet == NULL ) + if( pStyleSheet == nullptr ) { rReq.Ignore(); break; @@ -2578,7 +2578,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) GetViewFrame()->GetBindings().Invalidate( SID_IMAP ); if ( GetViewFrame()->HasChildWindow( nId ) - && ( ( ViewShell::Implementation::GetImageMapDialog() ) != NULL ) ) + && ( ( ViewShell::Implementation::GetImageMapDialog() ) != nullptr ) ) { const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); @@ -2788,7 +2788,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { #ifdef ENABLE_SDREMOTE SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - VclAbstractDialog* pDlg = pFact ? pFact->CreateRemoteDialog(GetActiveWindow()) : 0; + VclAbstractDialog* pDlg = pFact ? pFact->CreateRemoteDialog(GetActiveWindow()) : nullptr; if (pDlg) pDlg->Execute(); #endif @@ -2853,8 +2853,8 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) // Determine current page and toggle visibility of layers // associated with master page background or master page shapes. SdPage* pPage = GetActualPage(); - if (pPage != NULL - && GetDoc() != NULL) + if (pPage != nullptr + && GetDoc() != nullptr) { SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers(); SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin(); @@ -2876,7 +2876,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); std::unique_ptr<VclAbstractDialog> pDlg(pFact ? pFact->CreateSdPhotoAlbumDialog( GetActiveWindow(), - GetDoc()) : 0); + GetDoc()) : nullptr); if (pDlg) { @@ -3058,10 +3058,10 @@ void DrawViewShell::ExecChar( SfxRequest &rReq ) case SID_GROW_FONT_SIZE: { const SvxFontListItem* pFonts = dynamic_cast<const SvxFontListItem*>(GetDocSh()->GetItem( SID_ATTR_CHAR_FONTLIST ) ); - const FontList* pFontList = pFonts ? pFonts->GetFontList() : NULL; + const FontList* pFontList = pFonts ? pFonts->GetFontList() : nullptr; if( pFontList ) { - FuText::ChangeFontSize( nSId == SID_GROW_FONT_SIZE, NULL, pFontList, mpView ); + FuText::ChangeFontSize( nSId == SID_GROW_FONT_SIZE, nullptr, pFontList, mpView ); GetViewFrame()->GetBindings().Invalidate( SID_ATTR_CHAR_FONTHEIGHT ); } } @@ -3085,7 +3085,7 @@ SdPage* DrawViewShell::CreateOrDuplicatePage ( SdPage* pPage, const sal_Int32 nInsertPosition) { - SdPage* pNewPage = NULL; + SdPage* pNewPage = nullptr; if (ePageKind == PK_STANDARD && meEditMode != EM_MASTERPAGE) { if ( mpDrawView->IsTextEdit() ) diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index c9f3aa4d7d73..bfe2c56465a7 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -293,7 +293,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) case SID_INSERT_DATE_TIME: { SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<AbstractHeaderFooterDialog> pDlg(pFact ? pFact->CreateHeaderFooterDialog( this, GetActiveWindow(), GetDoc(), mpActualPage ) : 0); + std::unique_ptr<AbstractHeaderFooterDialog> pDlg(pFact ? pFact->CreateHeaderFooterDialog( this, GetActiveWindow(), GetDoc(), mpActualPage ) : nullptr); if( pDlg ) { pDlg->Execute(); @@ -317,7 +317,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) pPage = static_cast<SdPage*>(&pPage->TRG_GetMasterPage()); SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<VclAbstractDialog> pDlg(pFact ? pFact->CreateMasterLayoutDialog( GetActiveWindow(), GetDoc(), pPage ) : 0); + std::unique_ptr<VclAbstractDialog> pDlg(pFact ? pFact->CreateMasterLayoutDialog( GetActiveWindow(), GetDoc(), pPage ) : nullptr); if( pDlg ) { pDlg->Execute(); @@ -330,7 +330,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) case SID_OBJECTRESIZE: { // The server likes to change the client size - OSL_ASSERT (GetViewShell()!=NULL); + OSL_ASSERT (GetViewShell()!=nullptr); SfxInPlaceClient* pIPClient = GetViewShell()->GetIPClient(); if ( pIPClient && pIPClient->IsObjectInPlaceActive() ) @@ -454,7 +454,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) case SID_ATTR_YEAR2000: { FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager()->GetFormShell(); - if (pFormShell != NULL) + if (pFormShell != nullptr) { const SfxPoolItem* pItem; if (rReq.GetArgs()->GetItemState( diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index 9a162934414c..a252176c8bbe 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -133,7 +133,7 @@ bool DrawViewShell::KeyInput (const KeyEvent& rKEvt, ::sd::Window* pWin) // this should be used for cursor travelling. SdPage* pActualPage = GetActualPage(); const SdrMarkList& rMarkList = GetView()->GetMarkedObjectList(); - SdrTextObj* pCandidate = 0L; + SdrTextObj* pCandidate = nullptr; if(pActualPage && 1 == rMarkList.GetMarkCount()) { @@ -291,7 +291,7 @@ void DrawViewShell::MouseButtonDown(const MouseEvent& rMEvt, if (mbPipette) { SfxChildWindow* pWnd = GetViewFrame()->GetChildWindow(SvxBmpMaskChildWindow::GetChildWindowId()); - SvxBmpMask* pBmpMask = pWnd ? static_cast<SvxBmpMask*>(pWnd->GetWindow()) : NULL; + SvxBmpMask* pBmpMask = pWnd ? static_cast<SvxBmpMask*>(pWnd->GetWindow()) : nullptr; if (pBmpMask) pBmpMask->PipetteClicked(); } @@ -310,7 +310,7 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin) { bool bInsideOtherWindow = false; - if (mpContentWindow.get() != NULL) + if (mpContentWindow.get() != nullptr) { aOutputArea = Rectangle(Point(0,0), mpContentWindow->GetOutputSizePixel()); @@ -374,11 +374,11 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin) ShowMousePosInfo(aRect, pWin); - SvxBmpMask* pBmpMask = NULL; + SvxBmpMask* pBmpMask = nullptr; if (mbPipette && GetViewFrame()->HasChildWindow(SvxBmpMaskChildWindow::GetChildWindowId())) { SfxChildWindow* pWnd = GetViewFrame()->GetChildWindow(SvxBmpMaskChildWindow::GetChildWindowId()); - pBmpMask = pWnd ? static_cast<SvxBmpMask*>(pWnd->GetWindow()) : NULL; + pBmpMask = pWnd ? static_cast<SvxBmpMask*>(pWnd->GetWindow()) : nullptr; } if (pBmpMask) @@ -498,13 +498,13 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) ( aDataHelper.HasFormat( SotClipboardFormatId::UNIFORMRESOURCELOCATOR ) && aDataHelper.GetINetBookmark( SotClipboardFormatId::UNIFORMRESOURCELOCATOR, aINetBookmark ) ) ) { - InsertURLField( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), "", NULL ); + InsertURLField( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), "", nullptr ); } } } } else if( rCEvt.GetCommand() == CommandEventId::ContextMenu && !bNativeShow && - pWin != NULL && !mpDrawView->IsAction() && !SD_MOD()->GetWaterCan() ) + pWin != nullptr && !mpDrawView->IsAction() && !SD_MOD()->GetWaterCan() ) { sal_uInt16 nSdResId = 0; // ResourceID for popup menu bool bGraphicShell = dynamic_cast< const GraphicViewShell *>( this ) != nullptr; @@ -516,11 +516,11 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) Size(FuPoor::HITPIX, 0 ) ).Width(); sal_uInt16 nHelpLine; // for glue points - SdrObject* pObj = NULL; + SdrObject* pObj = nullptr; sal_uInt16 nPickId = 0; // for field command OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView(); - const SvxFieldItem* pFldItem = NULL; + const SvxFieldItem* pFldItem = nullptr; if( pOLV ) pFldItem = pOLV->GetFieldAtSelection(); @@ -538,10 +538,10 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) nSdResId = RID_DRAW_GLUEPOINT_POPUP; } // field command? - else if( pFldItem && (0 != dynamic_cast< const SvxDateField *>( pFldItem->GetField() ) || - 0 != dynamic_cast< const SvxExtTimeField *>( pFldItem->GetField() ) || - 0 != dynamic_cast< const SvxExtFileField *>( pFldItem->GetField() ) || - 0 != dynamic_cast< const SvxAuthorField *>( pFldItem->GetField() ) ) ) + else if( pFldItem && (nullptr != dynamic_cast< const SvxDateField *>( pFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxExtTimeField *>( pFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxExtFileField *>( pFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxAuthorField *>( pFldItem->GetField() ) ) ) { LanguageType eLanguage( LANGUAGE_SYSTEM ); @@ -592,7 +592,7 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) mpDrawView->GetMarkedObjectList().GetMarkCount() == 1 ) { pObj = mpDrawView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); - if( HasCurrentFunction(SID_BEZIER_EDIT) && (dynamic_cast< SdrPathObj * >( pObj ) != 0 ) ) + if( HasCurrentFunction(SID_BEZIER_EDIT) && (dynamic_cast< SdrPathObj * >( pObj ) != nullptr ) ) { nSdResId = RID_BEZIER_POPUP; } @@ -780,7 +780,7 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) if( mpDrawView->AreObjectsMarked() && mpDrawView->GetMarkedObjectList().GetMarkCount() >= 1 ) { Rectangle aMarkRect; - mpDrawView->GetMarkedObjectList().TakeBoundRect(NULL,aMarkRect); + mpDrawView->GetMarkedObjectList().TakeBoundRect(nullptr,aMarkRect); aMenuPos = GetActiveWindow()->LogicToPixel( aMarkRect.Center() ); //move the point into the visible window area @@ -818,19 +818,19 @@ void DrawViewShell::ShowMousePosInfo(const Rectangle& rRect, long nVOffs = 0L; sal_uInt16 nCnt; - if (mpHorizontalRuler.get() != NULL) + if (mpHorizontalRuler.get() != nullptr) mpHorizontalRuler->SetLines(); - if (mpVerticalRuler.get() != NULL) + if (mpVerticalRuler.get() != nullptr) mpVerticalRuler->SetLines(); - if (mpHorizontalRuler.get() != NULL) + if (mpHorizontalRuler.get() != nullptr) { nHOffs = mpHorizontalRuler->GetNullOffset() + mpHorizontalRuler->GetPageOffset(); } - if (mpVerticalRuler.get() != NULL) + if (mpVerticalRuler.get() != nullptr) { nVOffs = mpVerticalRuler->GetNullOffset() + mpVerticalRuler->GetPageOffset(); @@ -851,14 +851,14 @@ void DrawViewShell::ShowMousePosInfo(const Rectangle& rRect, nCnt++; } - if (mpHorizontalRuler.get() != NULL) + if (mpHorizontalRuler.get() != nullptr) mpHorizontalRuler->SetLines(nCnt, pHLines); - if (mpVerticalRuler.get() != NULL) + if (mpVerticalRuler.get() != nullptr) mpVerticalRuler->SetLines(nCnt, pVLines); } // display with coordinates in StatusBar - OSL_ASSERT (GetViewShell()!=NULL); + OSL_ASSERT (GetViewShell()!=nullptr); if ( !GetViewShell()->GetUIActiveClient() ) { SfxItemSet aSet(GetPool(), SID_CONTEXT, SID_CONTEXT, @@ -930,7 +930,7 @@ void DrawViewShell::ShowSnapLineContextMenu ( case SID_SET_SNAPITEM: { SfxUInt32Item aHelpLineItem (ID_VAL_INDEX, nSnapLineIndex); - const SfxPoolItem* aArguments[] = {&aHelpLineItem, NULL}; + const SfxPoolItem* aArguments[] = {&aHelpLineItem, nullptr}; GetViewFrame()->GetDispatcher()->Execute( SID_SET_SNAPITEM, SfxCallMode::SLOT, diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx index a789e8e751ef..88963c856f08 100644 --- a/sd/source/ui/view/drviews5.cxx +++ b/sd/source/ui/view/drviews5.cxx @@ -116,7 +116,7 @@ void DrawViewShell::ArrangeGUIElements() maTabControl->Hide(); - OSL_ASSERT (GetViewShell()!=NULL); + OSL_ASSERT (GetViewShell()!=nullptr); Client* pIPClient = static_cast<Client*>(GetViewShell()->GetIPClient()); bool bClientActive = false; if ( pIPClient && pIPClient->IsObjectInPlaceActive() ) @@ -436,7 +436,7 @@ void DrawViewShell::SetZoomFactor(const Fraction& rZoomX, const Fraction& rZoomY void DrawViewShell::HidePage() { FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager()->GetFormShell(); - if (pFormShell != NULL) + if (pFormShell != nullptr) pFormShell->PrepareClose(false); } @@ -538,7 +538,7 @@ void DrawViewShell::VisAreaChanged(const Rectangle& rRect) css::uno::Reference<css::accessibility::XAccessible> DrawViewShell::CreateAccessibleDocumentView (::sd::Window* pWindow) { - if (GetViewShellBase().GetController() != NULL) + if (GetViewShellBase().GetController() != nullptr) { accessibility::AccessibleDrawDocumentView* pDocumentView = new accessibility::AccessibleDrawDocumentView ( @@ -560,7 +560,7 @@ int DrawViewShell::GetActiveTabLayerIndex() const { const LayerTabBar* pBar = const_cast<DrawViewShell*>(this)->GetLayerTabControl (); - if (pBar != NULL) + if (pBar != nullptr) return pBar->GetPagePos (pBar->GetCurPageId()); else return -1; @@ -569,7 +569,7 @@ int DrawViewShell::GetActiveTabLayerIndex() const void DrawViewShell::SetActiveTabLayerIndex (int nIndex) { LayerTabBar* pBar = GetLayerTabControl (); - if (pBar != NULL) + if (pBar != nullptr) { // Ignore invalid indices silently. if (nIndex>=0 && nIndex<pBar->GetPageCount()) @@ -595,7 +595,7 @@ int DrawViewShell::GetTabLayerCount() const { const LayerTabBar* pBar = const_cast<DrawViewShell*>(this)->GetLayerTabControl (); - if (pBar != NULL) + if (pBar != nullptr) return pBar->GetPageCount(); else return 0; diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx index d6565591acbb..548039718438 100644 --- a/sd/source/ui/view/drviews6.cxx +++ b/sd/source/ui/view/drviews6.cxx @@ -86,15 +86,15 @@ void DrawViewShell::ExecFormText(SfxRequest& rReq) void DrawViewShell::GetFormTextState(SfxItemSet& rSet) { const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); - const SdrObject* pObj = NULL; - SvxFontWorkDialog* pDlg = NULL; + const SdrObject* pObj = nullptr; + SvxFontWorkDialog* pDlg = nullptr; sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId(); if (GetViewFrame()->HasChildWindow(nId)) { SfxChildWindow* pWnd = GetViewFrame()->GetChildWindow(nId); - pDlg = pWnd ? static_cast<SvxFontWorkDialog*>(pWnd->GetWindow()) : NULL; + pDlg = pWnd ? static_cast<SvxFontWorkDialog*>(pWnd->GetWindow()) : nullptr; } if ( rMarkList.GetMarkCount() == 1 ) @@ -155,7 +155,7 @@ void DrawViewShell::ExecAnimationWin( SfxRequest& rReq ) SfxChildWindow* pWnd = GetViewFrame()->GetChildWindow(nId); - pAnimWin = pWnd ? static_cast<AnimationWindow*>(pWnd->GetWindow()) : NULL; + pAnimWin = pWnd ? static_cast<AnimationWindow*>(pWnd->GetWindow()) : nullptr; if ( pAnimWin ) { @@ -282,7 +282,7 @@ void DrawViewShell::ExecBmpMask( SfxRequest& rReq ) case ( SID_BMPMASK_EXEC ) : { - SdrGrafObj* pObj = 0; + SdrGrafObj* pObj = nullptr; if( mpDrawView && mpDrawView->GetMarkedObjectList().GetMarkCount() ) pObj = dynamic_cast< SdrGrafObj* >( mpDrawView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj() ); @@ -306,7 +306,7 @@ void DrawViewShell::ExecBmpMask( SfxRequest& rReq ) SfxChildWindow* pWnd = GetViewFrame()->GetChildWindow( SvxBmpMaskChildWindow::GetChildWindowId()); - SvxBmpMask* pBmpMask = pWnd ? static_cast<SvxBmpMask*>(pWnd->GetWindow()) : NULL; + SvxBmpMask* pBmpMask = pWnd ? static_cast<SvxBmpMask*>(pWnd->GetWindow()) : nullptr; assert(pBmpMask); if (bCont && pBmpMask) { @@ -340,14 +340,14 @@ void DrawViewShell::ExecBmpMask( SfxRequest& rReq ) void DrawViewShell::GetBmpMaskState( SfxItemSet& rSet ) { const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); - const SdrObject* pObj = NULL; + const SdrObject* pObj = nullptr; sal_uInt16 nId = SvxBmpMaskChildWindow::GetChildWindowId(); bool bEnable = false; if ( GetViewFrame()->HasChildWindow( nId ) ) { SfxChildWindow* pWnd = GetViewFrame()->GetChildWindow(nId); - SvxBmpMask* pDlg = pWnd ? static_cast<SvxBmpMask*>(pWnd->GetWindow()) : NULL; + SvxBmpMask* pDlg = pWnd ? static_cast<SvxBmpMask*>(pWnd->GetWindow()) : nullptr; if (pDlg && pDlg->NeedsColorList()) pDlg->SetColorList(GetDoc()->GetColorList()); } diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index f165ddbb5fc9..63108ae9df26 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -194,7 +194,7 @@ IMPL_LINK_TYPED( DrawViewShell, ClipboardChanged, TransferableDataHelper*, pData TransferableDataHelper aDataHelper ( TransferableDataHelper::CreateFromSystemClipboard(GetActiveWindow())); ::std::unique_ptr<SvxClipboardFormatItem> pFormats (GetSupportedClipboardFormats(aDataHelper)); - if (mpDrawView == NULL) + if (mpDrawView == nullptr) return; mpCurrentClipboardFormats = std::move(pFormats); @@ -214,29 +214,29 @@ void DrawViewShell::GetDrawAttrState(SfxItemSet& rSet) ::Outliner* DrawViewShell::GetOutlinerForMasterPageOutlineTextObj(ESelection &rSel) { if( !mpDrawView ) - return NULL; + return nullptr; //when there is one object selected if (!mpDrawView->AreObjectsMarked() || (mpDrawView->GetMarkedObjectList().GetMarkCount() != 1)) - return NULL; + return nullptr; //and we are editing the outline object if (!mpDrawView->IsTextEdit()) - return NULL; + return nullptr; SdrPageView* pPageView = mpDrawView->GetSdrPageView(); if (!pPageView) - return NULL; + return nullptr; SdPage* pPage = static_cast<SdPage*>(pPageView->GetPage()); //only show these in a normal master page if (!pPage || (pPage->GetPageKind() != PK_STANDARD) || !pPage->IsMasterPage()) - return NULL; + return nullptr; OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView(); - ::Outliner* pOL = pOLV ? pOLV->GetOutliner() : NULL; + ::Outliner* pOL = pOLV ? pOLV->GetOutliner() : nullptr; if (!pOL) - return NULL; + return nullptr; rSel = pOLV->GetSelection(); return pOL; @@ -244,10 +244,10 @@ void DrawViewShell::GetDrawAttrState(SfxItemSet& rSet) void DrawViewShell::GetMenuState( SfxItemSet &rSet ) { - if (mpDrawView == NULL) + if (mpDrawView == nullptr) { // This assertion and return are here to prevent crashes. - DBG_ASSERT(mpDrawView!=NULL, "Please report this assertion to the Impress team."); + DBG_ASSERT(mpDrawView!=nullptr, "Please report this assertion to the Impress team."); return; } @@ -314,7 +314,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) { SdrObject* pObj = pPage->GetPresObj(PRESOBJ_OUTLINE); - if (pObj!=NULL ) + if (pObj!=nullptr ) { if( !pObj->IsEmptyPresObj() ) { @@ -633,7 +633,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) } else if( SfxItemState::DEFAULT == rSet.GetItemState( SID_CLIPBOARD_FORMAT_ITEMS ) ) { - if (mpCurrentClipboardFormats.get() != NULL) + if (mpCurrentClipboardFormats.get() != nullptr) rSet.Put(*mpCurrentClipboardFormats); } } @@ -643,14 +643,14 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) rSet.DisableItem(SID_CHANGEBEZIER); } - if (mpDrawView == NULL) + if (mpDrawView == nullptr) { // The mpDrawView was not NULL but is now. // The reason for this may be that the DrawViewShell has been // destroyed in the mean time. // We can only return immediately and hope that the deleted // DrawViewShell is not called again. - DBG_ASSERT(mpDrawView!=NULL, "Please report this assertion to the Impress team."); + DBG_ASSERT(mpDrawView!=nullptr, "Please report this assertion to the Impress team."); return; } @@ -1030,7 +1030,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) } // EditText active - if (GetViewShellBase().GetViewShellManager()->GetShell(RID_DRAW_TEXT_TOOLBOX) != NULL) + if (GetViewShellBase().GetViewShellManager()->GetShell(RID_DRAW_TEXT_TOOLBOX) != nullptr) { sal_uInt16 nCurrentSId = SID_ATTR_CHAR; @@ -1597,7 +1597,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) || rSet.GetItemState(SID_DISPLAY_MASTER_OBJECTS) == SfxItemState::DEFAULT) { SdPage* pPage = GetActualPage(); - if (pPage != NULL && GetDoc() != NULL) + if (pPage != nullptr && GetDoc() != nullptr) { SetOfByte aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers(); SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin(); @@ -1622,7 +1622,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) { bool bDisableSaveBackground = true; SdPage* pPage = GetActualPage(); - if (pPage != NULL && GetDoc() != NULL) + if (pPage != nullptr && GetDoc() != nullptr) { SfxItemSet aMergedAttr(GetDoc()->GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST, 0); SdStyleSheet* pStyleSheet = pPage->getPresentationStyle(HID_PSEUDOSHEET_BACKGROUND); @@ -1752,7 +1752,7 @@ void DrawViewShell::Execute (SfxRequest& rReq) case SID_SPELL_DIALOG: { SfxViewFrame* pViewFrame = GetViewFrame(); - if (rReq.GetArgs() != NULL) + if (rReq.GetArgs() != nullptr) pViewFrame->SetChildWindow (SID_SPELL_DIALOG, static_cast<const SfxBoolItem&>(rReq.GetArgs()-> Get(SID_SPELL_DIALOG)).GetValue()); diff --git a/sd/source/ui/view/drviews8.cxx b/sd/source/ui/view/drviews8.cxx index 75c1a1c40baf..4ef3dce4e7f1 100644 --- a/sd/source/ui/view/drviews8.cxx +++ b/sd/source/ui/view/drviews8.cxx @@ -98,7 +98,7 @@ void DrawViewShell::ScannerEvent( const css::lang::EventObject& ) Point aPnt ( ( aPageSize.Width() - aBmpSize.Width() ) >> 1, ( aPageSize.Height() - aBmpSize.Height() ) >> 1 ); aPnt += Point( pPage->GetLftBorder(), pPage->GetUppBorder() ); Rectangle aRect( aPnt, aBmpSize ); - SdrGrafObj* pGrafObj = NULL; + SdrGrafObj* pGrafObj = nullptr; bool bInsertNewObject = true; if( GetView()->AreObjectsMarked() ) @@ -118,7 +118,7 @@ void DrawViewShell::ScannerEvent( const css::lang::EventObject& ) { bInsertNewObject = false; pGrafObj->SetEmptyPresObj(false); - pGrafObj->SetOutlinerParaObject(NULL); + pGrafObj->SetOutlinerParaObject(nullptr); pGrafObj->SetGraphic( Graphic( aScanBmp ) ); } } diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx index 77af9534bf18..46abdffd0bfc 100644 --- a/sd/source/ui/view/drviews9.cxx +++ b/sd/source/ui/view/drviews9.cxx @@ -127,7 +127,7 @@ void DrawViewShell::ExecGallery(SfxRequest& rReq) aPnt += Point(pPage->GetLftBorder(), pPage->GetUppBorder()); Rectangle aRect (aPnt, aSize); - SdrGrafObj* pGrafObj = NULL; + SdrGrafObj* pGrafObj = nullptr; bool bInsertNewObject = true; @@ -152,7 +152,7 @@ void DrawViewShell::ExecGallery(SfxRequest& rReq) SdrGrafObj* pNewGrafObj = pGrafObj->Clone(); pNewGrafObj->SetEmptyPresObj(false); - pNewGrafObj->SetOutlinerParaObject(NULL); + pNewGrafObj->SetOutlinerParaObject(nullptr); pNewGrafObj->SetGraphic(aGraphic); OUString aStr(mpDrawView->GetDescriptionOfMarkedObjects()); diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx index 444e8bd5bb52..c79450a88a0f 100644 --- a/sd/source/ui/view/drviewsa.cxx +++ b/sd/source/ui/view/drviewsa.cxx @@ -95,7 +95,7 @@ public: // XEventListener virtual void SAL_CALL disposing( const lang::EventObject& rEventObject ) throw (uno::RuntimeException, std::exception) override; - void ParentDestroyed() { mpParent = NULL; } + void ParentDestroyed() { mpParent = nullptr; } }; ScannerEventListener::~ScannerEventListener() @@ -118,7 +118,7 @@ DrawViewShell::DrawViewShell( SfxViewFrame* pFrame, ViewShellBase& rViewShellBas uno::Reference<frame::XController>(&rViewShellBase.GetDrawController()), sfx2::sidebar::EnumContext::Context_Default)) { - if (pFrameViewArgument != NULL) + if (pFrameViewArgument != nullptr) mpFrameView = pFrameViewArgument; else mpFrameView = new FrameView(GetDoc()); @@ -138,7 +138,7 @@ DrawViewShell::~DrawViewShell() mpAnnotationManager.reset(); mpViewOverlayManager.reset(); - OSL_ASSERT (GetViewShell()!=NULL); + OSL_ASSERT (GetViewShell()!=nullptr); if( mxScannerListener.is() ) static_cast< ScannerEventListener* >( mxScannerListener.get() )->ParentDestroyed(); @@ -146,7 +146,7 @@ DrawViewShell::~DrawViewShell() // Remove references to items within Svx3DWin // (maybe do a listening sometime in Svx3DWin) sal_uInt16 nId = Svx3DChildWindow::GetChildWindowId(); - SfxChildWindow* pWindow = GetViewFrame() ? GetViewFrame()->GetChildWindow(nId) : NULL; + SfxChildWindow* pWindow = GetViewFrame() ? GetViewFrame()->GetChildWindow(nId) : nullptr; if(pWindow) { Svx3DWin* p3DWin = static_cast< Svx3DWin* > (pWindow->GetWindow()); @@ -188,7 +188,7 @@ DrawViewShell::~DrawViewShell() delete mpDrawView; // Set mpView to NULL so that the destructor of the ViewShell base class // does not access it. - mpView = mpDrawView = NULL; + mpView = mpDrawView = nullptr; mpFrameView->Disconnect(); maTabControl.disposeAndClear(); @@ -199,10 +199,10 @@ DrawViewShell::~DrawViewShell() */ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind) { - mpActualPage = 0; + mpActualPage = nullptr; mbMousePosFreezed = false; mbReadOnly = GetDocSh()->IsReadOnly(); - mpClipEvtLstnr = 0; + mpClipEvtLstnr = nullptr; mbPastePossible = false; mbIsLayerModeActive = false; @@ -211,7 +211,7 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind) mpFrameView->Connect(); - OSL_ASSERT (GetViewShell()!=NULL); + OSL_ASSERT (GetViewShell()!=nullptr); SetPool( &GetDoc()->GetPool() ); @@ -682,7 +682,7 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet) { SdrLayerAdmin& rLayerAdmin = GetDoc()->GetLayerAdmin(); SdrLayerID nLayer = 0, nOldLayer = 0; - SdrObject* pObj = NULL; + SdrObject* pObj = nullptr; const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); const size_t nMarkCount = rMarkList.GetMarkCount(); bool bOneLayer = true; @@ -733,7 +733,7 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet) void DrawViewShell::Notify (SfxBroadcaster&, const SfxHint& rHint) { const SfxSimpleHint* pSimple = dynamic_cast< const SfxSimpleHint* >(&rHint); - if (pSimple!=NULL && pSimple->GetId()==SFX_HINT_MODECHANGED) + if (pSimple!=nullptr && pSimple->GetId()==SFX_HINT_MODECHANGED) { // Change to selection when turning on read-only mode. if(GetDocSh()->IsReadOnly() && dynamic_cast< FuSelection* >( GetCurrentFunction().get() ) ) diff --git a/sd/source/ui/view/drviewsb.cxx b/sd/source/ui/view/drviewsb.cxx index 7694df7e187e..3d01d685ffe9 100644 --- a/sd/source/ui/view/drviewsb.cxx +++ b/sd/source/ui/view/drviewsb.cxx @@ -71,7 +71,7 @@ bool DrawViewShell::RenameSlide( sal_uInt16 nPageId, const OUString & rName ) if( GetDoc()->GetPageByName( rName, bOutDummy ) != SDRPAGE_NOTFOUND ) return false; - SdPage* pPageToRename = NULL; + SdPage* pPageToRename = nullptr; PageKind ePageKind = GetPageKind(); if( GetEditMode() == EM_PAGE ) @@ -128,7 +128,7 @@ bool DrawViewShell::RenameSlide( sal_uInt16 nPageId, const OUString & rName ) // accessibility.) slidesorter::SlideSorterViewShell* pSlideSorterViewShell = slidesorter::SlideSorterViewShell::GetSlideSorter(GetViewShellBase()); - if (pSlideSorterViewShell != NULL) + if (pSlideSorterViewShell != nullptr) { pSlideSorterViewShell->GetSlideSorter().GetController().PageNameHasChanged( nPageId-1, rName); @@ -205,7 +205,7 @@ void DrawViewShell::ModifyLayer ( // Call Invalidate at the form shell. FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager()->GetFormShell(); - if (pFormShell != NULL) + if (pFormShell != nullptr) pFormShell->Invalidate(); } } diff --git a/sd/source/ui/view/drviewsc.cxx b/sd/source/ui/view/drviewsc.cxx index 68266fc0591f..320992494893 100644 --- a/sd/source/ui/view/drviewsc.cxx +++ b/sd/source/ui/view/drviewsc.cxx @@ -57,8 +57,8 @@ void DrawViewShell::UpdateIMapDlg( SdrObject* pObj ) GetViewFrame()->HasChildWindow( SvxIMapDlgChildWindow::GetChildWindowId() ) ) { Graphic aGraphic; - ImageMap* pIMap = NULL; - TargetList* pTargetList = NULL; + ImageMap* pIMap = nullptr; + TargetList* pTargetList = nullptr; SdIMapInfo* pIMapInfo = GetDoc()->GetIMapInfo( pObj ); // get graphic from shape diff --git a/sd/source/ui/view/drviewsd.cxx b/sd/source/ui/view/drviewsd.cxx index fb08363d4021..bfc7d1db0666 100644 --- a/sd/source/ui/view/drviewsd.cxx +++ b/sd/source/ui/view/drviewsd.cxx @@ -178,7 +178,7 @@ void DrawViewShell::GetNavigatorWinState( SfxItemSet& rSet ) bEndless = xSlideshow->isEndless(); // Get the page for the current page number. - SdPage* pPage = 0; + SdPage* pPage = nullptr; if( nCurrentPage < GetDoc()->GetSdPageCount( PK_STANDARD ) ) pPage = GetDoc()->GetSdPage (nCurrentPage, PK_STANDARD); @@ -189,7 +189,7 @@ void DrawViewShell::GetNavigatorWinState( SfxItemSet& rSet ) { nState |= NAVBTN_PEN_DISABLED | NAVTLB_UPDATE; - if (mpActualPage != NULL) + if (mpActualPage != nullptr) { nCurrentPage = ( mpActualPage->GetPageNum() - 1 ) / 2; aPageName = mpActualPage->GetName(); diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 6133fe3bb1cf..be76784245a0 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -191,7 +191,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) { if(GetOldFunction() == GetCurrentFunction()) { - SetOldFunction(0); + SetOldFunction(nullptr); } } @@ -219,7 +219,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) GetCurrentFunction()->Deactivate(); } - SetCurrentFunction(0); + SetCurrentFunction(nullptr); SfxBindings& rBind = GetViewFrame()->GetBindings(); rBind.Invalidate(nOldSId); @@ -267,7 +267,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) { // get the form view FmFormView* pFormView = dynamic_cast<FmFormView*>( mpDrawView ); - SdrPageView* pPageView = pFormView ? pFormView->GetSdrPageView() : NULL; + SdrPageView* pPageView = pFormView ? pFormView->GetSdrPageView() : nullptr; if(pPageView) { @@ -348,7 +348,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) while (i < nMarkCnt && !b3DObjMarked) { - if (0 != dynamic_cast< E3dObject *>( rMarkList.GetMark(i)->GetMarkedSdrObj() )) + if (nullptr != dynamic_cast< E3dObject *>( rMarkList.GetMark(i)->GetMarkedSdrObj() )) { b3DObjMarked = true; } @@ -548,7 +548,7 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) sal_uInt16 nSlotId = GetOldFunction()->GetSlotID(); GetOldFunction()->Deactivate(); - SetOldFunction(0); + SetOldFunction(nullptr); SfxBindings& rBind = GetViewFrame()->GetBindings(); rBind.Invalidate( nSlotId ); @@ -933,7 +933,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) ( aDataHelper.HasFormat( SotClipboardFormatId::UNIFORMRESOURCELOCATOR ) && aDataHelper.GetINetBookmark( SotClipboardFormatId::UNIFORMRESOURCELOCATOR, aINetBookmark ) ) ) { - InsertURLField( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), "", NULL ); + InsertURLField( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), "", nullptr ); } } } @@ -952,7 +952,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) KeyEvent aKEvt( 0, aKCode); //pOLV->PostKeyEvent(aKEvt); // We use SdrObjEditView to handle DEL for underflow handling - mpDrawView->KeyInput(aKEvt, NULL); + mpDrawView->KeyInput(aKEvt, nullptr); } } @@ -1709,9 +1709,9 @@ void DrawViewShell::InsertURLButton(const OUString& rURL, const OUString& rText, SdrInsertFlags nOptions = SdrInsertFlags::SETDEFLAYER; - OSL_ASSERT (GetViewShell()!=NULL); + OSL_ASSERT (GetViewShell()!=nullptr); SfxInPlaceClient* pIpClient = GetViewShell()->GetIPClient(); - if (pIpClient!=NULL && pIpClient->IsObjectInPlaceActive()) + if (pIpClient!=nullptr && pIpClient->IsObjectInPlaceActive()) { nOptions |= SdrInsertFlags::DONTMARK; } diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx index e6641739f981..d3e8276e70ef 100644 --- a/sd/source/ui/view/drviewsf.cxx +++ b/sd/source/ui/view/drviewsf.cxx @@ -78,7 +78,7 @@ void DrawViewShell::GetCtrlState(SfxItemSet &rSet) if (rSet.GetItemState(SID_RELOAD) != SfxItemState::UNKNOWN) { // let "last version" of SFx en/disable - GetViewFrame()->GetSlotState (SID_RELOAD, NULL, &rSet); + GetViewFrame()->GetSlotState (SID_RELOAD, nullptr, &rSet); } if (SfxItemState::DEFAULT == rSet.GetItemState(SID_HYPERLINK_GETLINK)) @@ -207,7 +207,7 @@ void DrawViewShell::GetCtrlState(SfxItemSet &rSet) if ( SfxItemState::DEFAULT == rSet.GetItemState(SID_ATTR_YEAR2000) ) { FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager()->GetFormShell(); - if (pFormShell != NULL) + if (pFormShell != nullptr) { sal_uInt16 nState = 0; if (pFormShell->GetY2KState(nState)) @@ -488,7 +488,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) case SID_STYLE_WATERCAN: { - SfxPoolItem* pItem = NULL; + SfxPoolItem* pItem = nullptr; GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem); if (pFamilyItem && SfxTemplate::NIdToSfxFamilyId(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_PSEUDO) @@ -504,7 +504,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) case SID_STYLE_NEW: { - SfxPoolItem* pItem = NULL; + SfxPoolItem* pItem = nullptr; GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem); if (pFamilyItem && SfxTemplate::NIdToSfxFamilyId(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_PSEUDO) @@ -517,7 +517,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) case SID_STYLE_DRAGHIERARCHIE: { - SfxPoolItem* pItem = NULL; + SfxPoolItem* pItem = nullptr; GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem); if (pFamilyItem && SfxTemplate::NIdToSfxFamilyId(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_PSEUDO) @@ -531,7 +531,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) // It is not possible to create PseudoStyleSheets 'by Example'; // normal style sheets need a selected object for that - SfxPoolItem* pItem = NULL; + SfxPoolItem* pItem = nullptr; GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem); if (pFamilyItem) @@ -579,7 +579,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) aNewAttr.Put( aEditAttr, false ); std::unique_ptr<SvxNumRule> pNumRule; - const SfxPoolItem* pTmpItem=NULL; + const SfxPoolItem* pTmpItem=nullptr; sal_uInt16 nNumItemId = SID_ATTR_NUMBERING_RULE; sal_uInt16 nActNumLvl = mpDrawView->GetSelectionLevel(); pTmpItem=GetNumBulletItem(aNewAttr, nNumItemId); diff --git a/sd/source/ui/view/drviewsg.cxx b/sd/source/ui/view/drviewsg.cxx index ab5a8d3f214d..81fe3a7aba62 100644 --- a/sd/source/ui/view/drviewsg.cxx +++ b/sd/source/ui/view/drviewsg.cxx @@ -86,7 +86,7 @@ void DrawViewShell::GetIMapState( SfxItemSet& rSet ) SvxIMapDlg* pImageMapDialog = ViewShell::Implementation::GetImageMapDialog(); if ( ( dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr /*|| pObj->ISA( SdrOle2Obj )*/ ) - && pImageMapDialog!=NULL + && pImageMapDialog!=nullptr && ( pImageMapDialog->GetEditingObject() == static_cast<void const *>(pObj) ) ) { bDisable = false; diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx index b8a19814ea0b..26bb10613a80 100644 --- a/sd/source/ui/view/drviewsj.cxx +++ b/sd/source/ui/view/drviewsj.cxx @@ -268,10 +268,10 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) { const SvxFieldItem* pFldItem = pOLV->GetFieldAtSelection(); - if( !( pFldItem && (0 != dynamic_cast< const SvxDateField *>( pFldItem->GetField() ) || - 0 != dynamic_cast< const SvxAuthorField *>( pFldItem->GetField() ) || - 0 != dynamic_cast< const SvxExtFileField *>( pFldItem->GetField() ) || - 0 != dynamic_cast< const SvxExtTimeField *>( pFldItem->GetField() ) ) ) ) + if( !( pFldItem && (nullptr != dynamic_cast< const SvxDateField *>( pFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxAuthorField *>( pFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxExtFileField *>( pFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxExtTimeField *>( pFldItem->GetField() ) ) ) ) { rSet.DisableItem( SID_MODIFY_FIELD ); } diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx index 46f460d101bc..2b34d6b51eca 100644 --- a/sd/source/ui/view/frmview.cxx +++ b/sd/source/ui/view/frmview.cxx @@ -69,7 +69,7 @@ FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULK * SetFrameDragSingles(); SetSlidesPerRow(4); - if( NULL == pFrameView ) + if( nullptr == pFrameView ) { DrawDocShell* pDocShell = pDrawDoc->GetDocSh(); @@ -86,7 +86,7 @@ FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULK * SfxViewShell* pSfxViewSh = pSfxViewFrame->GetViewShell(); ViewShellBase* pBase = dynamic_cast<ViewShellBase*>( pSfxViewSh ); - if (pBase != NULL) + if (pBase != nullptr) { nSdViewShellCount++; diff --git a/sd/source/ui/view/grviewsh.cxx b/sd/source/ui/view/grviewsh.cxx index 9f17bae6e0a1..7e635aef641b 100644 --- a/sd/source/ui/view/grviewsh.cxx +++ b/sd/source/ui/view/grviewsh.cxx @@ -71,7 +71,7 @@ void GraphicViewShell::ChangeEditMode ( void GraphicViewShell::ArrangeGUIElements() { - if (mpLayerTabBar.get()!=NULL && mpLayerTabBar->IsVisible()) + if (mpLayerTabBar.get()!=nullptr && mpLayerTabBar->IsVisible()) { Size aSize = mpLayerTabBar->GetSizePixel(); const Size aFrameSize (GetViewFrame()->GetWindow().GetOutputSizePixel()); diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx index e4286e20b1f7..7e3f6d77f0a5 100644 --- a/sd/source/ui/view/outlnvs2.cxx +++ b/sd/source/ui/view/outlnvs2.cxx @@ -295,7 +295,7 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq) { #ifdef ENABLE_SDREMOTE SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - VclAbstractDialog* pDlg = pFact ? pFact->CreateRemoteDialog(GetActiveWindow()) : 0; + VclAbstractDialog* pDlg = pFact ? pFact->CreateRemoteDialog(GetActiveWindow()) : nullptr; if (pDlg) pDlg->Execute(); #endif @@ -314,7 +314,7 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq) SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); std::unique_ptr<VclAbstractDialog> pDlg(pFact ? pFact->CreateSdPhotoAlbumDialog( GetActiveWindow(), - GetDoc()) : 0); + GetDoc()) : nullptr); if (pDlg) { @@ -546,14 +546,14 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq) const SvxFieldItem* pOldFldItem = pOutlinerView->GetFieldAtSelection(); - if( pOldFldItem && ( 0 != dynamic_cast< const SvxURLField *>( pOldFldItem->GetField() ) || - 0 != dynamic_cast< const SvxDateField *>( pOldFldItem->GetField() ) || - 0 != dynamic_cast< const SvxTimeField *>( pOldFldItem->GetField() ) || - 0 != dynamic_cast< const SvxExtTimeField *>( pOldFldItem->GetField() ) || - 0 != dynamic_cast< const SvxExtFileField *>( pOldFldItem->GetField() ) || - 0 != dynamic_cast< const SvxAuthorField *>( pOldFldItem->GetField() ) || - 0 != dynamic_cast< const SvxPageField *>( pOldFldItem->GetField() ) || - 0 != dynamic_cast< const SvxPagesField *>( pOldFldItem->GetField() )) ) + if( pOldFldItem && ( nullptr != dynamic_cast< const SvxURLField *>( pOldFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxDateField *>( pOldFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxTimeField *>( pOldFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxExtTimeField *>( pOldFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxExtFileField *>( pOldFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxAuthorField *>( pOldFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxPageField *>( pOldFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxPagesField *>( pOldFldItem->GetField() )) ) { // select field, so it gets deleted on Insert ESelection aSel = pOutlinerView->GetSelection(); @@ -576,14 +576,14 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq) { const SvxFieldItem* pFldItem = pOutlinerView->GetFieldAtSelection(); - if( pFldItem && (0 != dynamic_cast< const SvxDateField *>( pFldItem->GetField() ) || - 0 != dynamic_cast< const SvxAuthorField *>( pFldItem->GetField() ) || - 0 != dynamic_cast< const SvxExtFileField *>( pFldItem->GetField() ) || - 0 != dynamic_cast< const SvxExtTimeField *>( pFldItem->GetField() ) ) ) + if( pFldItem && (nullptr != dynamic_cast< const SvxDateField *>( pFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxAuthorField *>( pFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxExtFileField *>( pFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxExtTimeField *>( pFldItem->GetField() ) ) ) { // Dialog... SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSdModifyFieldDlg> pDlg(pFact ? pFact->CreateSdModifyFieldDlg(GetActiveWindow(), pFldItem->GetField(), pOutlinerView->GetAttribs() ) : 0); + std::unique_ptr<AbstractSdModifyFieldDlg> pDlg(pFact ? pFact->CreateSdModifyFieldDlg(GetActiveWindow(), pFldItem->GetField(), pOutlinerView->GetAttribs() ) : nullptr); if( pDlg && (pDlg->Execute() == RET_OK) ) { std::unique_ptr<SvxFieldData> pField(pDlg->GetField()); diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index 63c45d014a47..000bef80181a 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -190,14 +190,14 @@ OutlineViewShell::OutlineViewShell ( vcl::Window* pParentWindow, FrameView* pFrameViewArgument) : ViewShell(pFrame, pParentWindow, rViewShellBase), - pOlView(NULL), - pLastPage( NULL ), - pClipEvtLstnr(NULL), + pOlView(nullptr), + pLastPage( nullptr ), + pClipEvtLstnr(nullptr), bPastePossible(false), mbInitialized(false) { - if (pFrameViewArgument != NULL) + if (pFrameViewArgument != nullptr) mpFrameView = pFrameViewArgument; else mpFrameView = new FrameView(GetDoc()); @@ -260,7 +260,7 @@ void OutlineViewShell::ArrangeGUIElements () ViewShell::ArrangeGUIElements (); ::sd::Window* pWindow = mpContentWindow.get(); - if (pWindow != NULL) + if (pWindow != nullptr) { pWindow->SetMinZoomAutoCalc(false); @@ -592,7 +592,7 @@ void OutlineViewShell::FuSupport(SfxRequest &rReq) case SID_TRANSLITERATE_HIRAGANA: case SID_TRANSLITERATE_KATAGANA: { - OutlinerView* pOLV = pOlView ? pOlView->GetViewByWindow( GetActiveWindow() ) : 0; + OutlinerView* pOLV = pOlView ? pOlView->GetViewByWindow( GetActiveWindow() ) : nullptr; if( pOLV ) { using namespace ::com::sun::star::i18n; @@ -694,7 +694,7 @@ void OutlineViewShell::FuPermanent(SfxRequest &rReq) if(HasOldFunction()) { GetOldFunction()->Deactivate(); - SetOldFunction(0); + SetOldFunction(nullptr); } if(HasCurrentFunction()) @@ -939,10 +939,10 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet ) { const SvxFieldItem* pFldItem = pOutlinerView->GetFieldAtSelection(); - if( !( pFldItem && (0 != dynamic_cast< const SvxDateField *>( pFldItem->GetField() ) || - 0 != dynamic_cast< const SvxAuthorField *>( pFldItem->GetField() ) || - 0 != dynamic_cast< const SvxExtFileField *>( pFldItem->GetField() ) || - 0 != dynamic_cast< const SvxExtTimeField *>( pFldItem->GetField() ) ) ) ) + if( !( pFldItem && (nullptr != dynamic_cast< const SvxDateField *>( pFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxAuthorField *>( pFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxExtFileField *>( pFldItem->GetField() ) || + nullptr != dynamic_cast< const SvxExtTimeField *>( pFldItem->GetField() ) ) ) ) { rSet.DisableItem( SID_MODIFY_FIELD ); } @@ -963,7 +963,7 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet ) { SdrObject* pObj = pPage->GetPresObj(PRESOBJ_OUTLINE); - if (pObj!=NULL ) + if (pObj!=nullptr ) { if( !pObj->IsEmptyPresObj() ) { @@ -1122,7 +1122,7 @@ bool OutlineViewShell::PrepareClose( bool bUI ) if( !ViewShell::PrepareClose(bUI) ) return false; - return pOlView == NULL || pOlView->PrepareClose(bUI); + return pOlView == nullptr || pOlView->PrepareClose(bUI); } /** @@ -1192,7 +1192,7 @@ void OutlineViewShell::Execute(SfxRequest& rReq) case SID_SPELL_DIALOG: { SfxViewFrame* pViewFrame = GetViewFrame(); - if (rReq.GetArgs() != NULL) + if (rReq.GetArgs() != nullptr) pViewFrame->SetChildWindow (SID_SPELL_DIALOG, static_cast<const SfxBoolItem&>(rReq.GetArgs()-> Get(SID_SPELL_DIALOG)).GetValue()); @@ -1308,8 +1308,8 @@ void OutlineViewShell::GetStatusBarState(SfxItemSet& rSet) std::vector<Paragraph*> aSelList; pActiveView->CreateSelectionList(aSelList); - Paragraph *pFirstPara = NULL; - Paragraph *pLastPara = NULL; + Paragraph *pFirstPara = nullptr; + Paragraph *pLastPara = nullptr; if (!aSelList.empty()) { @@ -1396,7 +1396,7 @@ bool OutlineViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin) bool bReturn = false; OutlineViewPageChangesGuard aGuard(pOlView); - if (pWin == NULL && HasCurrentFunction()) + if (pWin == nullptr && HasCurrentFunction()) { bReturn = GetCurrentFunction()->KeyInput(rKEvt); } @@ -1478,7 +1478,7 @@ void OutlineViewShell::GetAttrState( SfxItemSet& rSet ) case SID_STYLE_EDIT: { - SfxPoolItem* pItem = NULL; + SfxPoolItem* pItem = nullptr; GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem); if (pFamilyItem && SfxTemplate::NIdToSfxFamilyId(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_PSEUDO) @@ -1601,7 +1601,7 @@ bool OutlineViewShell::UpdateTitleObject( SdPage* pPage, Paragraph* pPara ) } // if we have a title object and a text, set the text - OutlinerParaObject* pOPO = pTO ? rOutliner.CreateParaObject(rOutliner.GetAbsPos(pPara), 1) : NULL; + OutlinerParaObject* pOPO = pTO ? rOutliner.CreateParaObject(rOutliner.GetAbsPos(pPara), 1) : nullptr; if (pOPO) { pOPO->SetOutlinerMode( OUTLINERMODE_TITLEOBJECT ); @@ -1664,8 +1664,8 @@ bool OutlineViewShell::UpdateOutlineObject( SdPage* pPage, Paragraph* pPara ) return false; ::Outliner& rOutliner = pOlView->GetOutliner(); - OutlinerParaObject* pOPO = NULL; - SdrTextObj* pTO = NULL; + OutlinerParaObject* pOPO = nullptr; + SdrTextObj* pTO = nullptr; bool bNewObject = false; @@ -1849,8 +1849,8 @@ void OutlineViewShell::VisAreaChanged(const Rectangle& rRect) css::uno::Reference<css::accessibility::XAccessible> OutlineViewShell::CreateAccessibleDocumentView (::sd::Window* pWindow) { - OSL_ASSERT (GetViewShell()!=NULL); - if (GetViewShell()->GetController() != NULL) + OSL_ASSERT (GetViewShell()!=nullptr); + if (GetViewShell()->GetController() != nullptr) { ::accessibility::AccessibleOutlineView* pDocumentView = new ::accessibility::AccessibleOutlineView ( diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index 5fdbfd98edd5..5e923c944665 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -94,7 +94,7 @@ OutlineView::OutlineView( DrawDocShell& rDocSh, vcl::Window* pWindow, OutlineVie , mnPagesToProcess(0) , mnPagesProcessed(0) , mbFirstPaint(true) -, mpProgress(NULL) +, mpProgress(nullptr) , maDocColor( COL_WHITE ) , maLRSpaceItem( 0, 0, 2000, 0, EE_PARA_OUTLLRSPACE ) { @@ -114,7 +114,7 @@ OutlineView::OutlineView( DrawDocShell& rDocSh, vcl::Window* pWindow, OutlineVie // insert View into Outliner for (sal_uInt16 nView = 0; nView < MAX_OUTLINERVIEWS; nView++) { - mpOutlinerView[nView] = NULL; + mpOutlinerView[nView] = nullptr; } mpOutlinerView[0] = new OutlinerView(&mrOutliner, pWindow); @@ -160,7 +160,7 @@ OutlineView::OutlineView( DrawDocShell& rDocSh, vcl::Window* pWindow, OutlineVie // Tell undo manager of the document about the undo manager of the // outliner, so that the former can synchronize with the later. sd::UndoManager* pDocUndoMgr = dynamic_cast<sd::UndoManager*>(mpDocSh->GetUndoManager()); - if (pDocUndoMgr != NULL) + if (pDocUndoMgr != nullptr) pDocUndoMgr->SetLinkedUndoManager(&mrOutliner.GetUndoManager()); } @@ -169,7 +169,7 @@ OutlineView::OutlineView( DrawDocShell& rDocSh, vcl::Window* pWindow, OutlineVie */ OutlineView::~OutlineView() { - DBG_ASSERT(maDragAndDropModelGuard.get() == 0, "sd::OutlineView::~OutlineView(), prior drag operation not finished correctly!" ); + DBG_ASSERT(maDragAndDropModelGuard.get() == nullptr, "sd::OutlineView::~OutlineView(), prior drag operation not finished correctly!" ); Link<tools::EventMultiplexerEvent&,void> aLink( LINK(this,OutlineView,EventMultiplexerListener) ); mrOutlineViewShell.GetViewShellBase().GetEventMultiplexer()->RemoveEventListener( aLink ); @@ -180,11 +180,11 @@ OutlineView::~OutlineView() // unregister OutlinerViews and destroy them for (sal_uInt16 nView = 0; nView < MAX_OUTLINERVIEWS; nView++) { - if (mpOutlinerView[nView] != NULL) + if (mpOutlinerView[nView] != nullptr) { mrOutliner.RemoveView( mpOutlinerView[nView] ); delete mpOutlinerView[nView]; - mpOutlinerView[nView] = NULL; + mpOutlinerView[nView] = nullptr; } } @@ -245,7 +245,7 @@ void OutlineView::AddWindowToPaintView(OutputDevice* pWin, vcl::Window* pWindow) while (nView < MAX_OUTLINERVIEWS && !bAdded) { - if (mpOutlinerView[nView] == NULL) + if (mpOutlinerView[nView] == nullptr) { mpOutlinerView[nView] = new OutlinerView(&mrOutliner, dynamic_cast< ::sd::Window* >(pWin)); mpOutlinerView[nView]->SetBackgroundColor( aWhiteColor ); @@ -280,7 +280,7 @@ void OutlineView::DeleteWindowFromPaintView(OutputDevice* pWin) while (nView < MAX_OUTLINERVIEWS && !bRemoved) { - if (mpOutlinerView[nView] != NULL) + if (mpOutlinerView[nView] != nullptr) { pWindow = mpOutlinerView[nView]->GetWindow(); @@ -288,7 +288,7 @@ void OutlineView::DeleteWindowFromPaintView(OutputDevice* pWin) { mrOutliner.RemoveView( mpOutlinerView[nView] ); delete mpOutlinerView[nView]; - mpOutlinerView[nView] = NULL; + mpOutlinerView[nView] = nullptr; bRemoved = true; } } @@ -304,10 +304,10 @@ void OutlineView::DeleteWindowFromPaintView(OutputDevice* pWin) */ OutlinerView* OutlineView::GetViewByWindow (vcl::Window* pWin) const { - OutlinerView* pOlView = NULL; + OutlinerView* pOlView = nullptr; for (sal_uInt16 nView = 0; nView < MAX_OUTLINERVIEWS; nView++) { - if (mpOutlinerView[nView] != NULL) + if (mpOutlinerView[nView] != nullptr) { if ( pWin == mpOutlinerView[nView]->GetWindow() ) { @@ -337,7 +337,7 @@ Paragraph* OutlineView::GetPrevTitle(const Paragraph* pPara) } } - return NULL; + return nullptr; } /** @@ -357,7 +357,7 @@ Paragraph* OutlineView::GetNextTitle(const Paragraph* pPara) } while( pResult ); - return NULL; + return nullptr; } /** @@ -367,7 +367,7 @@ IMPL_LINK_TYPED( OutlineView, ParagraphInsertedHdl, ::Outliner *, pOutliner, voi { // we get calls to this handler during binary insert of drag and drop contents but // we ignore it here and handle it later in OnEndPasteOrDrop() - if( maDragAndDropModelGuard.get() == 0 ) + if( maDragAndDropModelGuard.get() == nullptr ) { OutlineViewPageChangesGuard aGuard(this); @@ -546,7 +546,7 @@ IMPL_LINK_TYPED( OutlineView, ParagraphRemovingHdl, ::Outliner *, pOutliner, voi if(mpProgress) { delete mpProgress; - mpProgress = NULL; + mpProgress = nullptr; } mnPagesToProcess = 0; mnPagesProcessed = 0; @@ -583,7 +583,7 @@ IMPL_LINK_TYPED( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner, void ) std::vector<Paragraph*> aSelList; pOlView->CreateSelectionList(aSelList); - Paragraph *pParagraph = NULL; + Paragraph *pParagraph = nullptr; for (std::vector<Paragraph*>::const_iterator iter = aSelList.begin(); iter != aSelList.end(); ++iter) { pParagraph = *iter; @@ -625,7 +625,7 @@ IMPL_LINK_TYPED( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner, void ) if (mnPagesToProcess > PROCESS_WITH_PROGRESS_THRESHOLD && mpProgress) { delete mpProgress; - mpProgress = NULL; + mpProgress = nullptr; } else mpDocSh->SetWaitCursor( false ); @@ -678,7 +678,7 @@ IMPL_LINK_TYPED( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner, void ) if(mpProgress) { delete mpProgress; - mpProgress = NULL; + mpProgress = nullptr; } mnPagesToProcess = 0; mnPagesProcessed = 0; @@ -725,10 +725,10 @@ IMPL_LINK_TYPED( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner, void ) if( pPage ) { - SfxStyleSheet* pStyleSheet = NULL; + SfxStyleSheet* pStyleSheet = nullptr; sal_Int32 nPara = pOutliner->GetAbsPos( pPara ); sal_Int16 nDepth = pOutliner->GetDepth( nPara ); - bool bSubTitle = pPage->GetPresObj(PRESOBJ_TEXT) != NULL; + bool bSubTitle = pPage->GetPresObj(PRESOBJ_TEXT) != nullptr; if( ::Outliner::HasParaFlag(pPara, ParaFlag::ISPAGE) ) { @@ -798,14 +798,14 @@ IMPL_LINK_NOARG_TYPED(OutlineView, StatusEventHdl, EditStatus&, void) IMPL_LINK_NOARG_TYPED(OutlineView, BeginDropHdl, EditView*, void) { - DBG_ASSERT(maDragAndDropModelGuard.get() == 0, "sd::OutlineView::BeginDropHdl(), prior drag operation not finished correctly!" ); + DBG_ASSERT(maDragAndDropModelGuard.get() == nullptr, "sd::OutlineView::BeginDropHdl(), prior drag operation not finished correctly!" ); maDragAndDropModelGuard.reset( new OutlineViewModelChangeGuard( *this ) ); } IMPL_LINK_NOARG_TYPED(OutlineView, EndDropHdl, EditView*, void) { - maDragAndDropModelGuard.reset(0); + maDragAndDropModelGuard.reset(nullptr); } /** @@ -859,13 +859,13 @@ IMPL_LINK_TYPED( OutlineView, EndMovingHdl, ::Outliner *, pOutliner, void ) DBG_ASSERT( isRecordingUndo(), "sd::OutlineView::EndMovingHdl(), model change without undo?!" ); // look for insertion position via the first paragraph - Paragraph* pSearchIt = maSelectedParas.empty() ? NULL : *(maSelectedParas.begin()); + Paragraph* pSearchIt = maSelectedParas.empty() ? nullptr : *(maSelectedParas.begin()); // look for the first of the selected paragraphs in the new ordering sal_uInt16 nPosNewOrder = 0; sal_Int32 nParaPos = 0; Paragraph* pPara = pOutliner->GetParagraph( 0 ); - Paragraph* pPrev = NULL; + Paragraph* pPrev = nullptr; while (pPara && pPara != pSearchIt) { if( ::Outliner::HasParaFlag(pPara, ParaFlag::ISPAGE) ) @@ -920,7 +920,7 @@ IMPL_LINK_TYPED( OutlineView, EndMovingHdl, ::Outliner *, pOutliner, void ) SdrTextObj* OutlineView::GetTitleTextObject(SdrPage* pPage) { const size_t nObjectCount = pPage->GetObjCount(); - SdrTextObj* pResult = NULL; + SdrTextObj* pResult = nullptr; for (size_t nObject = 0; nObject < nObjectCount; ++nObject) { @@ -941,7 +941,7 @@ SdrTextObj* OutlineView::GetTitleTextObject(SdrPage* pPage) SdrTextObj* OutlineView::GetOutlineTextObject(SdrPage* pPage) { const size_t nObjectCount = pPage->GetObjCount(); - SdrTextObj* pResult = NULL; + SdrTextObj* pResult = nullptr; for (size_t nObject = 0; nObject < nObjectCount; ++nObject) { @@ -958,7 +958,7 @@ SdrTextObj* OutlineView::GetOutlineTextObject(SdrPage* pPage) SdrTextObj* OutlineView::CreateTitleTextObject(SdPage* pPage) { - DBG_ASSERT( GetTitleTextObject(pPage) == 0, "sd::OutlineView::CreateTitleTextObject(), there is already a title text object!" ); + DBG_ASSERT( GetTitleTextObject(pPage) == nullptr, "sd::OutlineView::CreateTitleTextObject(), there is already a title text object!" ); if( pPage->GetAutoLayout() == AUTOLAYOUT_NONE ) { @@ -969,7 +969,7 @@ SdrTextObj* OutlineView::CreateTitleTextObject(SdPage* pPage) { // we already have a layout with a title but the title // object was deleted, create a new one - pPage->InsertAutoLayoutShape( 0, PRESOBJ_TITLE, false, pPage->GetTitleRect(), true ); + pPage->InsertAutoLayoutShape( nullptr, PRESOBJ_TITLE, false, pPage->GetTitleRect(), true ); } return GetTitleTextObject(pPage); @@ -977,7 +977,7 @@ SdrTextObj* OutlineView::CreateTitleTextObject(SdPage* pPage) SdrTextObj* OutlineView::CreateOutlineTextObject(SdPage* pPage) { - DBG_ASSERT( GetOutlineTextObject(pPage) == 0, "sd::OutlineView::CreateOutlineTextObject(), there is already a layout text object!" ); + DBG_ASSERT( GetOutlineTextObject(pPage) == nullptr, "sd::OutlineView::CreateOutlineTextObject(), there is already a layout text object!" ); AutoLayout eNewLayout = pPage->GetAutoLayout(); switch( eNewLayout ) @@ -1003,7 +1003,7 @@ SdrTextObj* OutlineView::CreateOutlineTextObject(SdPage* pPage) { // we already have a layout with a text but the text // object was deleted, create a new one - pPage->InsertAutoLayoutShape( 0, + pPage->InsertAutoLayoutShape( nullptr, PRESOBJ_OUTLINE, false, pPage->GetLayoutRect(), true ); } @@ -1015,8 +1015,8 @@ SdrTextObj* OutlineView::CreateOutlineTextObject(SdPage* pPage) bool OutlineView::PrepareClose(bool) { ::sd::UndoManager* pDocUndoMgr = dynamic_cast<sd::UndoManager*>(mpDocSh->GetUndoManager()); - if (pDocUndoMgr != NULL) - pDocUndoMgr->SetLinkedUndoManager(NULL); + if (pDocUndoMgr != nullptr) + pDocUndoMgr->SetLinkedUndoManager(nullptr); mrOutliner.GetUndoManager().Clear(); @@ -1068,14 +1068,14 @@ void OutlineView::FillOutliner() ResetLinks(); mrOutliner.SetUpdateMode(false); - Paragraph* pTitleToSelect = NULL; + Paragraph* pTitleToSelect = nullptr; sal_uInt16 nPageCount = mrDoc.GetSdPageCount(PK_STANDARD); // fill outliner with paragraphs from slides title & (outlines|subtitles) for (sal_uInt16 nPage = 0; nPage < nPageCount; nPage++) { SdPage* pPage = mrDoc.GetSdPage(nPage, PK_STANDARD); - Paragraph * pPara = NULL; + Paragraph * pPara = nullptr; // take text from title shape SdrTextObj* pTO = GetTitleTextObject(pPage); @@ -1092,7 +1092,7 @@ void OutlineView::FillOutliner() } } - if( pPara == 0 ) // no title, insert an empty paragraph + if( pPara == nullptr ) // no title, insert an empty paragraph { pPara = mrOutliner.Insert(OUString()); mrOutliner.SetDepth(pPara, -1); @@ -1116,7 +1116,7 @@ void OutlineView::FillOutliner() // take text from subtitle or outline pTO = static_cast<SdrTextObj*>(pPage->GetPresObj(PRESOBJ_TEXT)); - const bool bSubTitle = pTO != 0; + const bool bSubTitle = pTO != nullptr; if (!pTO) // if no subtile found, try outline pTO = GetOutlineTextObject(pPage); @@ -1205,7 +1205,7 @@ SdPage* OutlineView::GetActualPage() std::vector<Paragraph*> aSelList; pActiveView->CreateSelectionList(aSelList); - Paragraph *pPar = aSelList.empty() ? NULL : *(aSelList.begin()); + Paragraph *pPar = aSelList.empty() ? nullptr : *(aSelList.begin()); SdPage* pCurrent = GetPageForParagraph(pPar); DBG_ASSERT( pCurrent || @@ -1235,7 +1235,7 @@ SdPage* OutlineView::GetPageForParagraph( Paragraph* pPara ) if( nPageToSelect < (sal_uInt32)mrDoc.GetSdPageCount( PK_STANDARD ) ) return static_cast< SdPage* >( mrDoc.GetSdPage( (sal_uInt16)nPageToSelect, PK_STANDARD) ); - return 0; + return nullptr; } Paragraph* OutlineView::GetParagraphForPage( ::Outliner& rOutl, SdPage* pPage ) @@ -1317,7 +1317,7 @@ void OutlineView::SetSelectedPages() if( ::Outliner::HasParaFlag(pPara, ParaFlag::ISPAGE) ) // one page { SdPage* pPage = mrDoc.GetSdPage(nPos, PK_STANDARD); - DBG_ASSERT(pPage!=NULL, + DBG_ASSERT(pPage!=nullptr, "Trying to select non-existing page OutlineView::SetSelectedPages()"); if (pPage) @@ -1406,7 +1406,7 @@ void OutlineView::onUpdateStyleSettings( bool bForceUpdate /* = false */ ) sal_uInt16 nView; for( nView = 0; nView < MAX_OUTLINERVIEWS; nView++ ) { - if (mpOutlinerView[nView] != NULL) + if (mpOutlinerView[nView] != nullptr) { mpOutlinerView[nView]->SetBackgroundColor( aDocColor ); @@ -1445,7 +1445,7 @@ IMPL_LINK_TYPED(OutlineView, EventMultiplexerListener, ::sd::tools::EventMultipl mrOutliner.Clear(); FillOutliner(); ::sd::Window* pWindow = mrOutlineViewShell.GetActiveWindow(); - if (pWindow != NULL) + if (pWindow != nullptr) pWindow->Invalidate(); } } @@ -1512,7 +1512,7 @@ void OutlineView::UpdateDocument() pPara = GetNextTitle(pPara); } - DBG_ASSERT( pPara == 0, "sd::OutlineView::UpdateDocument(), slides are out of sync, creating missing ones" ); + DBG_ASSERT( pPara == nullptr, "sd::OutlineView::UpdateDocument(), slides are out of sync, creating missing ones" ); while( pPara ) { SdPage* pPage = InsertSlideForParagraph( pPara ); @@ -1538,7 +1538,7 @@ void OutlineView::TryToMergeUndoActions() { // find the top EditUndo action in the top undo action list size_t nAction = pListAction->aUndoActions.size(); - EditUndo* pEditUndo = 0; + EditUndo* pEditUndo = nullptr; while( !pEditUndo && nAction ) { pEditUndo = dynamic_cast< EditUndo* >(pListAction->aUndoActions.GetUndoAction(--nAction)); @@ -1550,7 +1550,7 @@ void OutlineView::TryToMergeUndoActions() while( pEditUndo && nAction ) { if( dynamic_cast< EditUndo* >(pListAction->aUndoActions.GetUndoAction(--nAction)) ) - pEditUndo = 0; + pEditUndo = nullptr; } // do we have one and only one EditUndo action in the top undo list? @@ -1559,7 +1559,7 @@ void OutlineView::TryToMergeUndoActions() // yes, see if we can merge it with the prev undo list nAction = pPrevListAction->aUndoActions.size(); - EditUndo* pPrevEditUndo = 0; + EditUndo* pPrevEditUndo = nullptr; while( !pPrevEditUndo && nAction ) pPrevEditUndo = dynamic_cast< EditUndo* >(pPrevListAction->aUndoActions.GetUndoAction(--nAction)); @@ -1579,7 +1579,7 @@ void OutlineView::TryToMergeUndoActions() if( pDocUndoManager && ( pListAction->aUndoActions.size() == 1 )) { SfxLinkUndoAction* pLinkAction = dynamic_cast< SfxLinkUndoAction* >( pListAction->aUndoActions.GetUndoAction(0) ); - SfxLinkUndoAction* pPrevLinkAction = 0; + SfxLinkUndoAction* pPrevLinkAction = nullptr; if( pLinkAction ) { @@ -1742,7 +1742,7 @@ void OutlineView::OnBeginPasteOrDrop( PasteOrDropInfos* /*pInfos*/ ) get the correct style sheet and new slides are inserted. */ void OutlineView::OnEndPasteOrDrop( PasteOrDropInfos* pInfos ) { - SdPage* pPage = 0; + SdPage* pPage = nullptr; SfxStyleSheetBasePool* pStylePool = GetDoc().GetStyleSheetPool(); for( sal_Int32 nPara = pInfos->nStartPara; nPara <= pInfos->nEndPara; nPara++ ) diff --git a/sd/source/ui/view/presvish.cxx b/sd/source/ui/view/presvish.cxx index 7182979fb944..05cb11dcb176 100644 --- a/sd/source/ui/view/presvish.cxx +++ b/sd/source/ui/view/presvish.cxx @@ -96,7 +96,7 @@ void PresentationViewShell::FinishInitialization( FrameView* pFrameView ) // Use the frame view that comes form the view shell that initiated our // creation. - if (pFrameView != NULL) + if (pFrameView != nullptr) { GetFrameView()->Disconnect(); SetFrameView (pFrameView); @@ -110,12 +110,12 @@ void PresentationViewShell::FinishInitialization( FrameView* pFrameView ) SvxRuler* PresentationViewShell::CreateHRuler(::sd::Window*, bool) { - return NULL; + return nullptr; } SvxRuler* PresentationViewShell::CreateVRuler(::sd::Window*) { - return NULL; + return nullptr; } void PresentationViewShell::Activate( bool bIsMDIActivate ) diff --git a/sd/source/ui/view/sdruler.cxx b/sd/source/ui/view/sdruler.cxx index a1fa423e86ba..c6297eeef0ac 100644 --- a/sd/source/ui/view/sdruler.cxx +++ b/sd/source/ui/view/sdruler.cxx @@ -70,7 +70,7 @@ void RulerCtrlItem::StateChanged( sal_uInt16 nSId, SfxItemState, const SfxPoolIt Ruler::Ruler( DrawViewShell& rViewSh, vcl::Window* pParent, ::sd::Window* pWin, SvxRulerSupportFlags nRulerFlags, SfxBindings& rBindings, WinBits nWinStyle) : SvxRuler(pParent, pWin, nRulerFlags, rBindings, nWinStyle) - , pSdView(NULL) + , pSdView(nullptr) , pSdWin(pWin) , pDrViewShell(&rViewSh) { diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 789e405c780f..463a90c7d16f 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -109,9 +109,9 @@ View::View(SdDrawDocument& rDrawDoc, OutputDevice* pOutDev, mrDoc(rDrawDoc), mpDocSh(rDrawDoc.GetDocSh()), mpViewSh(pViewShell), - mpDragSrcMarkList(NULL), - mpDropMarkerObj(NULL), - mpDropMarker(NULL), + mpDragSrcMarkList(nullptr), + mpDropMarkerObj(nullptr), + mpDropMarker(nullptr), mnDragSrcPgNum(SDRPAGE_NOTFOUND), mnAction(DND_ACTION_NONE), mnLockRedrawSmph(0), @@ -149,7 +149,7 @@ void View::ImplClearDrawDropMarker() if(mpDropMarker) { delete mpDropMarker; - mpDropMarker = 0L; + mpDropMarker = nullptr; } } @@ -653,7 +653,7 @@ void OutlinerMasterViewFilter::End() { OutlinerView* pOutlView = m_pOutl->GetView(0); pOutlView->SetReadOnly(m_bReadOnly); - m_pOutl = NULL; + m_pOutl = nullptr; } } @@ -663,13 +663,13 @@ bool View::SdrBeginTextEdit( SdrOutliner* pOutl, OutlinerView* pGivenOutlinerView, bool bDontDeleteOutliner, bool bOnlyOneView, bool bGrabFocus ) { - SdrPage* pPage = pObj ? pObj->GetPage() : NULL; + SdrPage* pPage = pObj ? pObj->GetPage() : nullptr; bool bMasterPage = pPage && pPage->IsMasterPage(); GetViewShell()->GetViewShellBase().GetEventMultiplexer()->MultiplexEvent( sd::tools::EventMultiplexerEvent::EID_BEGIN_TEXT_EDIT, static_cast<void*>(pObj) ); - if( pOutl==NULL && pObj ) + if( pOutl==nullptr && pObj ) pOutl = SdrMakeOutliner(OUTLINERMODE_TEXTOBJECT, *pObj->GetModel()); // make draw&impress specific initialisations @@ -726,11 +726,11 @@ bool View::SdrBeginTextEdit( { aBackground = pObj->GetPage()->GetPageBackgroundColor(pPV); } - if (pOL != NULL) + if (pOL != nullptr) pOL->SetBackgroundColor( aBackground ); } - if (pOL != NULL) + if (pOL != nullptr) { pOL->SetParaInsertedHdl(LINK(this, View, OnParagraphInsertedHdl)); pOL->SetParaRemovingHdl(LINK(this, View, OnParagraphRemovingHdl)); @@ -740,7 +740,7 @@ bool View::SdrBeginTextEdit( if (bMasterPage && bReturn && pOutl) { const SdrTextObj* pTextObj = pOutl->GetTextObj(); - const SdPage* pSdPage = pTextObj ? static_cast<const SdPage*>(pTextObj->GetPage()) : NULL; + const SdPage* pSdPage = pTextObj ? static_cast<const SdPage*>(pTextObj->GetPage()) : nullptr; const PresObjKind eKind = pSdPage ? pSdPage->GetPresObjKind(const_cast<SdrTextObj*>(pTextObj)) : PRESOBJ_NONE; switch (eKind) { @@ -1211,7 +1211,7 @@ void View::OnEndPasteOrDrop( PasteOrDropInfos* pInfos ) { SdPage* pPage = static_cast< SdPage* >( pTextObj->GetPage() ); - SfxStyleSheet* pStyleSheet = 0; + SfxStyleSheet* pStyleSheet = nullptr; const PresObjKind eKind = pPage->GetPresObjKind(pTextObj); if( eKind != PRESOBJ_NONE ) @@ -1229,7 +1229,7 @@ void View::OnEndPasteOrDrop( PasteOrDropInfos* pInfos ) { sal_Int16 nDepth = pOutliner->GetDepth( nPara ); - SfxStyleSheet* pStyle = 0; + SfxStyleSheet* pStyle = nullptr; if( nDepth > 0 ) { OUString aStyleSheetName( pStyleSheet->GetName() ); @@ -1333,7 +1333,7 @@ void View::ChangeMarkedObjectsBulletsNumbering( return; const bool bUndoEnabled = pSdrModel->IsUndoEnabled(); - SdrUndoGroup* pUndoGroup = bUndoEnabled ? new SdrUndoGroup(*pSdrModel) : 0; + SdrUndoGroup* pUndoGroup = bUndoEnabled ? new SdrUndoGroup(*pSdrModel) : nullptr; const bool bToggleOn = ShouldToggleOn( bToggle, bHandleBullets ); diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx index 917e2ae2d336..aef02b9b7ad6 100644 --- a/sd/source/ui/view/sdview2.cxx +++ b/sd/source/ui/view/sdview2.cxx @@ -98,22 +98,22 @@ css::uno::Reference< css::datatransfer::XTransferable > View::CreateClipboardDat { // since SdTransferable::CopyToClipboard is called, this // dynamically created object ist destroyed automatically - SdTransferable* pTransferable = new SdTransferable( &mrDoc, NULL, false ); + SdTransferable* pTransferable = new SdTransferable( &mrDoc, nullptr, false ); css::uno::Reference< css::datatransfer::XTransferable > xRet( pTransferable ); SD_MOD()->pTransferClip = pTransferable; mrDoc.CreatingDataObj( pTransferable ); pTransferable->SetWorkDocument( static_cast<SdDrawDocument*>(GetMarkedObjModel()) ); - mrDoc.CreatingDataObj( NULL ); + mrDoc.CreatingDataObj( nullptr ); // #112978# need to use GetAllMarkedBoundRect instead of GetAllMarkedRect to get // fat lines correctly const Rectangle aMarkRect( GetAllMarkedBoundRect() ); TransferableObjectDescriptor aObjDesc; - SdrOle2Obj* pSdrOleObj = NULL; + SdrOle2Obj* pSdrOleObj = nullptr; SdrPageView* pPgView = GetSdrPageView(); - SdPage* pOldPage = pPgView ? static_cast<SdPage*>( pPgView->GetPage() ) : NULL; + SdPage* pOldPage = pPgView ? static_cast<SdPage*>( pPgView->GetPage() ) : nullptr; SdPage* pNewPage = const_cast<SdPage*>(static_cast<const SdPage*>( pTransferable->GetWorkDocument()->GetPage( 0 ) )); if( pOldPage ) @@ -166,7 +166,7 @@ css::uno::Reference< css::datatransfer::XTransferable > View::CreateDragDataObje TransferableObjectDescriptor aObjDesc; OUString aDisplayName; - SdrOle2Obj* pSdrOleObj = NULL; + SdrOle2Obj* pSdrOleObj = nullptr; if( GetMarkedObjectCount() == 1 ) { @@ -240,7 +240,7 @@ void View::UpdateSelectionClipboard( bool bForceDeselect ) else if( SD_MOD()->pTransferSelection && ( SD_MOD()->pTransferSelection->GetView() == this ) ) { TransferableHelper::ClearSelection( mpViewSh->GetActiveWindow() ); - SD_MOD()->pTransferSelection = NULL; + SD_MOD()->pTransferSelection = nullptr; } } } @@ -288,7 +288,7 @@ void View::DoPaste (vcl::Window* pWindow) const_cast< OutlinerView* >(pOLV)->PasteSpecial(); SdrObject* pObj = GetTextEditObject(); - SdPage* pPage = static_cast<SdPage*>( pObj ? pObj->GetPage() : NULL ); + SdPage* pPage = static_cast<SdPage*>( pObj ? pObj->GetPage() : nullptr ); ::Outliner* pOutliner = pOLV->GetOutliner(); if( pOutliner) @@ -334,7 +334,7 @@ void View::DoPaste (vcl::Window* pWindow) DrawViewShell* pDrViewSh = static_cast<DrawViewShell*>( mpDocSh->GetViewShell() ); - if (pDrViewSh != NULL) + if (pDrViewSh != nullptr) { if( !InsertData( aDataHelper, aPos, nDnDAction, false ) ) { @@ -347,7 +347,7 @@ void View::DoPaste (vcl::Window* pWindow) ( aDataHelper.HasFormat( SotClipboardFormatId::UNIFORMRESOURCELOCATOR ) && aDataHelper.GetINetBookmark( SotClipboardFormatId::UNIFORMRESOURCELOCATOR, aINetBookmark ) ) ) { - pDrViewSh->InsertURLField( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), "", NULL ); + pDrViewSh->InsertURLField( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), "", nullptr ); } } } @@ -363,13 +363,13 @@ void View::StartDrag( const Point& rStartPos, vcl::Window* pWindow ) if( IsTextEdit() ) SdrEndTextEdit(); - DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >( mpDocSh ? mpDocSh->GetViewShell() : 0 ); + DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >( mpDocSh ? mpDocSh->GetViewShell() : nullptr ); if( pDrawViewShell ) { rtl::Reference<FuPoor> xFunction( pDrawViewShell->GetCurrentFunction() ); - if( xFunction.is() && 0 != dynamic_cast< const FuDraw *>( xFunction.get() ) ) + if( xFunction.is() && nullptr != dynamic_cast< const FuDraw *>( xFunction.get() ) ) static_cast<FuDraw*>(xFunction.get())->ForcePointer(); } @@ -392,7 +392,7 @@ void View::DragFinished( sal_Int8 nDropAction ) SdTransferable* pDragTransferable = SD_MOD()->pTransferDrag; if( pDragTransferable ) - pDragTransferable->SetView( NULL ); + pDragTransferable->SetView( nullptr ); if( ( nDropAction & DND_ACTION_MOVE ) && pDragTransferable && !pDragTransferable->IsInternalMove() && @@ -441,7 +441,7 @@ void View::DragFinished( sal_Int8 nDropAction ) EndUndo(); mnDragSrcPgNum = SDRPAGE_NOTFOUND; delete mpDragSrcMarkList; - mpDragSrcMarkList = NULL; + mpDragSrcMarkList = nullptr; } sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTargetHelper, @@ -487,7 +487,7 @@ sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTarge if(pDragTransferable && (nDropAction & DND_ACTION_LINK)) { // suppress own data when it's intention is to use it as fill information - pDragTransferable = 0; + pDragTransferable = nullptr; } if( pDragTransferable ) @@ -543,8 +543,8 @@ sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTarge // check object insert if( !nRet && ( bXFillExchange || ( ( bDrawing || bGraphic || bMtf || bBitmap || bBookmark ) && ( nDropAction & DND_ACTION_LINK ) ) ) ) { - SdrObject* pPickObj = NULL; - SdrPageView* pPageView = NULL; + SdrObject* pPickObj = nullptr; + SdrPageView* pPageView = nullptr; ::sd::Window* pWindow = mpViewSh->GetActiveWindow(); Point aPos( pWindow->PixelToLogic( rEvt.maPosPixel ) ); const bool bHasPickObj = PickObj( aPos, getHitTolLog(), pPickObj, pPageView ); @@ -591,7 +591,7 @@ sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTarge if( mpDropMarker ) { ImplClearDrawDropMarker(); - mpDropMarkerObj = NULL; + mpDropMarkerObj = nullptr; } if( bBookmark && bFile && ( nDropAction & DND_ACTION_MOVE ) && mpViewSh && SlideShow::IsRunning(mpViewSh->GetViewShellBase()) ) @@ -617,7 +617,7 @@ sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTarge if( rEvt.mbLeaving && mpDropMarker ) { ImplClearDrawDropMarker(); - mpDropMarkerObj = NULL; + mpDropMarkerObj = nullptr; } return nRet; @@ -635,7 +635,7 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTar if( mpDropMarker ) { ImplClearDrawDropMarker(); - mpDropMarkerObj = NULL; + mpDropMarkerObj = nullptr; } if( !pPV->IsLayerLocked( aActiveLayer ) ) @@ -727,8 +727,8 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTar } else { - SdrObject* pPickObj = NULL; - SdrPageView* pPageView = NULL; + SdrObject* pPickObj = nullptr; + SdrPageView* pPageView = nullptr; if( PickObj( aPos, getHitTolLog(), pPickObj, pPageView ) ) { diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 4e32d934ca00..2dc792a7b644 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -110,7 +110,7 @@ SdrObject* ImpGetClone(std::vector<ImpRememberOrigAndClone*>& aConnectorContaine if(pConnObj == aConnectorContainer[a]->pOrig) return aConnectorContainer[a]->pClone; } - return 0L; + return nullptr; } // restrict movement to WorkArea @@ -251,7 +251,7 @@ bool View::InsertMetaFile( TransferableDataHelper& rDataHelper, const Point& rPo aGraphic.SetPrefMapMode( aMtf.GetPrefMapMode() ); aGraphic.SetPrefSize( aMtf.GetPrefSize() ); - InsertGraphic( aGraphic, mnAction, aInsertPos, NULL, pImageMap ); + InsertGraphic( aGraphic, mnAction, aInsertPos, nullptr, pImageMap ); return true; } @@ -265,39 +265,39 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, mbIsDropAllowed = false; TransferableDataHelper aDataHelper( rDataHelper ); - SdrObject* pPickObj = NULL; - SdPage* pPage = NULL; + SdrObject* pPickObj = nullptr; + SdPage* pPage = nullptr; std::unique_ptr<ImageMap> pImageMap; bool bReturn = false; bool bLink = ( ( mnAction & DND_ACTION_LINK ) != 0 ); bool bCopy = ( ( ( mnAction & DND_ACTION_COPY ) != 0 ) || bLink ); SdrInsertFlags nPasteOptions = SdrInsertFlags::SETDEFLAYER; - if (mpViewSh != NULL) + if (mpViewSh != nullptr) { - OSL_ASSERT (mpViewSh->GetViewShell()!=NULL); + OSL_ASSERT (mpViewSh->GetViewShell()!=nullptr); SfxInPlaceClient* pIpClient = mpViewSh->GetViewShell()->GetIPClient(); if( dynamic_cast< ::sd::slidesorter::SlideSorterViewShell *>( mpViewSh ) != nullptr - || (pIpClient!=NULL && pIpClient->IsObjectInPlaceActive())) + || (pIpClient!=nullptr && pIpClient->IsObjectInPlaceActive())) nPasteOptions |= SdrInsertFlags::DONTMARK; } if( bDrag ) { - SdrPageView* pPV = NULL; + SdrPageView* pPV = nullptr; PickObj( rPos, getHitTolLog(), pPickObj, pPV ); } if( nPage != SDRPAGE_NOTFOUND ) pPage = static_cast<SdPage*>( mrDoc.GetPage( nPage ) ); - SdTransferable* pOwnData = NULL; + SdTransferable* pOwnData = nullptr; SdTransferable* pImplementation = SdTransferable::getImplementation( aDataHelper.GetTransferable() ); if(pImplementation && (rDnDAction & DND_ACTION_LINK)) { // suppress own data when it's intention is to use it as fill information - pImplementation = 0; + pImplementation = nullptr; } // try to get own transfer data @@ -615,7 +615,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, if (nPos != -1) aLayout = aLayout.copy(0, nPos); pPage->SetPresentationLayout( aLayout, false, false ); - pSourceDoc->CreatingDataObj( NULL ); + pSourceDoc->CreatingDataObj( nullptr ); } else { @@ -691,8 +691,8 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, { // only one object SdrObject* pObj = pModel->GetSdPage( 0, PK_STANDARD )->GetObj( 0 ); - SdrObject* pPickObj2 = NULL; - SdrPageView* pPV = NULL; + SdrObject* pPickObj2 = nullptr; + SdrPageView* pPV = nullptr; PickObj( rPos, getHitTolLog(), pPickObj2, pPV ); if( ( mnAction & DND_ACTION_MOVE ) && pPickObj2 && pObj ) @@ -983,12 +983,12 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, SdrPageView* pPV = GetSdrPageView(); SdrInsertFlags nOptions = SdrInsertFlags::SETDEFLAYER; - if (mpViewSh!=NULL) + if (mpViewSh!=nullptr) { - OSL_ASSERT (mpViewSh->GetViewShell()!=NULL); + OSL_ASSERT (mpViewSh->GetViewShell()!=nullptr); SfxInPlaceClient* pIpClient = mpViewSh->GetViewShell()->GetIPClient(); - if (pIpClient!=NULL && pIpClient->IsObjectInPlaceActive()) + if (pIpClient!=nullptr && pIpClient->IsObjectInPlaceActive()) nOptions |= SdrInsertFlags::DONTMARK; } @@ -1153,12 +1153,12 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, SdrPageView* pPV = GetSdrPageView(); SdrInsertFlags nOptions = SdrInsertFlags::SETDEFLAYER; - if (mpViewSh!=NULL) + if (mpViewSh!=nullptr) { - OSL_ASSERT (mpViewSh->GetViewShell()!=NULL); + OSL_ASSERT (mpViewSh->GetViewShell()!=nullptr); SfxInPlaceClient* pIpClient = mpViewSh->GetViewShell()->GetIPClient(); - if (pIpClient!=NULL && pIpClient->IsObjectInPlaceActive()) + if (pIpClient!=nullptr && pIpClient->IsObjectInPlaceActive()) nOptions |= SdrInsertFlags::DONTMARK; } @@ -1215,7 +1215,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, ImpCheckInsertPos(aInsertPos, aImageMapSize, GetWorkArea()); - InsertGraphic( aGraphic, mnAction, aInsertPos, NULL, pImageMap.get() ); + InsertGraphic( aGraphic, mnAction, aInsertPos, nullptr, pImageMap.get() ); bReturn = true; } } @@ -1294,7 +1294,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, Size aImageMapSize(aBmpEx.GetPrefSize()); ImpCheckInsertPos(aInsertPos, aImageMapSize, GetWorkArea()); - InsertGraphic( aBmpEx, mnAction, aInsertPos, NULL, pImageMap.get() ); + InsertGraphic( aBmpEx, mnAction, aInsertPos, nullptr, pImageMap.get() ); bReturn = true; } } diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index 2e9004664458..f9e75e33b069 100644 --- a/sd/source/ui/view/sdview4.cxx +++ b/sd/source/ui/view/sdview4.cxx @@ -81,7 +81,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, mnAction = rAction; // Is there a object at the position rPos? - SdrGrafObj* pNewGrafObj = NULL; + SdrGrafObj* pNewGrafObj = nullptr; SdrPageView* pPV = GetSdrPageView(); SdrObject* pPickObj = pObj; const bool bOnMaster = pPV && pPV->GetPage() && pPV->GetPage()->IsMasterPage(); @@ -89,7 +89,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, if(pPV && dynamic_cast< const ::sd::slidesorter::view::SlideSorterView* >(this) != nullptr) { if(!pPV->GetPageRect().IsInside(rPos)) - pPV = 0L; + pPV = nullptr; } if( !pPickObj && pPV ) @@ -127,7 +127,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, { Rectangle aRect( pNewGrafObj->GetLogicRect() ); pNewGrafObj->AdjustToMaxRect( aRect ); - pNewGrafObj->SetOutlinerParaObject(NULL); + pNewGrafObj->SetOutlinerParaObject(nullptr); pNewGrafObj->SetEmptyPresObj(false); } @@ -175,7 +175,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, if ( rGraphic.GetPrefMapMode().GetMapUnit() == MAP_PIXEL ) { - ::OutputDevice* pOutDev = 0; + ::OutputDevice* pOutDev = nullptr; if( mpViewSh ) pOutDev = mpViewSh->GetActiveWindow(); @@ -203,7 +203,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, bool bIsPresTarget = false; if ((mpViewSh - && mpViewSh->GetViewShell()!=NULL + && mpViewSh->GetViewShell()!=nullptr && mpViewSh->GetViewShell()->GetIPClient() && mpViewSh->GetViewShell()->GetIPClient()->IsObjectInPlaceActive()) || dynamic_cast<const ::sd::slidesorter::view::SlideSorterView* >(this)) @@ -287,7 +287,7 @@ SdrMediaObj* View::InsertMediaURL( const OUString& rMediaURL, sal_Int8& rAction, uno::Reference<frame::XModel> const xModel( GetDoc().GetObjectShell()->GetModel()); bool const bRet = ::avmedia::EmbedMedia(xModel, rMediaURL, realURL); - if (!bRet) { return 0; } + if (!bRet) { return nullptr; } } return InsertMediaObj( realURL, "application/vnd.sun.star.media", rAction, rPos, rSize ); @@ -309,7 +309,7 @@ SdrMediaObj* View::Insert3DModelURL( uno::Reference<frame::XModel> const xModel( GetDoc().GetObjectShell()->GetModel()); bool const bRet = ::avmedia::Embed3DModel(xModel, rModelURL, sRealURL); - if (!bRet) { return 0; } + if (!bRet) { return nullptr; } } SdrMediaObj* pRetObject = InsertMediaObj( sRealURL, "model/vnd.gltf+json", rAction, rPos, rSize ); @@ -326,14 +326,14 @@ SdrMediaObj* View::InsertMediaObj( const OUString& rMediaURL, const OUString& rM SdrEndTextEdit(); mnAction = rAction; - SdrMediaObj* pNewMediaObj = NULL; + SdrMediaObj* pNewMediaObj = nullptr; SdrPageView* pPV = GetSdrPageView(); SdrObject* pPickObj = GetEmptyPresentationObject( PRESOBJ_MEDIA ); if(pPV && dynamic_cast<const ::sd::slidesorter::view::SlideSorterView* >(this) ) { if(!pPV->GetPageRect().IsInside(rPos)) - pPV = 0L; + pPV = nullptr; } if( !pPickObj && pPV ) @@ -377,7 +377,7 @@ SdrMediaObj* View::InsertMediaObj( const OUString& rMediaURL, const OUString& rM OUString referer; DrawDocShell * sh = GetDocSh(); - if (sh != 0 && sh->HasName()) { + if (sh != nullptr && sh->HasName()) { referer = sh->GetMedium()->GetName(); } pNewMediaObj->setURL( rMediaURL, referer, rMimeType ); @@ -433,7 +433,7 @@ IMPL_LINK_NOARG_TYPED(View, DropInsertFileHdl, Idle *, void) { sal_Int8 nTempAction = ( aIter == maDropFileVector.begin() ) ? mnAction : 0; const bool bLink = ( ( nTempAction & DND_ACTION_LINK ) != 0 ); - SdrGrafObj* pGrafObj = InsertGraphic( aGraphic, nTempAction, maDropPos, NULL, NULL ); + SdrGrafObj* pGrafObj = InsertGraphic( aGraphic, nTempAction, maDropPos, nullptr, nullptr ); if(pGrafObj && bLink) { pGrafObj->SetGraphicLink( aCurrentDropFile, ""/*TODO?*/, OUString() ); @@ -447,7 +447,7 @@ IMPL_LINK_NOARG_TYPED(View, DropInsertFileHdl, Idle *, void) } if( !bOK ) { - const SfxFilter* pFoundFilter = NULL; + const SfxFilter* pFoundFilter = nullptr; SfxMedium aSfxMedium( aCurrentDropFile, StreamMode::READ | StreamMode::SHARE_DENYNONE ); ErrCode nErr = SfxGetpApp()->GetFilterMatcher().GuessFilter( aSfxMedium, &pFoundFilter ); @@ -554,12 +554,12 @@ IMPL_LINK_NOARG_TYPED(View, DropInsertFileHdl, Idle *, void) SdrOle2Obj* pOleObj = new SdrOle2Obj( svt::EmbeddedObjectRef( xObj, nAspect ), aName, aRect ); SdrInsertFlags nOptions = SdrInsertFlags::SETDEFLAYER; - if (mpViewSh != NULL) + if (mpViewSh != nullptr) { - OSL_ASSERT (mpViewSh->GetViewShell()!=NULL); + OSL_ASSERT (mpViewSh->GetViewShell()!=nullptr); SfxInPlaceClient* pIpClient = mpViewSh->GetViewShell()->GetIPClient(); - if (pIpClient!=NULL && pIpClient->IsObjectInPlaceActive()) + if (pIpClient!=nullptr && pIpClient->IsObjectInPlaceActive()) nOptions |= SdrInsertFlags::DONTMARK; } @@ -591,7 +591,7 @@ IMPL_LINK_NOARG_TYPED(View, DropInsertFileHdl, Idle *, void) */ IMPL_LINK_NOARG_TYPED(View, DropErrorHdl, Idle *, void) { - ScopedVclPtr<InfoBox>::Create( mpViewSh ? mpViewSh->GetActiveWindow() : 0, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) )->Execute(); + ScopedVclPtr<InfoBox>::Create( mpViewSh ? mpViewSh->GetActiveWindow() : nullptr, SD_RESSTR(STR_ACTION_NOTPOSSIBLE) )->Execute(); } /** diff --git a/sd/source/ui/view/sdview5.cxx b/sd/source/ui/view/sdview5.cxx index 0554de617761..d05f64ccd423 100644 --- a/sd/source/ui/view/sdview5.cxx +++ b/sd/source/ui/view/sdview5.cxx @@ -43,7 +43,7 @@ static bool implIsMultiPresObj( PresObjKind eKind ) SdPage* View::GetPage() { - SdPage* pPage = NULL; + SdPage* pPage = nullptr; SdrPageView* pPV = GetSdrPageView(); if( pPV ) { @@ -56,7 +56,7 @@ SdPage* View::GetPage() // returns selected object in case there's just one object in the selection SdrObject* View::GetSelectedSingleObject(SdPage* pPage) { - SdrObject* pRet = NULL; + SdrObject* pRet = nullptr; if( pPage ) { // first try selected shape @@ -78,7 +78,7 @@ SdrObject* View::GetSelectedSingleObject(SdPage* pPage) SdrObject* View::GetEmptyPresentationObject( PresObjKind eKind ) { SdPage* pPage = GetPage(); - SdrObject* pEmptyObj = NULL; + SdrObject* pEmptyObj = nullptr; if ( pPage && !pPage->IsMasterPage() ) { SdrObject* pObj = GetSelectedSingleObject( pPage ); @@ -94,7 +94,7 @@ SdrObject* View::GetEmptyPresentationObject( PresObjKind eKind ) { pEmptyObj = pPage->GetPresObj(eKind, nIndex++ ); } - while( (pEmptyObj != 0) && (!pEmptyObj->IsEmptyPresObj()) ); + while( (pEmptyObj != nullptr) && (!pEmptyObj->IsEmptyPresObj()) ); } // last try to find empty pres obj of multiple type diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index fe98667f2d39..4d9566c3fa29 100644 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -54,7 +54,7 @@ namespace sd { Window::Window(vcl::Window* pParent) : vcl::Window(pParent, WinBits(WB_CLIPCHILDREN | WB_DIALOGCONTROL)), DropTargetHelper( this ), - mpShareWin(NULL), + mpShareWin(nullptr), maWinPos(0, 0), // precautionary; but the values should be set maViewOrigin(0, 0), // again from the owner of the window maViewSize(1000, 1000), @@ -66,7 +66,7 @@ Window::Window(vcl::Window* pParent) mbCenterAllowed(true), mnTicks (0), mbDraggedFrom(false), - mpViewShell(NULL), + mpViewShell(nullptr), mbUseDropScroll (true) { SetDialogControlFlags( DialogControlFlags::Return | DialogControlFlags::WantFocus ); @@ -99,10 +99,10 @@ Window::~Window() void Window::dispose() { - if (mpViewShell != NULL) + if (mpViewShell != nullptr) { WindowUpdater* pWindowUpdater = mpViewShell->GetWindowUpdater(); - if (pWindowUpdater != NULL) + if (pWindowUpdater != nullptr) pWindowUpdater->UnregisterWindow (this); } mpShareWin.clear(); @@ -111,22 +111,22 @@ void Window::dispose() void Window::SetViewShell (ViewShell* pViewSh) { - WindowUpdater* pWindowUpdater = NULL; + WindowUpdater* pWindowUpdater = nullptr; // Unregister at device updater of old view shell. - if (mpViewShell != NULL) + if (mpViewShell != nullptr) { pWindowUpdater = mpViewShell->GetWindowUpdater(); - if (pWindowUpdater != NULL) + if (pWindowUpdater != nullptr) pWindowUpdater->UnregisterWindow (this); } mpViewShell = pViewSh; // Register at device updater of new view shell - if (mpViewShell != NULL) + if (mpViewShell != nullptr) { pWindowUpdater = mpViewShell->GetWindowUpdater(); - if (pWindowUpdater != NULL) + if (pWindowUpdater != nullptr) pWindowUpdater->RegisterWindow (this); } } @@ -223,7 +223,7 @@ void Window::KeyInput(const KeyEvent& rKEvt) { if (getenv("SD_DEBUG") && rKEvt.GetKeyCode().GetCode() == KEY_F12 && mpViewShell) { - mpViewShell->GetDoc()->dumpAsXml(0); + mpViewShell->GetDoc()->dumpAsXml(nullptr); return; } @@ -961,7 +961,7 @@ css::uno::Reference<css::accessibility::XAccessible> { return xAcc; } - if (mpViewShell != NULL) + if (mpViewShell != nullptr) { xAcc = mpViewShell->CreateAccessibleDocumentView (this); SetAccessible(xAcc); diff --git a/sd/source/ui/view/tabcontr.cxx b/sd/source/ui/view/tabcontr.cxx index 22c5ac1db45b..b5f1e57e40a3 100644 --- a/sd/source/ui/view/tabcontr.cxx +++ b/sd/source/ui/view/tabcontr.cxx @@ -191,7 +191,7 @@ sal_Int8 TabControl::AcceptDrop( const AcceptDropEvent& rEvt ) if( ( nPageId >= 0 ) && pDoc->GetPage( (sal_uInt16)nPageId ) ) { - nRet = pDrViewSh->AcceptDrop( rEvt, *this, NULL, (sal_uInt16)nPageId, SDRLAYER_NOTFOUND ); + nRet = pDrViewSh->AcceptDrop( rEvt, *this, nullptr, (sal_uInt16)nPageId, SDRLAYER_NOTFOUND ); SwitchPage( aPos ); } } @@ -266,7 +266,7 @@ sal_Int8 TabControl::ExecuteDrop( const ExecuteDropEvent& rEvt ) if( ( nPageId >= 0 ) && pDoc->GetPage( (sal_uInt16)nPageId ) ) { - nRet = pDrViewSh->ExecuteDrop( rEvt, *this, NULL, (sal_uInt16)nPageId, SDRLAYER_NOTFOUND ); + nRet = pDrViewSh->ExecuteDrop( rEvt, *this, nullptr, (sal_uInt16)nPageId, SDRLAYER_NOTFOUND ); } } diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx index 41fb110043a6..b97a7d7f6541 100644 --- a/sd/source/ui/view/viewoverlaymanager.cxx +++ b/sd/source/ui/view/viewoverlaymanager.cxx @@ -75,8 +75,8 @@ static BitmapEx loadImageResource( sal_uInt16 nId ) static BitmapEx* getButtonImage( int index, bool large ) { - static vcl::DeleteOnDeinit< BitmapEx > gSmallButtonImages[BMP_PLACEHOLDER_SMALL_END - BMP_PLACEHOLDER_SMALL_START] = { 0, 0, 0, 0, 0, 0, 0, 0 }; - static vcl::DeleteOnDeinit< BitmapEx > gLargeButtonImages[BMP_PLACEHOLDER_LARGE_END - BMP_PLACEHOLDER_LARGE_START] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + static vcl::DeleteOnDeinit< BitmapEx > gSmallButtonImages[BMP_PLACEHOLDER_SMALL_END - BMP_PLACEHOLDER_SMALL_START] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; + static vcl::DeleteOnDeinit< BitmapEx > gLargeButtonImages[BMP_PLACEHOLDER_LARGE_END - BMP_PLACEHOLDER_LARGE_START] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; if( !gSmallButtonImages[0].get() ) { @@ -179,7 +179,7 @@ void ImageButtonHdl::onMouseEnter(const MouseEvent& rMEvt) { int nHighlightId = 0; OutputDevice* pDev = pHdlList->GetView()->GetFirstOutputDevice(); - if( pDev == 0 ) + if( pDev == nullptr ) pDev = Application::GetDefaultDevice(); Point aMDPos( rMEvt.GetPosPixel() ); @@ -246,7 +246,7 @@ void ImageButtonHdl::CreateB2dIAObject() rtl::Reference< sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager(); if(rPaintWindow.OutputToWindow() && xManager.is() ) { - sdr::overlay::OverlayObject* pOverlayObject = 0; + sdr::overlay::OverlayObject* pOverlayObject = nullptr; pOverlayObject = new sdr::overlay::OverlayBitmapEx( aPosition, aBitmapEx, 0, 0 ); xManager->add(*pOverlayObject); @@ -336,7 +336,7 @@ BitmapEx ChangePlaceholderTag::createOverlayImage( int nHighlight ) const Rectangle& rSnapRect = pPlaceholder->GetSnapRect(); OutputDevice* pDev = mrView.GetFirstOutputDevice(); - if( pDev == 0 ) + if( pDev == nullptr ) pDev = Application::GetDefaultDevice(); Size aShapeSizePix = pDev->LogicToPixel(rSnapRect.GetSize()); @@ -351,7 +351,7 @@ BitmapEx ChangePlaceholderTag::createOverlayImage( int nHighlight ) const Rectangle aRectSrc( Point( 0, 0 ), aSize ); aRet = *(getButtonImage((nHighlight == 0) ? 4 : 0, bLarge)); - aRet.Expand( aSize.Width(), aSize.Height(), NULL, true ); + aRet.Expand( aSize.Width(), aSize.Height(), nullptr, true ); aRet.CopyPixel( Rectangle( Point( aSize.Width(), 0 ), aSize ), aRectSrc, getButtonImage((nHighlight == 1) ? 5 : 1, bLarge) ); aRet.CopyPixel( Rectangle( Point( 0, aSize.Height() ), aSize ), aRectSrc, getButtonImage((nHighlight == 2) ? 6 : 2, bLarge) ); @@ -371,7 +371,7 @@ void ChangePlaceholderTag::addCustomHandles( SdrHdlList& rHandlerList ) const Point aPoint; OutputDevice* pDev = mrView.GetFirstOutputDevice(); - if( pDev == 0 ) + if( pDev == nullptr ) pDev = Application::GetDefaultDevice(); Size aShapeSizePix = pDev->LogicToPixel(rSnapRect.GetSize()); @@ -420,7 +420,7 @@ void ChangePlaceholderTag::deselect() ViewOverlayManager::ViewOverlayManager( ViewShellBase& rViewShellBase ) : mrBase( rViewShellBase ) -, mnUpdateTagsEvent( 0 ) +, mnUpdateTagsEvent( nullptr ) { Link<tools::EventMultiplexerEvent&,void> aLink( LINK(this,ViewOverlayManager,EventMultiplexerListener) ); mrBase.GetEventMultiplexer()->AddEventListener(aLink, tools::EventMultiplexerEvent::EID_CURRENT_PAGE @@ -440,7 +440,7 @@ ViewOverlayManager::~ViewOverlayManager() if( mnUpdateTagsEvent ) { Application::RemoveUserEvent( mnUpdateTagsEvent ); - mnUpdateTagsEvent = 0; + mnUpdateTagsEvent = nullptr; } DisposeTags(); @@ -449,7 +449,7 @@ ViewOverlayManager::~ViewOverlayManager() void ViewOverlayManager::Notify(SfxBroadcaster&, const SfxHint& rHint) { const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); - if (pSimpleHint != NULL) + if (pSimpleHint != nullptr) { if (pSimpleHint->GetId() == SFX_HINT_DOCCHANGED) { @@ -476,7 +476,7 @@ IMPL_LINK_NOARG_TYPED(ViewOverlayManager, UpdateTagsHdl, void*, void) { OSL_TRACE("ViewOverlayManager::UpdateTagsHdl"); - mnUpdateTagsEvent = 0; + mnUpdateTagsEvent = nullptr; bool bChanges = DisposeTags(); bChanges |= CreateTags(); @@ -490,7 +490,7 @@ bool ViewOverlayManager::CreateTags() std::shared_ptr<ViewShell> aMainShell = mrBase.GetMainViewShell(); - SdPage* pPage = aMainShell.get() ? aMainShell->getCurrentPage() : NULL; + SdPage* pPage = aMainShell.get() ? aMainShell->getCurrentPage() : nullptr; if( pPage && !pPage->IsMasterPage() && (pPage->GetPageKind() == PK_STANDARD) ) { diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx index 62f55be8f0a3..517e79fff166 100644 --- a/sd/source/ui/view/viewshe2.cxx +++ b/sd/source/ui/view/viewshe2.cxx @@ -80,7 +80,7 @@ namespace sd { */ void ViewShell::UpdateScrollBars() { - if (mpHorizontalScrollBar.get() != NULL) + if (mpHorizontalScrollBar.get() != nullptr) { long nW = (long)(mpContentWindow->GetVisibleWidth() * 32000); long nX = (long)(mpContentWindow->GetVisibleX() * 32000); @@ -93,7 +93,7 @@ void ViewShell::UpdateScrollBars() mpHorizontalScrollBar->SetPageSize(nPage); } - if (mpVerticalScrollBar.get() != NULL) + if (mpVerticalScrollBar.get() != nullptr) { long nH = (long)(mpContentWindow->GetVisibleHeight() * 32000); long nY = (long)(mpContentWindow->GetVisibleY() * 32000); @@ -150,7 +150,7 @@ long ViewShell::VirtHScrollHdl(ScrollBar* pHScroll) // scroll all windows of the column ::sd::View* pView = GetView(); - OutlinerView* pOLV = NULL; + OutlinerView* pOLV = nullptr; if (pView) pOLV = pView->GetTextEditOutlinerView(); @@ -211,7 +211,7 @@ long ViewShell::VirtVScrollHdl(ScrollBar* pVScroll) double fY = (double) pVScroll->GetThumbPos() / pVScroll->GetRange().Len(); ::sd::View* pView = GetView(); - OutlinerView* pOLV = NULL; + OutlinerView* pOLV = nullptr; if (pView) pOLV = pView->GetTextEditOutlinerView(); @@ -248,12 +248,12 @@ long ViewShell::VirtVScrollHdl(ScrollBar* pVScroll) SvxRuler* ViewShell::CreateHRuler(::sd::Window* , bool ) { - return NULL; + return nullptr; } SvxRuler* ViewShell::CreateVRuler(::sd::Window* ) { - return NULL; + return nullptr; } void ViewShell::UpdateHRuler() @@ -331,13 +331,13 @@ void ViewShell::SetZoom(long nZoom) Fraction aUIScale(nZoom, 100); aUIScale *= GetDoc()->GetUIScale(); - if (mpHorizontalRuler.get() != NULL) + if (mpHorizontalRuler.get() != nullptr) mpHorizontalRuler->SetZoom(aUIScale); - if (mpVerticalRuler.get() != NULL) + if (mpVerticalRuler.get() != nullptr) mpVerticalRuler->SetZoom(aUIScale); - if (mpContentWindow.get() != NULL) + if (mpContentWindow.get() != nullptr) { mpContentWindow->SetZoomIntegral(nZoom); @@ -373,13 +373,13 @@ void ViewShell::SetZoomRect(const Rectangle& rZoomRect) Point aPos = GetActiveWindow()->GetWinViewPos(); - if (mpHorizontalRuler.get() != NULL) + if (mpHorizontalRuler.get() != nullptr) mpHorizontalRuler->SetZoom(aUIScale); - if (mpVerticalRuler.get() != NULL) + if (mpVerticalRuler.get() != nullptr) mpVerticalRuler->SetZoom(aUIScale); - if (mpContentWindow.get() != NULL) + if (mpContentWindow.get() != nullptr) { Point aNewPos = mpContentWindow->GetWinViewPos(); aNewPos.X() = aPos.X(); @@ -413,7 +413,7 @@ void ViewShell::SetZoomRect(const Rectangle& rZoomRect) void ViewShell::InitWindows(const Point& rViewOrigin, const Size& rViewSize, const Point& rWinPos, bool bUpdate) { - if (mpContentWindow.get() != NULL) + if (mpContentWindow.get() != nullptr) { mpContentWindow->SetViewOrigin(rViewOrigin); mpContentWindow->SetViewSize(rViewSize); @@ -442,7 +442,7 @@ void ViewShell::InitWindows(const Point& rViewOrigin, const Size& rViewSize, */ void ViewShell::InvalidateWindows() { - if (mpContentWindow.get() != NULL) + if (mpContentWindow.get() != nullptr) mpContentWindow->Invalidate(); } @@ -451,7 +451,7 @@ void ViewShell::InvalidateWindows() */ void ViewShell::DrawMarkRect(const Rectangle& rRect) const { - if (mpContentWindow.get() != NULL) + if (mpContentWindow.get() != nullptr) { mpContentWindow->InvertTracking(rRect, SHOWTRACK_OBJECT | SHOWTRACK_WINDOW); } @@ -463,13 +463,13 @@ void ViewShell::SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize, Orientation eOrientation, sal_uInt16 nPaperBin, bool bBackgroundFullSize) { - SdPage* pPage = 0; - SdUndoGroup* pUndoGroup = NULL; + SdPage* pPage = nullptr; + SdUndoGroup* pUndoGroup = nullptr; pUndoGroup = new SdUndoGroup(GetDoc()); OUString aString(SdResId(STR_UNDO_CHANGE_PAGEFORMAT)); pUndoGroup->SetComment(aString); SfxViewShell* pViewShell = GetViewShell(); - OSL_ASSERT (pViewShell!=NULL); + OSL_ASSERT (pViewShell!=nullptr); sal_uInt16 i, nPageCnt = GetDoc()->GetMasterSdPageCount(ePageKind); @@ -631,7 +631,7 @@ void ViewShell::SetZoomFactor(const Fraction& rZoomX, const Fraction&) void ViewShell::SetActiveWindow (::sd::Window* pWin) { SfxViewShell* pViewShell = GetViewShell(); - OSL_ASSERT (pViewShell!=NULL); + OSL_ASSERT (pViewShell!=nullptr); if (pViewShell->GetWindow() != pWin) { @@ -714,7 +714,7 @@ bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb) bool bAbort = false; GetDocSh()->SetWaitCursor( true ); SfxViewShell* pViewShell = GetViewShell(); - OSL_ASSERT (pViewShell!=NULL); + OSL_ASSERT (pViewShell!=nullptr); bool bChangeDefaultsForChart = false; OUString aName; @@ -770,8 +770,8 @@ bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb) { // OLE object is no longer empty pObj->SetEmptyPresObj(false); - pObj->SetOutlinerParaObject(NULL); - pObj->SetGraphic(NULL); + pObj->SetOutlinerParaObject(nullptr); + pObj->SetGraphic(nullptr); // the empty OLE object gets a new IPObj if (!aName.isEmpty()) @@ -902,7 +902,7 @@ void ViewShell::SetRuler(bool bRuler) { mbHasRulers = ( bRuler && !GetDocSh()->IsPreview() ); // no rulers on preview mode - if (mpHorizontalRuler.get() != NULL) + if (mpHorizontalRuler.get() != nullptr) { if (mbHasRulers) { @@ -914,7 +914,7 @@ void ViewShell::SetRuler(bool bRuler) } } - if (mpVerticalRuler.get() != NULL) + if (mpVerticalRuler.get() != nullptr) { if (mbHasRulers) { @@ -926,7 +926,7 @@ void ViewShell::SetRuler(bool bRuler) } } - OSL_ASSERT(GetViewShell()!=NULL); + OSL_ASSERT(GetViewShell()!=nullptr); if (IsMainViewShell()) GetViewShell()->InvalidateBorder(); } @@ -958,12 +958,12 @@ void ViewShell::WriteUserDataSequence ( css::uno::Sequence < css::beans::Propert const sal_Int32 nIndex = rSequence.getLength(); rSequence.realloc( nIndex + 1 ); - OSL_ASSERT (GetViewShell()!=NULL); + OSL_ASSERT (GetViewShell()!=nullptr); // Get the view id from the view shell in the center pane. This will // usually be the called view shell, but to be on the safe side we call // the main view shell explicitly. sal_uInt16 nViewID (IMPRESS_FACTORY_ID); - if (GetViewShellBase().GetMainViewShell().get() != NULL) + if (GetViewShellBase().GetMainViewShell().get() != nullptr) nViewID = GetViewShellBase().GetMainViewShell()->mpImpl->GetViewId(); rSequence[nIndex].Name = sUNO_View_ViewId; OUStringBuffer sBuffer( "view" ); @@ -980,13 +980,13 @@ void ViewShell::ReadUserDataSequence ( const css::uno::Sequence < css::beans::Pr void ViewShell::VisAreaChanged(const Rectangle& rRect) { - OSL_ASSERT (GetViewShell()!=NULL); + OSL_ASSERT (GetViewShell()!=nullptr); GetViewShell()->VisAreaChanged(rRect); } void ViewShell::SetWinViewPos(const Point& rWinPos, bool bUpdate) { - if (mpContentWindow.get() != NULL) + if (mpContentWindow.get() != nullptr) { mpContentWindow->SetWinViewPos(rWinPos); diff --git a/sd/source/ui/view/viewshe3.cxx b/sd/source/ui/view/viewshe3.cxx index 06892405f074..a10aae8cf344 100644 --- a/sd/source/ui/view/viewshe3.cxx +++ b/sd/source/ui/view/viewshe3.cxx @@ -199,9 +199,9 @@ SdPage* ViewShell::CreateOrDuplicatePage ( // size, master page, to the new page. This is usually the given page. // When the given page is NULL then use the first page of the document. SdPage* pTemplatePage = pPage; - if (pTemplatePage == NULL) + if (pTemplatePage == nullptr) pTemplatePage = pDocument->GetSdPage(0, ePageKind); - if (pTemplatePage != NULL && pTemplatePage->TRG_HasMasterPage()) + if (pTemplatePage != nullptr && pTemplatePage->TRG_HasMasterPage()) aVisibleLayers = pTemplatePage->TRG_GetMasterPageVisibleLayers(); else aVisibleLayers.SetAll(); @@ -221,14 +221,14 @@ SdPage* ViewShell::CreateOrDuplicatePage ( pDocument->StopWorkStartupDelay(); // Use the layouts of the previous page and notes page as template. - if (pTemplatePage != NULL) + if (pTemplatePage != nullptr) { eStandardLayout = pTemplatePage->GetAutoLayout(); if( eStandardLayout == AUTOLAYOUT_TITLE ) eStandardLayout = AUTOLAYOUT_ENUM; SdPage* pNotesTemplatePage = static_cast<SdPage*>(pDocument->GetPage(pTemplatePage->GetPageNum()+1)); - if (pNotesTemplatePage != NULL) + if (pNotesTemplatePage != nullptr) eNotesLayout = pNotesTemplatePage->GetAutoLayout(); } } @@ -284,7 +284,7 @@ SdPage* ViewShell::CreateOrDuplicatePage ( StarBASIC::FatalError (ERRCODE_BASIC_BAD_PROP_VALUE); #endif rRequest.Ignore (); - return NULL; + return nullptr; } } else @@ -297,7 +297,7 @@ SdPage* ViewShell::CreateOrDuplicatePage ( StarBASIC::FatalError (ERRCODE_BASIC_WRONG_ARGS); #endif rRequest.Ignore (); - return NULL; + return nullptr; } // 2. Create a new page or duplicate an existing one. @@ -319,8 +319,8 @@ SdPage* ViewShell::CreateOrDuplicatePage ( // then to the head of the document. c) pPage is NULL and the // document is empty: We use CreateFirstPages to create the // first page of the document. - if (pPage == NULL) - if (pTemplatePage == NULL) + if (pPage == nullptr) + if (pTemplatePage == nullptr) { pDocument->CreateFirstPages(); nNewPageIndex = 0; @@ -367,7 +367,7 @@ SdPage* ViewShell::CreateOrDuplicatePage ( case SID_DUPLICATE_PAGE: // Duplication makes no sense when pPage is NULL. - if (pPage != NULL) + if (pPage != nullptr) nNewPageIndex = pDocument->DuplicatePage ( pPage, ePageKind, @@ -382,7 +382,7 @@ SdPage* ViewShell::CreateOrDuplicatePage ( SAL_INFO("sd", "wrong slot id given to CreateOrDuplicatePage"); // Try to handle another slot id gracefully. } - SdPage* pNewPage = 0; + SdPage* pNewPage = nullptr; if(nNewPageIndex != 0xffff) pNewPage = pDocument->GetSdPage(nNewPageIndex, PK_STANDARD); diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index f293c001881b..2ca39fcd8a3a 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -114,21 +114,21 @@ namespace sd { bool ViewShell::IsPageFlipMode() const { - return dynamic_cast< const DrawViewShell *>( this ) != nullptr && mpContentWindow.get() != NULL && + return dynamic_cast< const DrawViewShell *>( this ) != nullptr && mpContentWindow.get() != nullptr && mpContentWindow->GetVisibleHeight() >= 1.0; } SfxViewFrame* ViewShell::GetViewFrame() const { const SfxViewShell* pViewShell = GetViewShell(); - if (pViewShell != NULL) + if (pViewShell != nullptr) { return pViewShell->GetViewFrame(); } else { - OSL_ASSERT (GetViewShell()!=NULL); - return NULL; + OSL_ASSERT (GetViewShell()!=nullptr); + return nullptr; } } @@ -148,13 +148,13 @@ ViewShell::~ViewShell() // Keep the content window from accessing in its destructor the // WindowUpdater. if (mpContentWindow) - mpContentWindow->SetViewShell(NULL); + mpContentWindow->SetViewShell(nullptr); delete mpZoomList; mpLayerTabBar.disposeAndClear(); - if (mpImpl->mpSubShellFactory.get() != NULL) + if (mpImpl->mpSubShellFactory.get() != nullptr) GetViewShellBase().GetViewShellManager()->RemoveSubShellFactory( this,mpImpl->mpSubShellFactory); @@ -180,10 +180,10 @@ ViewShell::~ViewShell() void ViewShell::construct() { mbHasRulers = false; - mpActiveWindow = 0; - mpView = 0; - mpFrameView = 0; - mpZoomList = 0; + mpActiveWindow = nullptr; + mpView = nullptr; + mpFrameView = nullptr; + mpZoomList = nullptr; mbStartShowWithDialog = false; mnPrintedHandoutPageNum = 1; mnPrintedHandoutPageCount = 0; @@ -191,7 +191,7 @@ void ViewShell::construct() mpImpl.reset(new Implementation(*this)); meShellType = ST_NONE; - OSL_ASSERT (GetViewShell()!=NULL); + OSL_ASSERT (GetViewShell()!=nullptr); if (IsMainViewShell()) GetDocSh()->Connect (this); @@ -236,7 +236,7 @@ void ViewShell::construct() static_cast< ::sd::SpellDialogChildWindow*> ( GetViewFrame()->GetChildWindow ( ::sd::SpellDialogChildWindow::GetChildWindowId())); - if (pSpellDialog != NULL) + if (pSpellDialog != nullptr) pSpellDialog->InvalidateSpellDialog(); // Register the sub shell factory. @@ -280,7 +280,7 @@ void ViewShell::Init (bool bIsMainViewShell) void ViewShell::Exit() { sd::View* pView = GetView(); - if (pView!=NULL && pView->IsTextEdit()) + if (pView!=nullptr && pView->IsTextEdit()) { pView->SdrEndTextEdit(); pView->UnmarkAll(); @@ -306,16 +306,16 @@ void ViewShell::Activate(bool bIsMDIActivate) is sent sometimes asynchronous, it can happen, that the wrong window gets the focus. */ - if (mpHorizontalRuler.get() != NULL) + if (mpHorizontalRuler.get() != nullptr) mpHorizontalRuler->SetActive(); - if (mpVerticalRuler.get() != NULL) + if (mpVerticalRuler.get() != nullptr) mpVerticalRuler->SetActive(); if (bIsMDIActivate) { // thus, the Navigator will also get a current status SfxBoolItem aItem( SID_NAVIGATOR_INIT, true ); - if (GetDispatcher() != NULL) + if (GetDispatcher() != nullptr) GetDispatcher()->Execute( SID_NAVIGATOR_INIT, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, @@ -323,7 +323,7 @@ void ViewShell::Activate(bool bIsMDIActivate) 0L); SfxViewShell* pViewShell = GetViewShell(); - OSL_ASSERT (pViewShell!=NULL); + OSL_ASSERT (pViewShell!=nullptr); SfxBindings& rBindings = pViewShell->GetViewFrame()->GetBindings(); rBindings.Invalidate( SID_3D_STATE, true ); @@ -346,13 +346,13 @@ void ViewShell::Activate(bool bIsMDIActivate) void ViewShell::UIActivating( SfxInPlaceClient* ) { - OSL_ASSERT (GetViewShell()!=NULL); + OSL_ASSERT (GetViewShell()!=nullptr); GetViewShellBase().GetToolBarManager()->ToolBarsDestroyed(); } void ViewShell::UIDeactivated( SfxInPlaceClient* ) { - OSL_ASSERT (GetViewShell()!=NULL); + OSL_ASSERT (GetViewShell()!=nullptr); GetViewShellBase().GetToolBarManager()->ToolBarsDestroyed(); if ( GetDrawView() ) GetViewShellBase().GetToolBarManager()->SelectionHasChanged(*this, *GetDrawView()); @@ -367,9 +367,9 @@ void ViewShell::Deactivate(bool bIsMDIActivate) GetDocSh()->Disconnect(this); if( pDragTransferable ) - pDragTransferable->SetView( NULL ); + pDragTransferable->SetView( nullptr ); - OSL_ASSERT (GetViewShell()!=NULL); + OSL_ASSERT (GetViewShell()!=nullptr); // remember view attributes of FrameView WriteFrameViewData(); @@ -384,9 +384,9 @@ void ViewShell::Deactivate(bool bIsMDIActivate) GetCurrentFunction()->Deactivate(); } - if (mpHorizontalRuler.get() != NULL) + if (mpHorizontalRuler.get() != nullptr) mpHorizontalRuler->SetActive(false); - if (mpVerticalRuler.get() != NULL) + if (mpVerticalRuler.get() != nullptr) mpVerticalRuler->SetActive(false); SfxShell::Deactivate(bIsMDIActivate); @@ -408,7 +408,7 @@ bool ViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin) { // give key input first to SfxViewShell to give CTRL+Key // (e.g. CTRL+SHIFT+'+', to front) priority. - OSL_ASSERT (GetViewShell()!=NULL); + OSL_ASSERT (GetViewShell()!=nullptr); bReturn = GetViewShell()->KeyInput(rKEvt); } @@ -480,7 +480,7 @@ void ViewShell::MouseButtonDown(const MouseEvent& rMEvt, ::sd::Window* pWin) } // insert MouseEvent into E3dView - if (GetView() != NULL) + if (GetView() != nullptr) GetView()->SetMouseEvent(rMEvt); bool bConsumed = false; @@ -637,7 +637,7 @@ void ViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin) { std::shared_ptr<ViewShell::Implementation::ToolBarManagerLock> pLock( mpImpl->mpUpdateLockForMouse); - if (pLock.get() != NULL) + if (pLock.get() != nullptr) pLock->Release(); } } @@ -648,7 +648,7 @@ void ViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin) } // insert MouseEvent into E3dView - if (GetView() != NULL) + if (GetView() != nullptr) GetView()->SetMouseEvent(rMEvt); if(HasCurrentFunction()) @@ -668,7 +668,7 @@ void ViewShell::MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin) SetActiveWindow(pWin); // insert MouseEvent into E3dView - if (GetView() != NULL) + if (GetView() != nullptr) GetView()->SetMouseEvent(rMEvt); if( HasCurrentFunction()) @@ -685,7 +685,7 @@ void ViewShell::MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin) { std::shared_ptr<ViewShell::Implementation::ToolBarManagerLock> pLock( mpImpl->mpUpdateLockForMouse); - if (pLock.get() != NULL) + if (pLock.get() != nullptr) pLock->Release(); } } @@ -778,7 +778,7 @@ bool ViewShell::HandleScrollCommand(const CommandEvent& rCEvt, ::sd::Window* pWi { const CommandWheelData* pData = rCEvt.GetWheelData(); - if (pData != NULL) + if (pData != nullptr) { if (pData->IsMod1()) { @@ -833,24 +833,24 @@ bool ViewShell::HandleScrollCommand(const CommandEvent& rCEvt, ::sd::Window* pWi void ViewShell::SetupRulers() { - if(mbHasRulers && (mpContentWindow.get() != NULL) && !SlideShow::IsRunning(GetViewShellBase())) + if(mbHasRulers && (mpContentWindow.get() != nullptr) && !SlideShow::IsRunning(GetViewShellBase())) { long nHRulerOfs = 0; - if ( mpVerticalRuler.get() == NULL ) + if ( mpVerticalRuler.get() == nullptr ) { mpVerticalRuler.reset(CreateVRuler(GetActiveWindow())); - if ( mpVerticalRuler.get() != NULL ) + if ( mpVerticalRuler.get() != nullptr ) { nHRulerOfs = mpVerticalRuler->GetSizePixel().Width(); mpVerticalRuler->SetActive(); mpVerticalRuler->Show(); } } - if ( mpHorizontalRuler.get() == NULL ) + if ( mpHorizontalRuler.get() == nullptr ) { mpHorizontalRuler.reset(CreateHRuler(GetActiveWindow(), true)); - if ( mpHorizontalRuler.get() != NULL ) + if ( mpHorizontalRuler.get() != nullptr ) { mpHorizontalRuler->SetWinPos(nHRulerOfs); mpHorizontalRuler->SetActive(); @@ -862,7 +862,7 @@ void ViewShell::SetupRulers() const SfxPoolItem* ViewShell::GetNumBulletItem(SfxItemSet& aNewAttr, sal_uInt16& nNumItemId) { - const SfxPoolItem* pTmpItem = NULL; + const SfxPoolItem* pTmpItem = nullptr; if(aNewAttr.GetItemState(nNumItemId, false, &pTmpItem) == SfxItemState::SET) { @@ -902,7 +902,7 @@ const SfxPoolItem* ViewShell::GetNumBulletItem(SfxItemSet& aNewAttr, sal_uInt16& } } - const SvxNumBulletItem *pItem = NULL; + const SvxNumBulletItem *pItem = nullptr; if(bOutliner) { SfxStyleSheetBasePool* pSSPool = mpView->GetDocSh()->GetStyleSheetPool(); @@ -912,7 +912,7 @@ const SfxPoolItem* ViewShell::GetNumBulletItem(SfxItemSet& aNewAttr, sal_uInt16& pFirstStyleSheet->GetItemSet().GetItemState(EE_PARA_NUMBULLET, false, reinterpret_cast<const SfxPoolItem**>(&pItem)); } - if( pItem == NULL ) + if( pItem == nullptr ) pItem = static_cast<const SvxNumBulletItem*>( aNewAttr.GetPool()->GetSecondaryPool()->GetPoolDefaultItem(EE_PARA_NUMBULLET) ); aNewAttr.Put(*pItem, EE_PARA_NUMBULLET); @@ -971,26 +971,26 @@ SvBorder ViewShell::GetBorder (bool ) SvBorder aBorder; // Horizontal scrollbar. - if (mpHorizontalScrollBar.get()!=NULL + if (mpHorizontalScrollBar.get()!=nullptr && mpHorizontalScrollBar->IsVisible()) { aBorder.Bottom() = maScrBarWH.Height(); } // Vertical scrollbar. - if (mpVerticalScrollBar.get()!=NULL + if (mpVerticalScrollBar.get()!=nullptr && mpVerticalScrollBar->IsVisible()) { aBorder.Right() = maScrBarWH.Width(); } // Place horizontal ruler below tab bar. - if (mbHasRulers && mpContentWindow.get() != NULL) + if (mbHasRulers && mpContentWindow.get() != nullptr) { SetupRulers(); - if (mpHorizontalRuler.get() != NULL) + if (mpHorizontalRuler.get() != nullptr) aBorder.Top() = mpHorizontalRuler->GetSizePixel().Height(); - if (mpVerticalRuler.get() != NULL) + if (mpVerticalRuler.get() != nullptr) aBorder.Left() = mpVerticalRuler->GetSizePixel().Width(); } @@ -1010,11 +1010,11 @@ void ViewShell::ArrangeGUIElements() long nBottom = maViewPos.Y() + maViewSize.Height(); // Horizontal scrollbar. - if (mpHorizontalScrollBar.get()!=NULL + if (mpHorizontalScrollBar.get()!=nullptr && mpHorizontalScrollBar->IsVisible()) { nBottom -= maScrBarWH.Height(); - if (mpLayerTabBar.get()!=NULL && mpLayerTabBar->IsVisible()) + if (mpLayerTabBar.get()!=nullptr && mpLayerTabBar->IsVisible()) nBottom -= mpLayerTabBar->GetSizePixel().Height(); mpHorizontalScrollBar->SetPosSizePixel ( Point(nLeft, nBottom), @@ -1022,7 +1022,7 @@ void ViewShell::ArrangeGUIElements() } // Vertical scrollbar. - if (mpVerticalScrollBar.get()!=NULL + if (mpVerticalScrollBar.get()!=nullptr && mpVerticalScrollBar->IsVisible()) { nRight -= maScrBarWH.Width(); @@ -1032,11 +1032,11 @@ void ViewShell::ArrangeGUIElements() } // Filler in the lower right corner. - if (mpScrollBarBox.get() != NULL) + if (mpScrollBarBox.get() != nullptr) { - if (mpHorizontalScrollBar.get()!=NULL + if (mpHorizontalScrollBar.get()!=nullptr && mpHorizontalScrollBar->IsVisible() - && mpVerticalScrollBar.get()!=NULL + && mpVerticalScrollBar.get()!=nullptr && mpVerticalScrollBar->IsVisible()) { mpScrollBarBox->Show(); @@ -1047,20 +1047,20 @@ void ViewShell::ArrangeGUIElements() } // Place horizontal ruler below tab bar. - if (mbHasRulers && mpContentWindow.get() != NULL) + if (mbHasRulers && mpContentWindow.get() != nullptr) { - if (mpHorizontalRuler.get() != NULL) + if (mpHorizontalRuler.get() != nullptr) { Size aRulerSize = mpHorizontalRuler->GetSizePixel(); aRulerSize.Width() = nRight - nLeft; mpHorizontalRuler->SetPosSizePixel ( Point(nLeft,nTop), aRulerSize); - if (mpVerticalRuler.get() != NULL) + if (mpVerticalRuler.get() != nullptr) mpHorizontalRuler->SetBorderPos( mpVerticalRuler->GetSizePixel().Width()-1); nTop += aRulerSize.Height(); } - if (mpVerticalRuler.get() != NULL) + if (mpVerticalRuler.get() != nullptr) { Size aRulerSize = mpVerticalRuler->GetSizePixel(); aRulerSize.Height() = nBottom - nTop; @@ -1077,7 +1077,7 @@ void ViewShell::ArrangeGUIElements() bool bSlideShowActive = (xSlideShow.is() && xSlideShow->isRunning()) && !xSlideShow->isFullScreen() && xSlideShow->getAnimationMode() == ANIMATIONMODE_SHOW; if ( !bSlideShowActive) { - OSL_ASSERT (GetViewShell()!=NULL); + OSL_ASSERT (GetViewShell()!=nullptr); if (mpContentWindow) mpContentWindow->SetPosSizePixel( @@ -1091,7 +1091,7 @@ void ViewShell::ArrangeGUIElements() Size(maViewSize.Width()-maScrBarWH.Width(), maViewSize.Height()-maScrBarWH.Height())); - if (mpContentWindow.get() != NULL) + if (mpContentWindow.get() != nullptr) mpContentWindow->UpdateMapOrigin(); UpdateScrollBars(); @@ -1102,10 +1102,10 @@ void ViewShell::ArrangeGUIElements() void ViewShell::SetUIUnit(FieldUnit eUnit) { // Set unit at horizontal and vertical rulers. - if (mpHorizontalRuler.get() != NULL) + if (mpHorizontalRuler.get() != nullptr) mpHorizontalRuler->SetUnit(eUnit); - if (mpVerticalRuler.get() != NULL) + if (mpVerticalRuler.get() != nullptr) mpVerticalRuler->SetUnit(eUnit); } @@ -1114,7 +1114,7 @@ void ViewShell::SetUIUnit(FieldUnit eUnit) */ void ViewShell::SetDefTabHRuler( sal_uInt16 nDefTab ) { - if (mpHorizontalRuler.get() != NULL) + if (mpHorizontalRuler.get() != nullptr) mpHorizontalRuler->SetDefTabDist( nDefTab ); } @@ -1126,7 +1126,7 @@ bool ViewShell::PrepareClose (bool bUI) bool bResult = true; FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager()->GetFormShell(); - if (pFormShell != NULL) + if (pFormShell != nullptr) bResult = pFormShell->PrepareClose (bUI); return bResult; @@ -1143,7 +1143,7 @@ void ViewShell::UpdatePreview (SdPage*, bool ) { const ViewShell* pMainViewShell = GetViewShellBase().GetMainViewShell().get(); - if( pMainViewShell == 0 ) + if( pMainViewShell == nullptr ) pMainViewShell = this; ::sd::View* pView = pMainViewShell->GetView(); @@ -1171,7 +1171,7 @@ void ViewShell::UpdatePreview (SdPage*, bool ) if( GetDocSh() ) return GetDocSh()->GetUndoManager(); - return NULL; + return nullptr; } void ViewShell::ImpGetUndoStrings(SfxItemSet &rSet) const @@ -1500,23 +1500,23 @@ void ViewShell::ShowUIControls (bool bVisible) if (mbHasRulers) { - if (mpHorizontalRuler.get() != NULL) + if (mpHorizontalRuler.get() != nullptr) mpHorizontalRuler->Show( bVisible ); - if (mpVerticalRuler.get() != NULL) + if (mpVerticalRuler.get() != nullptr) mpVerticalRuler->Show( bVisible ); } - if (mpVerticalScrollBar.get() != NULL) + if (mpVerticalScrollBar.get() != nullptr) mpVerticalScrollBar->Show( bVisible ); - if (mpHorizontalScrollBar.get() != NULL) + if (mpHorizontalScrollBar.get() != nullptr) mpHorizontalScrollBar->Show( bVisible ); - if (mpScrollBarBox.get() != NULL) + if (mpScrollBarBox.get() != nullptr) mpScrollBarBox->Show(bVisible); - if (mpContentWindow.get() != NULL) + if (mpContentWindow.get() != nullptr) mpContentWindow->Show( bVisible ); } @@ -1527,14 +1527,14 @@ bool ViewShell::RelocateToParentWindow (vcl::Window* pParentWindow) if (mpParentWindow) mpParentWindow->SetBackground (Wallpaper()); - if (mpContentWindow.get() != NULL) + if (mpContentWindow.get() != nullptr) mpContentWindow->SetParent(pParentWindow); - if (mpHorizontalScrollBar.get() != NULL) + if (mpHorizontalScrollBar.get() != nullptr) mpHorizontalScrollBar->SetParent(mpParentWindow); - if (mpVerticalScrollBar.get() != NULL) + if (mpVerticalScrollBar.get() != nullptr) mpVerticalScrollBar->SetParent(mpParentWindow); - if (mpScrollBarBox.get() != NULL) + if (mpScrollBarBox.get() != nullptr) mpScrollBarBox->SetParent(mpParentWindow); return true; @@ -1593,10 +1593,10 @@ SfxShell* ViewShellObjectBarFactory::CreateShell ( vcl::Window*, ::sd::FrameView* ) { - SfxShell* pShell = NULL; + SfxShell* pShell = nullptr; ShellCache::iterator aI (maShellCache.find(nId)); - if (aI == maShellCache.end() || aI->second==NULL) + if (aI == maShellCache.end() || aI->second==nullptr) { ::sd::View* pView = mrViewShell.GetView(); switch (nId) @@ -1633,7 +1633,7 @@ SfxShell* ViewShellObjectBarFactory::CreateShell ( break; default: - pShell = NULL; + pShell = nullptr; break; } } @@ -1645,7 +1645,7 @@ SfxShell* ViewShellObjectBarFactory::CreateShell ( void ViewShellObjectBarFactory::ReleaseShell (SfxShell* pShell) { - if (pShell != NULL) + if (pShell != nullptr) delete pShell; } |