diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:25:48 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:31:53 +0100 |
commit | 01b49802c7cda7fd4d5ba71263cef7bc95234b89 (patch) | |
tree | b8d92f1c6abf5ac548d0bcb0c581ebfcffd8bfac /sw/source/uibase/shells | |
parent | 6cd7bf2043146a630925a2e49336f02c802f707a (diff) |
loplugin:nullptr (automatic rewrite)
Change-Id: I01e11fa956a249974e77dce9deebe79311f098d0
Diffstat (limited to 'sw/source/uibase/shells')
22 files changed, 211 insertions, 211 deletions
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index 5f68f0c57b73..e0239fd1bb48 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -170,7 +170,7 @@ SwAnnotationShell::~SwAnnotationShell() !pPostItMgr->HasActiveSidebarWin() ) { OSL_ENSURE(pPostItMgr,"PostItMgr::Layout(): We are looping forever"); - return 0; + return nullptr; } return &pPostItMgr->GetActiveSidebarWin()->GetOutlinerView()->GetOutliner()->GetUndoManager(); } @@ -384,7 +384,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) break; case SID_HYPERLINK_SETLINK: { - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if(pNewAttrs) pNewAttrs->GetItemState(nSlot, false, &pItem); @@ -439,7 +439,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) } case FN_INSERT_STRING: { - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if (pNewAttrs) pNewAttrs->GetItemState(nSlot, false, &pItem ); if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()!=SwPostItHelper::DELETED) @@ -544,7 +544,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwParaDlg( rView.GetWindow(), rView, aDlgAttr,DLG_STD, 0, true )); + std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwParaDlg( rView.GetWindow(), rView, aDlgAttr,DLG_STD, nullptr, true )); OSL_ENSURE(pDlg, "Dialog creation failed!"); sal_uInt16 nRet = pDlg->Execute(); if(RET_OK == nRet) @@ -721,7 +721,7 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet) case FN_SET_SUB_SCRIPT: { sal_uInt16 nEsc = 0; - const SfxPoolItem *pEscItem = 0; + const SfxPoolItem *pEscItem = nullptr; if (nWhich==FN_SET_SUPER_SCRIPT) nEsc = SVX_ESCAPEMENT_SUPERSCRIPT; else @@ -741,7 +741,7 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet) case SID_ATTR_PARA_ADJUST_CENTER: case SID_ATTR_PARA_ADJUST_BLOCK: { - const SfxPoolItem *pAdjust = 0; + const SfxPoolItem *pAdjust = nullptr; int eAdjust = 0; if (nWhich==SID_ATTR_PARA_ADJUST_LEFT) @@ -771,7 +771,7 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet) case SID_ATTR_PARA_LINESPACE_15: case SID_ATTR_PARA_LINESPACE_20: { - const SfxPoolItem *pLSpace = 0; + const SfxPoolItem *pLSpace = nullptr; int nLSpace = 0; if (nWhich==SID_ATTR_PARA_LINESPACE_10) @@ -1237,7 +1237,7 @@ void SwAnnotationShell::ExecLingu(SfxRequest &rReq) break; } case SID_HANGUL_HANJA_CONVERSION: - pOLV->StartTextConversion( LANGUAGE_KOREAN, LANGUAGE_KOREAN, NULL, + pOLV->StartTextConversion( LANGUAGE_KOREAN, LANGUAGE_KOREAN, nullptr, i18n::TextConversionOption::CHARACTER_BY_CHARACTER, true, false ); break; @@ -1259,7 +1259,7 @@ void SwAnnotationShell::ExecLingu(SfxRequest &rReq) if( xInit.is() ) { // initialize dialog - Reference< awt::XWindow > xDialogParentWindow(0); + Reference< awt::XWindow > xDialogParentWindow(nullptr); Sequence<Any> aSeq(1); Any* pArray = aSeq.getArray(); PropertyValue aParam; @@ -1472,7 +1472,7 @@ void SwAnnotationShell::ExecUndo(SfxRequest &rReq) sal_uInt16 nId = rReq.GetSlot(); sal_uInt16 nCnt = 1; - const SfxPoolItem* pItem=0; + const SfxPoolItem* pItem=nullptr; if( pArgs && SfxItemState::SET == pArgs->GetItemState( nId, false, &pItem ) ) nCnt = static_cast<const SfxUInt16Item*>(pItem)->GetValue(); switch( nId ) @@ -1553,7 +1553,7 @@ void SwAnnotationShell::StateUndo(SfxItemSet &rSet) sal_uInt16 nCount = pUndoManager ? pUndoManager->GetUndoActionCount() : 0; if ( nCount ) pSfxViewFrame->GetSlotState( nWhich, pSfxViewFrame->GetInterface(), &rSet ); - else if (rSh.GetLastUndoInfo(0, 0)) + else if (rSh.GetLastUndoInfo(nullptr, nullptr)) { rSet.Put( SfxStringItem( nWhich, rSh.GetDoString(SwWrtShell::UNDO)) ); } @@ -1566,7 +1566,7 @@ void SwAnnotationShell::StateUndo(SfxItemSet &rSet) sal_uInt16 nCount = pUndoManager ? pUndoManager->GetRedoActionCount() : 0; if ( nCount ) pSfxViewFrame->GetSlotState( nWhich, pSfxViewFrame->GetInterface(), &rSet ); - else if (rSh.GetFirstRedoInfo(0)) + else if (rSh.GetFirstRedoInfo(nullptr)) { rSet.Put(SfxStringItem( nWhich, rSh.GetDoString(SwWrtShell::REDO)) ); } @@ -1602,12 +1602,12 @@ void SwAnnotationShell::StateUndo(SfxItemSet &rSet) SfxStringListItem aItem( nWhich ); if ((nWhich == SID_GETUNDOSTRINGS) && - rSh.GetLastUndoInfo(0, 0)) + rSh.GetLastUndoInfo(nullptr, nullptr)) { rSh.GetDoStrings( SwWrtShell::UNDO, aItem ); } else if ((nWhich == SID_GETREDOSTRINGS) && - (rSh.GetFirstRedoInfo(0))) + (rSh.GetFirstRedoInfo(nullptr))) { rSh.GetDoStrings( SwWrtShell::UNDO, aItem ); } @@ -1656,7 +1656,7 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq) OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView(); const SfxItemSet *pArgs = rReq.GetArgs(); - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if( pArgs ) pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), false, &pItem); @@ -1665,7 +1665,7 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq) if ( pItem ) { sSym = static_cast<const SfxStringItem*>(pItem)->GetValue(); - const SfxPoolItem* pFtItem = NULL; + const SfxPoolItem* pFtItem = nullptr; pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem); const SfxStringItem* pFontItem = dynamic_cast<const SfxStringItem*>( pFtItem ); if ( pFontItem ) diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index f6fe41d6b321..8949cea9121b 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -138,13 +138,13 @@ namespace SfxChildWindow *pChildWindow = rView.GetViewFrame()->GetChildWindow( SvxContourDlgChildWindow::GetChildWindowId()); - return pChildWindow ? static_cast<SvxContourDlg*>(pChildWindow->GetWindow()) : NULL; + return pChildWindow ? static_cast<SvxContourDlg*>(pChildWindow->GetWindow()) : nullptr; } SvxIMapDlg* GetIMapDlg(SwView &rView) { SfxChildWindow* pWnd = rView.GetViewFrame()->GetChildWindow(SvxIMapDlgChildWindow::GetChildWindowId()); - return pWnd ? static_cast<SvxIMapDlg*>(pWnd->GetWindow()) : NULL; + return pWnd ? static_cast<SvxIMapDlg*>(pWnd->GetWindow()) : nullptr; } } @@ -168,7 +168,7 @@ static void lcl_UpdateIMapDlg( SwWrtShell& rSh ) Graphic aGrf( rSh.GetIMapGraphic() ); GraphicType nGrfType = aGrf.GetType(); void* pEditObj = GRAPHIC_NONE != nGrfType && GRAPHIC_DEFAULT != nGrfType - ? rSh.GetIMapInventor() : 0; + ? rSh.GetIMapInventor() : nullptr; std::unique_ptr<TargetList> pList(new TargetList); rSh.GetView().GetViewFrame()->GetTopFrame().GetTargetList(*pList); @@ -188,7 +188,7 @@ static bool lcl_UpdateContourDlg( SwWrtShell &rSh, int nSel ) { OUString aGrfName; if ( nSel & nsSelectionType::SEL_GRF ) - rSh.GetGrfNms( &aGrfName, 0 ); + rSh.GetGrfNms( &aGrfName, nullptr ); SvxContourDlg *pDlg = GetContourDlg(rSh.GetView()); if (pDlg) @@ -517,7 +517,7 @@ void SwBaseShell::StateUndo(SfxItemSet &rSet) { case SID_UNDO: { - if (rSh.GetLastUndoInfo(0, 0)) + if (rSh.GetLastUndoInfo(nullptr, nullptr)) { rSet.Put( SfxStringItem(nWhich, rSh.GetDoString(SwWrtShell::UNDO))); @@ -528,7 +528,7 @@ void SwBaseShell::StateUndo(SfxItemSet &rSet) } case SID_REDO: { - if (rSh.GetFirstRedoInfo(0)) + if (rSh.GetFirstRedoInfo(nullptr)) { rSet.Put(SfxStringItem(nWhich, rSh.GetDoString(SwWrtShell::REDO))); @@ -539,9 +539,9 @@ void SwBaseShell::StateUndo(SfxItemSet &rSet) } case SID_REPEAT: { // Repeat is only possible if no REDO is possible - UI-Restriction - if ((!rSh.GetFirstRedoInfo(0)) && + if ((!rSh.GetFirstRedoInfo(nullptr)) && !rSh.IsSelFrmMode() && - (UNDO_EMPTY != rSh.GetRepeatInfo(0))) + (UNDO_EMPTY != rSh.GetRepeatInfo(nullptr))) { rSet.Put(SfxStringItem(nWhich, rSh.GetRepeatString())); } @@ -551,7 +551,7 @@ void SwBaseShell::StateUndo(SfxItemSet &rSet) } case SID_GETUNDOSTRINGS: - if (rSh.GetLastUndoInfo(0, 0)) + if (rSh.GetLastUndoInfo(nullptr, nullptr)) { SfxStringListItem aStrLst( nWhich ); rSh.GetDoStrings( SwWrtShell::UNDO, aStrLst ); @@ -562,7 +562,7 @@ void SwBaseShell::StateUndo(SfxItemSet &rSet) break; case SID_GETREDOSTRINGS: - if (rSh.GetFirstRedoInfo(0)) + if (rSh.GetFirstRedoInfo(nullptr)) { SfxStringListItem aStrLst( nWhich ); rSh.GetDoStrings( SwWrtShell::REDO, aStrLst ); @@ -671,7 +671,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) rSh.EndSelect(); } bool bRet = rSh.MoveFieldType( pFieldType, nSlot == FN_GOTO_NEXT_MARK ); - SwField* pCurField = bRet ? rSh.GetCurField() : 0; + SwField* pCurField = bRet ? rSh.GetCurField() : nullptr; if (pCurField) rSh.ClickToField(*pCurField); rReq.SetReturnValue(SfxBoolItem( nSlot, bRet)); @@ -776,10 +776,10 @@ void SwBaseShell::Execute(SfxRequest &rReq) sal_Unicode cDelim = 0; bool bToTable = false; if( nSlot == FN_CONVERT_TEXT_TO_TABLE || - ( nSlot == FN_CONVERT_TEXT_TABLE && 0 == rSh.GetTableFormat() )) + ( nSlot == FN_CONVERT_TEXT_TABLE && nullptr == rSh.GetTableFormat() )) bToTable = true; SwInsertTableOptions aInsTableOpts( tabopts::ALL_TBL_INS_ATTR, 1 ); - SwTableAutoFormat const* pTAFormat = 0; + SwTableAutoFormat const* pTAFormat = nullptr; std::unique_ptr<SwTableAutoFormatTable> pAutoFormatTable; bool bDeleteFormat = true; if(pArgs && SfxItemState::SET == pArgs->GetItemState( FN_PARAM_1, true, &pItem)) @@ -1114,16 +1114,16 @@ void SwBaseShell::Execute(SfxRequest &rReq) break; case FN_XFORMS_DESIGN_MODE: - if( pArgs != NULL + if( pArgs != nullptr && pArgs->GetItemState( nSlot, true, &pItem ) == SfxItemState::SET - && pItem != NULL + && pItem != nullptr && dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr ) { bool bDesignMode = static_cast<const SfxBoolItem*>( pItem )->GetValue(); // set form design mode - OSL_ENSURE( GetView().GetFormShell() != NULL, "form shell?" ); + OSL_ENSURE( GetView().GetFormShell() != nullptr, "form shell?" ); SfxRequest aReq( GetView().GetViewFrame(), SID_FM_DESIGN_MODE ); aReq.AppendItem( SfxBoolItem( SID_FM_DESIGN_MODE, bDesignMode ) ); GetView().GetFormShell()->Execute( aReq ); @@ -1141,7 +1141,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) } if(bMore && pArgs) { - pItem = 0; + pItem = nullptr; pArgs->GetItemState(GetPool().GetWhich(nSlot), false, &pItem); if(pItem) switch(nSlot) @@ -1241,9 +1241,9 @@ IMPL_LINK_NOARG_TYPED(SwBaseShell, GraphicArrivedHdl, SwCrsrShell&, void) { sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId(); SfxChildWindow *pChildWindow = pVFrame->HasChildWindow(nId) ? - pVFrame->GetChildWindow(nId) : 0; + pVFrame->GetChildWindow(nId) : nullptr; SvxIMapDlg *pDlg = pChildWindow ? - static_cast<SvxIMapDlg*>(pChildWindow->GetWindow()) : 0; + static_cast<SvxIMapDlg*>(pChildWindow->GetWindow()) : nullptr; if( pDlg && ( SID_IMAP_EXEC == nSlot || ( SID_IMAP == nSlot && !bProtect)) && @@ -1251,7 +1251,7 @@ IMPL_LINK_NOARG_TYPED(SwBaseShell, GraphicArrivedHdl, SwCrsrShell&, void) lcl_UpdateIMapDlg( rSh ); if( !bProtect && SID_IMAP == nSlot ) - bSetState = true, bState = 0 != pDlg; + bSetState = true, bState = nullptr != pDlg; } break; @@ -1260,15 +1260,15 @@ IMPL_LINK_NOARG_TYPED(SwBaseShell, GraphicArrivedHdl, SwCrsrShell&, void) { sal_uInt16 nId = SvxContourDlgChildWindow::GetChildWindowId(); SfxChildWindow *pChildWindow = pVFrame->HasChildWindow(nId) ? - pVFrame->GetChildWindow(nId) : 0; + pVFrame->GetChildWindow(nId) : nullptr; SvxIMapDlg *pDlg = pChildWindow ? - static_cast<SvxIMapDlg*>(pChildWindow->GetWindow()) : 0; + static_cast<SvxIMapDlg*>(pChildWindow->GetWindow()) : nullptr; if( pDlg && pDlg->GetEditingObject() != rSh.GetIMapInventor() ) lcl_UpdateContourDlg( rSh, nsSelectionType::SEL_GRF ); bSetState = true; - bState = 0 != pDlg; + bState = nullptr != pDlg; } break; @@ -1349,7 +1349,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) case FN_CONVERT_TABLE_TO_TEXT: { - FrmTypeFlags eFrmType = rSh.GetFrmType(0,true); + FrmTypeFlags eFrmType = rSh.GetFrmType(nullptr,true); if( (eFrmType & FrmTypeFlags::FOOTNOTE) || !rSh.GetTableFormat() ) rSet.DisableItem( nWhich ); @@ -1357,7 +1357,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) break; case FN_CONVERT_TEXT_TO_TABLE: { - FrmTypeFlags eFrmType = rSh.GetFrmType(0,true); + FrmTypeFlags eFrmType = rSh.GetFrmType(nullptr,true); if( (eFrmType & FrmTypeFlags::FOOTNOTE) || !rSh.IsTextToTableAvailable() ) rSet.DisableItem( nWhich ); @@ -1365,7 +1365,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) break; case FN_CONVERT_TEXT_TABLE: { - FrmTypeFlags eFrmType = rSh.GetFrmType(0,true); + FrmTypeFlags eFrmType = rSh.GetFrmType(nullptr,true); if( (eFrmType & FrmTypeFlags::FOOTNOTE) || (!rSh.GetTableFormat() && !rSh.IsTextToTableAvailable() ) ) rSet.DisableItem( nWhich ); @@ -1753,7 +1753,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) } nWhich = aIter.NextWhich(); } - pGetStateSet = 0; + pGetStateSet = nullptr; } // Disable the slots with this status methode @@ -1908,7 +1908,7 @@ void SwBaseShell::SetFrmMode(FlyMode eMode, SwWrtShell *pSh ) SwBaseShell::SwBaseShell(SwView& rVw) : SfxShell( &rVw ), rView(rVw), - pGetStateSet(0) + pGetStateSet(nullptr) { SwWrtShell& rWrtSh = rView.GetWrtShell(); @@ -2345,11 +2345,11 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) vcl::Window *pMDI = &GetView().GetViewFrame()->GetWindow(); // So that from the basic no dialogues for the background views are called: bool bBackground = (&GetView() != GetActiveView()); - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; const SfxItemSet* pArgs = rReq.GetArgs(); sal_uInt16 nSlot = rReq.GetSlot(); - const SfxItemSet* pOutSet = 0; + const SfxItemSet* pOutSet = nullptr; bool bDone = false; if(pArgs) pArgs->GetItemState( GetPool().GetWhich(nSlot), false, &pItem ); @@ -2544,7 +2544,7 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest ) const SfxItemSet* pArgs = _rRequest.GetArgs(); SwWrtShell& rSh = GetShell(); - if ( !( rSh.GetFrmType( 0, true ) & FrmTypeFlags::FOOTNOTE ) ) + if ( !( rSh.GetFrmType( nullptr, true ) & FrmTypeFlags::FOOTNOTE ) ) { SwView &rTempView = GetView(); // Because GetView() does not work after the shell exchange bool bHTMLMode = 0 != (::GetHtmlMode(rTempView.GetDocShell())&HTMLMODE_ON); @@ -2572,7 +2572,7 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest ) SwInsertTableOptions aInsTableOpts( tabopts::ALL_TBL_INS_ATTR, 1 ); OUString aTableName; OUString aAutoName; - SwTableAutoFormat* pTAFormat = 0; + SwTableAutoFormat* pTAFormat = nullptr; if( pArgs && pArgs->Count() >= 2 ) { @@ -2734,7 +2734,7 @@ void SwBaseShell::GetGalleryState( SfxItemSet &rSet ) rLst.push_back( SW_RESSTR( STR_SWBG_OLE ) ); nOlePos = nPos++; } - const FrmTypeFlags nType = rSh.GetFrmType(0,true); + const FrmTypeFlags nType = rSh.GetFrmType(nullptr,true); if ( nType & FrmTypeFlags::HEADER ) { rLst.push_back( SW_RESSTR( STR_SWBG_HEADER ) ); diff --git a/sw/source/uibase/shells/drawdlg.cxx b/sw/source/uibase/shells/drawdlg.cxx index 36148b40ebb4..de5e992ad4e9 100644 --- a/sw/source/uibase/shells/drawdlg.cxx +++ b/sw/source/uibase/shells/drawdlg.cxx @@ -55,7 +55,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if ( pFact ) { - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( NULL, &aNewAttr, pView )); + std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( nullptr, &aNewAttr, pView )); sal_uInt16 nResult = pDlg->Execute(); if (nResult == RET_OK) @@ -77,7 +77,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) bool bHasMarked = pView->AreObjectsMarked(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog( NULL, + std::unique_ptr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog( nullptr, &aNewAttr, pDoc, true)); @@ -112,14 +112,14 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) { bool bHasMarked = pView->AreObjectsMarked(); - const SdrObject* pObj = NULL; + const SdrObject* pObj = nullptr; const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); if( rMarkList.GetMarkCount() == 1 ) pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxLineTabDialog( NULL, + std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxLineTabDialog( nullptr, &aNewAttr, pDoc, pObj, diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx index 86df26664185..3f1e09814594 100644 --- a/sw/source/uibase/shells/drawsh.cxx +++ b/sw/source/uibase/shells/drawsh.cxx @@ -90,29 +90,29 @@ SdrObject* SwDrawShell::IsSingleFillableNonOLESelected() if(!pSdrView) { - return 0; + return nullptr; } if(1 != pSdrView->GetMarkedObjectCount()) { - return 0; + return nullptr; } SdrObject* pPickObj = pSdrView->GetMarkedObjectByIndex(0); if(!pPickObj) { - return 0; + return nullptr; } if(!pPickObj->IsClosedObj()) { - return 0; + return nullptr; } if(dynamic_cast< SdrOle2Obj* >(pPickObj)) { - return 0; + return nullptr; } return pPickObj; @@ -579,8 +579,8 @@ void SwDrawShell::GetFormTextState(SfxItemSet& rSet) SwWrtShell &rSh = GetShell(); SdrView* pDrView = rSh.GetDrawView(); const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList(); - const SdrObject* pObj = NULL; - SvxFontWorkDialog* pDlg = NULL; + const SdrObject* pObj = nullptr; + SvxFontWorkDialog* pDlg = nullptr; const sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId(); @@ -588,7 +588,7 @@ void SwDrawShell::GetFormTextState(SfxItemSet& rSet) if ( pVFrame->HasChildWindow(nId) ) { SfxChildWindow *pChildWindow = pVFrame->GetChildWindow(nId); - pDlg = pChildWindow ? static_cast<SvxFontWorkDialog*>(pChildWindow->GetWindow()) : NULL; + pDlg = pChildWindow ? static_cast<SvxFontWorkDialog*>(pChildWindow->GetWindow()) : nullptr; } if ( rMarkList.GetMarkCount() == 1 ) diff --git a/sw/source/uibase/shells/drformsh.cxx b/sw/source/uibase/shells/drformsh.cxx index 7fe17f17b6f2..6162ba5498e9 100644 --- a/sw/source/uibase/shells/drformsh.cxx +++ b/sw/source/uibase/shells/drformsh.cxx @@ -71,7 +71,7 @@ TYPEINIT1(SwDrawFormShell, SwDrawBaseShell) void SwDrawFormShell::Execute(SfxRequest &rReq) { SwWrtShell &rSh = GetShell(); - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; const SfxItemSet *pArgs = rReq.GetArgs(); switch ( rReq.GetSlot() ) diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx index eca6b0489467..ec43a4f81cc4 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -104,7 +104,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) sal_uInt16 nSlotId = rReq.GetSlot(); bool bChanged = pSdrView->GetModel()->IsChanged(); pSdrView->GetModel()->SetChanged(false); - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if(pArgs) pArgs->GetItemState(nSlotId, false, &pItem); @@ -131,7 +131,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) if(!pArgs) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); - if( rMarkList.GetMark(0) != 0 ) + if( rMarkList.GetMark(0) != nullptr ) { SfxItemSet aSet(GetPool(), RES_SURROUND, RES_SURROUND, RES_ANCHOR, RES_ANCHOR, @@ -180,7 +180,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) if(!pArgs) { const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); - if( rMarkList.GetMark(0) != 0 ) + if( rMarkList.GetMark(0) != nullptr ) { SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); std::unique_ptr<SfxAbstractTabDialog> pDlg; @@ -201,7 +201,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); AbstractSvxCaptionDialog* pCaptionDlg = - pFact->CreateCaptionDialog( NULL, pSdrView, nAllowedAnchors ); + pFact->CreateCaptionDialog( nullptr, pSdrView, nAllowedAnchors ); pCaptionDlg->SetValidateFramePosLink( LINK(this, SwDrawBaseShell, ValidatePosition) ); pDlg.reset(pCaptionDlg); } @@ -209,7 +209,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); AbstractSvxTransformTabDialog* pTransform = - pFact->CreateSvxTransformTabDialog( NULL, NULL, pSdrView, nAllowedAnchors ); + pFact->CreateSvxTransformTabDialog( nullptr, nullptr, pSdrView, nAllowedAnchors ); pTransform->SetValidateFramePosLink( LINK(this, SwDrawBaseShell, ValidatePosition) ); pDlg.reset(pTransform); } @@ -287,10 +287,10 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) aFrmAttrSet.Put( aAnchor ); } } - const SfxPoolItem* pHoriOrient = 0; - const SfxPoolItem* pHoriRelation = 0; - const SfxPoolItem* pHoriPosition = 0; - const SfxPoolItem* pHoriMirror = 0; + const SfxPoolItem* pHoriOrient = nullptr; + const SfxPoolItem* pHoriRelation = nullptr; + const SfxPoolItem* pHoriPosition = nullptr; + const SfxPoolItem* pHoriMirror = nullptr; pOutSet->GetItemState(SID_ATTR_TRANSFORM_HORI_ORIENT, false, &pHoriOrient); pOutSet->GetItemState(SID_ATTR_TRANSFORM_HORI_RELATION, false, &pHoriRelation); pOutSet->GetItemState(SID_ATTR_TRANSFORM_HORI_POSITION, false, &pHoriPosition); @@ -310,9 +310,9 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) aFrmAttrSet.Put(aHOrient); } - const SfxPoolItem* pVertOrient = 0; - const SfxPoolItem* pVertRelation = 0; - const SfxPoolItem* pVertPosition = 0; + const SfxPoolItem* pVertOrient = nullptr; + const SfxPoolItem* pVertRelation = nullptr; + const SfxPoolItem* pVertPosition = nullptr; pOutSet->GetItemState(SID_ATTR_TRANSFORM_VERT_ORIENT, false, &pVertOrient); pOutSet->GetItemState(SID_ATTR_TRANSFORM_VERT_RELATION, false, &pVertRelation); pOutSet->GetItemState(SID_ATTR_TRANSFORM_VERT_POSITION, false, &pVertPosition); @@ -328,7 +328,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) aVOrient.SetPos( static_cast<const SfxInt32Item*>(pVertPosition)->GetValue()); aFrmAttrSet.Put( aVOrient ); } - const SfxPoolItem* pFollowItem = 0; + const SfxPoolItem* pFollowItem = nullptr; pOutSet->GetItemState(RES_FOLLOW_TEXT_FLOW, false, &pFollowItem); if(pFollowItem) aFrmAttrSet.Put(*pFollowItem); @@ -376,7 +376,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) if (GetView().GetDrawFuncPtr()) { GetView().GetDrawFuncPtr()->Deactivate(); - GetView().SetDrawFuncPtr(NULL); + GetView().SetDrawFuncPtr(nullptr); } GetView().LeaveDrawCreate(); // Switch to selection mode } @@ -523,7 +523,7 @@ void SwDrawBaseShell::Execute(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, SwDrawBaseShell, CheckGroupShapeNameHdl)); @@ -553,7 +553,7 @@ void SwDrawBaseShell::Execute(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()) @@ -698,7 +698,7 @@ void SwDrawBaseShell::GetState(SfxItemSet& rSet) // #i68101# case FN_TITLE_DESCRIPTION_SHAPE: { - const bool bIsWebView(NULL != dynamic_cast<SwWebView*>(&GetView())); + const bool bIsWebView(nullptr != dynamic_cast<SwWebView*>(&GetView())); if(!bIsWebView && 1L != pSdrView->GetMarkedObjectCount()) { @@ -716,7 +716,7 @@ void SwDrawBaseShell::GetDrawAttrStateForIFBX( SfxItemSet& rSet ) SwWrtShell *pSh = &GetShell(); SdrView* pSdrView = pSh->GetDrawView(); const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); - if( rMarkList.GetMark(0) != 0 ) + if( rMarkList.GetMark(0) != nullptr ) { SfxItemSet aNewAttr(pSdrView->GetGeoAttrFromMarked()); rSet.Put(aNewAttr,false); @@ -759,7 +759,7 @@ IMPL_LINK_TYPED(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation&, rValid // OD 18.09.2003 #i18732# - adjustment for allowing vertical position // aligned to page for fly frame anchored to paragraph or to character. const RndStdIds eAnchorType = static_cast<RndStdIds >(rValidation.nAnchorType); - const SwPosition* pContentPos = 0; + const SwPosition* pContentPos = nullptr; SdrView* pSdrView = pSh->GetDrawView(); const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); if( rMarkList.GetMarkCount() == 1 ) @@ -774,7 +774,7 @@ IMPL_LINK_TYPED(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation&, rValid rValidation.nVRelOrient, pContentPos, rValidation.bFollowTextFlow, - rValidation.bMirror, NULL, &rValidation.aPercentSize); + rValidation.bMirror, nullptr, &rValidation.aPercentSize); bool bIsInVertical( false ); { diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index 59550baea276..377753d781fb 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -422,7 +422,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); assert(pFact && "SwAbstractDialogFactory fail!"); - std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwParaDlg( GetView().GetWindow(), GetView(), aDlgAttr,DLG_STD, 0, true )); + std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSwParaDlg( GetView().GetWindow(), GetView(), aDlgAttr,DLG_STD, nullptr, true )); assert(pDlg && "Dialog creation failed!"); sal_uInt16 nRet = pDlg->Execute(); if(RET_OK == nRet) @@ -457,7 +457,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) break; case SID_HYPERLINK_SETLINK: { - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if(pNewAttrs) pNewAttrs->GetItemState(nSlot, false, &pItem); @@ -590,7 +590,7 @@ void SwDrawTextShell::GetState(SfxItemSet& rSet) sal_uInt16 nWhich = aIter.FirstWhich(); SfxItemSet aEditAttr( pOLV->GetAttribs() ); - const SfxPoolItem *pAdjust = 0, *pLSpace = 0, *pEscItem = 0; + const SfxPoolItem *pAdjust = nullptr, *pLSpace = nullptr, *pEscItem = nullptr; int eAdjust, nLSpace, nEsc; while(nWhich) diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx index ff2c67e550c7..4a8cb89257fe 100644 --- a/sw/source/uibase/shells/drwtxtsh.cxx +++ b/sw/source/uibase/shells/drwtxtsh.cxx @@ -238,8 +238,8 @@ void SwDrawTextShell::GetFormTextState(SfxItemSet& rSet) SwWrtShell &rSh = GetShell(); SdrView* pDrView = rSh.GetDrawView(); const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList(); - const SdrObject* pObj = NULL; - SvxFontWorkDialog* pDlg = NULL; + const SdrObject* pObj = nullptr; + SvxFontWorkDialog* pDlg = nullptr; const sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId(); @@ -247,7 +247,7 @@ void SwDrawTextShell::GetFormTextState(SfxItemSet& rSet) if (pVFrame->HasChildWindow(nId)) { SfxChildWindow* pWnd = pVFrame->GetChildWindow(nId); - pDlg = pWnd ? static_cast<SvxFontWorkDialog*>(pWnd->GetWindow()) : NULL; + pDlg = pWnd ? static_cast<SvxFontWorkDialog*>(pWnd->GetWindow()) : nullptr; } if ( rMarkList.GetMarkCount() == 1 ) @@ -296,7 +296,7 @@ void SwDrawTextShell::ExecDrawLingu(SfxRequest &rReq) break; case SID_HANGUL_HANJA_CONVERSION: - pOutlinerView->StartTextConversion(LANGUAGE_KOREAN, LANGUAGE_KOREAN, NULL, + pOutlinerView->StartTextConversion(LANGUAGE_KOREAN, LANGUAGE_KOREAN, nullptr, i18n::TextConversionOption::CHARACTER_BY_CHARACTER, true, false); break; @@ -321,7 +321,7 @@ void SwDrawTextShell::ExecDrawLingu(SfxRequest &rReq) return; // initialize dialog - Reference<awt::XWindow> xDialogParentWindow(0); + Reference<awt::XWindow> xDialogParentWindow(nullptr); Sequence<Any> aSequence(1); Any* pArray = aSequence.getArray(); PropertyValue aParam; @@ -416,7 +416,7 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq) { const SfxItemSet *pNewAttrs = rReq.GetArgs(); sal_uInt16 nSlot = rReq.GetSlot(); - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if(pNewAttrs) { pNewAttrs->GetItemState(nSlot, false, &pItem ); @@ -695,7 +695,7 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq) if(!pOLV) return; const SfxItemSet *pArgs = rReq.GetArgs(); - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if( pArgs ) pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), false, &pItem); @@ -704,7 +704,7 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq) if ( pItem ) { sSym = static_cast<const SfxStringItem*>(pItem)->GetValue(); - const SfxPoolItem* pFtItem = NULL; + const SfxPoolItem* pFtItem = nullptr; pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem); const SfxStringItem* pFontItem = dynamic_cast<const SfxStringItem*>( pFtItem ); if ( pFontItem ) diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx index 0872981aa2be..3473a2ffa4ab 100644 --- a/sw/source/uibase/shells/frmsh.cxx +++ b/sw/source/uibase/shells/frmsh.cxx @@ -98,7 +98,7 @@ static const SwFrameFormat* lcl_GetFrameFormatByName(SwWrtShell& rSh, const OUSt if(pFormat->GetName() == rName) return pFormat; } - return 0; + return nullptr; } #define SwFrameShell @@ -622,7 +622,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); assert(pFact); std::unique_ptr<AbstractSvxObjectTitleDescDialog> pDlg( - pFact->CreateSvxObjectTitleDescDialog( NULL, + pFact->CreateSvxObjectTitleDescDialog( nullptr, aTitle, aDescription )); assert(pDlg); @@ -676,7 +676,7 @@ void SwFrameShell::GetState(SfxItemSet& rSet) bProtect |= bParentCntProt; - const FrmTypeFlags eFrmType = rSh.GetFrmType(0,true); + const FrmTypeFlags eFrmType = rSh.GetFrmType(nullptr,true); SwFlyFrmAttrMgr aMgr( false, &rSh, FRMMGR_TYPE_NONE ); SfxWhichIter aIter( rSet ); @@ -967,7 +967,7 @@ void SwFrameShell::ExecFrameStyle(SfxRequest& rReq) SvxBoxItem aBoxItem(rBoxItem); SvxBorderLine aBorderLine; - const SfxPoolItem *pItem = 0; + const SfxPoolItem *pItem = nullptr; if(pArgs) // Any controller can sometimes deliver nothing #48169# { @@ -980,13 +980,13 @@ void SwFrameShell::ExecFrameStyle(SfxRequest& rReq) SvxBoxItem aNewBox(*static_cast<const SvxBoxItem *>(pItem)); const SvxBorderLine* pBorderLine; - if ((pBorderLine = aBoxItem.GetTop()) != NULL) + if ((pBorderLine = aBoxItem.GetTop()) != nullptr) lcl_FrmGetMaxLineWidth(pBorderLine, aBorderLine); - if ((pBorderLine = aBoxItem.GetBottom()) != NULL) + if ((pBorderLine = aBoxItem.GetBottom()) != nullptr) lcl_FrmGetMaxLineWidth(pBorderLine, aBorderLine); - if ((pBorderLine = aBoxItem.GetLeft()) != NULL) + if ((pBorderLine = aBoxItem.GetLeft()) != nullptr) lcl_FrmGetMaxLineWidth(pBorderLine, aBorderLine); - if ((pBorderLine = aBoxItem.GetRight()) != NULL) + if ((pBorderLine = aBoxItem.GetRight()) != nullptr) lcl_FrmGetMaxLineWidth(pBorderLine, aBorderLine); if(aBorderLine.GetOutWidth() == 0) @@ -1007,13 +1007,13 @@ void SwFrameShell::ExecFrameStyle(SfxRequest& rReq) aBoxItem = aNewBox; SvxBorderLine aDestBorderLine; - if( aBoxItem.GetTop() != NULL ) + if( aBoxItem.GetTop() != nullptr ) aBoxItem.SetLine(&aBorderLine, SvxBoxItemLine::TOP); - if( aBoxItem.GetBottom() != NULL ) + if( aBoxItem.GetBottom() != nullptr ) aBoxItem.SetLine(&aBorderLine, SvxBoxItemLine::BOTTOM); - if( aBoxItem.GetLeft() != NULL ) + if( aBoxItem.GetLeft() != nullptr ) aBoxItem.SetLine(&aBorderLine, SvxBoxItemLine::LEFT); - if( aBoxItem.GetRight() != NULL ) + if( aBoxItem.GetRight() != nullptr ) aBoxItem.SetLine(&aBorderLine, SvxBoxItemLine::RIGHT); } } @@ -1064,10 +1064,10 @@ void SwFrameShell::ExecFrameStyle(SfxRequest& rReq) } else { - aBoxItem.SetLine(0, SvxBoxItemLine::TOP); - aBoxItem.SetLine(0, SvxBoxItemLine::BOTTOM); - aBoxItem.SetLine(0, SvxBoxItemLine::LEFT); - aBoxItem.SetLine(0, SvxBoxItemLine::RIGHT); + aBoxItem.SetLine(nullptr, SvxBoxItemLine::TOP); + aBoxItem.SetLine(nullptr, SvxBoxItemLine::BOTTOM); + aBoxItem.SetLine(nullptr, SvxBoxItemLine::LEFT); + aBoxItem.SetLine(nullptr, SvxBoxItemLine::RIGHT); } } } @@ -1255,7 +1255,7 @@ void SwFrameShell::ExecDrawDlgTextFrame(SfxRequest& rReq) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); assert(pFact); std::unique_ptr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog( - NULL, + nullptr, &aNewAttr, pDoc, false)); diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index bc681b588b02..749474d7c80f 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -132,7 +132,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) case SID_SAVE_GRAPHIC: { const Graphic *pGraphic; - if(0 != (pGraphic = rSh.GetGraphic())) + if(nullptr != (pGraphic = rSh.GetGraphic())) { OUString sGrfNm; OUString sFilterNm; @@ -191,7 +191,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) // When the graphic is selected to be opened via some external tool // for advanced editing GraphicObject const*const pGraphicObject(rSh.GetGraphicObj()); - if(0 != pGraphicObject) + if(nullptr != pGraphicObject) { m_ExternalEdits.push_back(std::unique_ptr<SwExternalToolEdit>( new SwExternalToolEdit(&rSh))); @@ -336,7 +336,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) aSet.Put(SfxFrameItem( SID_DOCFRAME, &GetView().GetViewFrame()->GetTopFrame())); SfxObjectShell * sh = rSh.GetDoc()->GetPersist(); - if (sh != 0 && sh->HasName()) + if (sh != nullptr && sh->HasName()) { aSet.Put( SfxStringItem(SID_REFERER, sh->GetMedium()->GetName())); @@ -477,7 +477,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) case SID_OBJECT_CROP: { GraphicObject const *pGraphicObject = rSh.GetGraphicObj(); - if (0 != pGraphicObject && SDRDRAG_CROP != rSh.GetDragMode()) { + if (nullptr != pGraphicObject && SDRDRAG_CROP != rSh.GetDragMode()) { rSh.StartCropImage(); } } @@ -502,7 +502,7 @@ void SwGrfShell::ExecAttr( SfxRequest &rReq ) const SfxPoolItem* pItem; sal_uInt16 nSlot = rReq.GetSlot(); if( !pArgs || SfxItemState::SET != pArgs->GetItemState( nSlot, false, &pItem )) - pItem = 0; + pItem = nullptr; switch( nSlot ) { @@ -827,7 +827,7 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet) rSet.DisableItem( nWhich ); nWhich = aIter.NextWhich(); } - SetGetStateSet( 0 ); + SetGetStateSet( nullptr ); } void SwGrfShell::ExecuteRotation(SfxRequest &rReq) @@ -928,7 +928,7 @@ void SwGrfShell::GetAttrStateForRotation(SfxItemSet &rSet) rSet.DisableItem( nWhich ); nWhich = aIterator.NextWhich(); } - SetGetStateSet( 0 ); + SetGetStateSet( nullptr ); } SwGrfShell::~SwGrfShell() diff --git a/sw/source/uibase/shells/langhelper.cxx b/sw/source/uibase/shells/langhelper.cxx index 3f9ced7a89d7..1ded2e66fbc1 100644 --- a/sw/source/uibase/shells/langhelper.cxx +++ b/sw/source/uibase/shells/langhelper.cxx @@ -226,7 +226,7 @@ namespace SwLangHelper void SetLanguage( SwWrtShell &rWrtSh, const OUString &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet ) { - SetLanguage( rWrtSh, 0 , ESelection(), rLangText, bIsForSelection, rCoreSet ); + SetLanguage( rWrtSh, nullptr , ESelection(), rLangText, bIsForSelection, rCoreSet ); } void SetLanguage( SwWrtShell &rWrtSh, OutlinerView* pOLV, const ESelection& rSelection, const OUString &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet ) @@ -234,7 +234,7 @@ namespace SwLangHelper const LanguageType nLang = SvtLanguageTable::GetLanguageType( rLangText ); if (nLang != LANGUAGE_DONTKNOW) { - EditEngine* pEditEngine = pOLV ? pOLV->GetEditView().GetEditEngine() : NULL; + EditEngine* pEditEngine = pOLV ? pOLV->GetEditView().GetEditEngine() : nullptr; OSL_ENSURE( !pOLV || pEditEngine, "OutlinerView without EditEngine???" ); //get ScriptType @@ -308,7 +308,7 @@ namespace SwLangHelper void SetLanguage_None( SwWrtShell &rWrtSh, bool bIsForSelection, SfxItemSet &rCoreSet ) { - SetLanguage_None( rWrtSh,0,ESelection(),bIsForSelection,rCoreSet ); + SetLanguage_None( rWrtSh,nullptr,ESelection(),bIsForSelection,rCoreSet ); } void SetLanguage_None( SwWrtShell &rWrtSh, OutlinerView* pOLV, const ESelection& rSelection, bool bIsForSelection, SfxItemSet &rCoreSet ) @@ -335,7 +335,7 @@ namespace SwLangHelper // (for paragraph is handled by previosuly having set the selection to the // whole paragraph) - EditEngine* pEditEngine = pOLV ? pOLV->GetEditView().GetEditEngine() : NULL; + EditEngine* pEditEngine = pOLV ? pOLV->GetEditView().GetEditEngine() : nullptr; OSL_ENSURE( !pOLV || pEditEngine, "OutlinerView without EditEngine???" ); if (pEditEngine) { @@ -368,7 +368,7 @@ namespace SwLangHelper void ResetLanguages( SwWrtShell &rWrtSh, bool bIsForSelection ) { - ResetLanguages( rWrtSh, 0 , ESelection(), bIsForSelection ); + ResetLanguages( rWrtSh, nullptr , ESelection(), bIsForSelection ); } void ResetLanguages( SwWrtShell &rWrtSh, OutlinerView* pOLV, const ESelection& rSelection, bool bIsForSelection ) @@ -416,7 +416,7 @@ namespace SwLangHelper LanguageType nLang = LANGUAGE_SYSTEM; - const SfxPoolItem *pItem = 0; + const SfxPoolItem *pItem = nullptr; SfxItemState nState = aSet.GetItemState( nLangWhichId, true, &pItem ); if (nState > SfxItemState::DEFAULT && pItem) { diff --git a/sw/source/uibase/shells/mediash.cxx b/sw/source/uibase/shells/mediash.cxx index 6afb7f525ccf..b39ade8b7b2e 100644 --- a/sw/source/uibase/shells/mediash.cxx +++ b/sw/source/uibase/shells/mediash.cxx @@ -114,7 +114,7 @@ void SwMediaShell::ExecMedia(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/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index ce012a693a13..96016f8cf94e 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -201,7 +201,7 @@ static SwTableRep* lcl_TableParamToItemSet( SfxItemSet& rSet, SwWrtShell &rSh ) rSh.GetTabBorders( rSet ); //row split - SwFormatRowSplit* pSplit = 0; + SwFormatRowSplit* pSplit = nullptr; rSh.GetRowSplit(pSplit); if(pSplit) { @@ -274,7 +274,7 @@ void ItemSetToTableParam( const SfxItemSet& rSet, { rSh.StartAllAction(); rSh.StartUndo( UNDO_TABLE_ATTR ); - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if(SfxItemState::SET == rSet.GetItemState(SID_BACKGRND_DESTINATION, false, &pItem)) { @@ -284,14 +284,14 @@ void ItemSetToTableParam( const SfxItemSet& rSet, } bool bBorder = ( SfxItemState::SET == rSet.GetItemState( RES_BOX ) || SfxItemState::SET == rSet.GetItemState( SID_ATTR_BORDER_INNER ) ); - pItem = 0; + pItem = nullptr; bool bBackground = SfxItemState::SET == rSet.GetItemState( RES_BACKGROUND, false, &pItem ); - const SfxPoolItem* pRowItem = 0, *pTableItem = 0; + const SfxPoolItem* pRowItem = nullptr, *pTableItem = nullptr; bBackground |= SfxItemState::SET == rSet.GetItemState( SID_ATTR_BRUSH_ROW, false, &pRowItem ); bBackground |= SfxItemState::SET == rSet.GetItemState( SID_ATTR_BRUSH_TABLE, false, &pTableItem ); - const SfxPoolItem* pSplit = 0; + const SfxPoolItem* pSplit = nullptr; bool bRowSplit = SfxItemState::SET == rSet.GetItemState( RES_ROW_SPLIT, false, &pSplit ); - const SfxPoolItem* pBoxDirection = 0; + const SfxPoolItem* pBoxDirection = nullptr; bool bBoxDirection = SfxItemState::SET == rSet.GetItemState( FN_TABLE_BOX_TEXTORIENTATION, false, &pBoxDirection ); if( bBackground || bBorder || bRowSplit || bBoxDirection) { @@ -353,7 +353,7 @@ void ItemSetToTableParam( const SfxItemSet& rSet, SwTabCols aTabCols; bool bTabCols = false; - SwTableRep* pRep = 0; + SwTableRep* pRep = nullptr; SwFrameFormat *pFormat = rSh.GetTableFormat(); SfxItemSet aSet( rSh.GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); if(SfxItemState::SET == rSet.GetItemState( FN_TABLE_REP, false, &pItem )) @@ -454,7 +454,7 @@ void SwTableShell::Execute(SfxRequest &rReq) // At first the slots which doesn't need a FrmMgr. bool bMore = false; - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; sal_uInt16 nSlot = rReq.GetSlot(); if(pArgs) pArgs->GetItemState(GetPool().GetWhich(nSlot), false, &pItem); @@ -476,7 +476,7 @@ void SwTableShell::Execute(SfxRequest &rReq) rSh.GetTabBorders( aCoreSet ); const SvxBoxItem& rCoreBox = static_cast<const SvxBoxItem&>( aCoreSet.Get(RES_BOX)); - const SfxPoolItem *pBoxItem = 0; + const SfxPoolItem *pBoxItem = nullptr; if ( pArgs->GetItemState(RES_BOX, true, &pBoxItem) == SfxItemState::SET ) { aBox = *static_cast<const SvxBoxItem*>(pBoxItem); @@ -788,7 +788,7 @@ void SwTableShell::Execute(SfxRequest &rReq) break; case FN_TABLE_SET_READ_ONLY_CELLS: rSh.ProtectCells(); - rSh.ResetSelect( 0, false ); + rSh.ResetSelect( nullptr, false ); bCallDone = true; break; case FN_TABLE_UNSET_READ_ONLY_CELLS: @@ -923,7 +923,7 @@ void SwTableShell::Execute(SfxRequest &rReq) if ( FN_TABLE_INSERT_ROW_DLG != nSlot || !rSh.IsInRepeatedHeadline()) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - std::unique_ptr<SvxAbstractInsRowColDlg> pDlg( pFact ? pFact->CreateSvxInsRowColDlg( GetView().GetWindow(), nSlot == FN_TABLE_INSERT_COL_DLG, pSlot->GetCommand() ) : 0); + std::unique_ptr<SvxAbstractInsRowColDlg> pDlg( pFact ? pFact->CreateSvxInsRowColDlg( GetView().GetWindow(), nSlot == FN_TABLE_INSERT_COL_DLG, pSlot->GetCommand() ) : nullptr); if( pDlg.get() && (pDlg->Execute() == 1) ) { @@ -1168,7 +1168,7 @@ void SwTableShell::Execute(SfxRequest &rReq) case FN_TABLE_ROW_SPLIT : { const SfxBoolItem* pBool = static_cast<const SfxBoolItem*>(pItem); - SwFormatRowSplit* pSplit = 0; + SwFormatRowSplit* pSplit = nullptr; if(!pBool) { rSh.GetRowSplit(pSplit); @@ -1347,7 +1347,7 @@ void SwTableShell::GetState(SfxItemSet &rSet) } else { - SwFormatRowSplit* pSplit = 0; + SwFormatRowSplit* pSplit = nullptr; rSh.GetRowSplit(pSplit); if(pSplit) rSet.Put(*pSplit); @@ -1407,7 +1407,7 @@ void SwTableShell::ExecTableStyle(SfxRequest& rReq) const SvxLineItem &rLineItem = static_cast<const SvxLineItem&>(pArgs-> Get( SID_FRAME_LINESTYLE )); const SvxBorderLine* pBorderLine = rLineItem.GetLine(); - rSh.SetTabLineStyle( 0, true, pBorderLine); + rSh.SetTabLineStyle( nullptr, true, pBorderLine); } else { @@ -1446,7 +1446,7 @@ void SwTableShell::ExecNumberFormat(SfxRequest& rReq) SwWrtShell &rSh = GetShell(); // At first the slots, which doesn't need a FrmMgr. - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; const sal_uInt16 nSlot = rReq.GetSlot(); if(pArgs) pArgs->GetItemState(GetPool().GetWhich(nSlot), false, &pItem); diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index 4ea500e1d49c..869d845de3cc 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -109,7 +109,7 @@ static OUString lcl_BuildTitleWithRedline( const SwRangeRedline *pRedline ) void SwTextShell::ExecField(SfxRequest &rReq) { SwWrtShell& rSh = GetShell(); - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; sal_uInt16 nSlot = rReq.GetSlot(); const SfxItemSet* pArgs = rReq.GetArgs(); @@ -183,7 +183,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) bool bRet = false; SwFieldType* pField = rSh.GetFieldType( 0, RES_INPUTFLD ); const bool bAddSetExpressionFields = !( rSh.GetViewOptions()->IsReadonly() ); - if ( pField != NULL + if ( pField != nullptr && rSh.MoveFieldType( pField, FN_GOTO_NEXT_INPUTFLD == nSlot, @@ -191,7 +191,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) bAddSetExpressionFields ) ) { rSh.ClearMark(); - if ( dynamic_cast<SwInputField*>(rSh.GetCurField( true )) != NULL ) + if ( dynamic_cast<SwInputField*>(rSh.GetCurField( true )) != nullptr ) { rSh.SttSelect(); rSh.SelectText( @@ -304,7 +304,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) { SfxViewFrame* pVFrame = GetView().GetViewFrame(); pVFrame->ToggleChildWindow(FN_INSERT_FIELD); - bRes = pVFrame->GetChildWindow( nSlot ) != 0; + bRes = pVFrame->GetChildWindow( nSlot ) != nullptr; Invalidate(rReq.GetSlot()); Invalidate(FN_INSERT_FIELD_CTRL); rReq.Ignore(); @@ -420,7 +420,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) { if ( pSwFormatField->GetField() == pPostIt ) { - pSwFormatField->Broadcast( SwFormatFieldHint( 0, SwFormatFieldHintWhich::FOCUS, &GetView() ) ); + pSwFormatField->Broadcast( SwFormatFieldHint( nullptr, SwFormatFieldHintWhich::FOCUS, &GetView() ) ); break; } pSwFormatField = aIter.Next(); @@ -477,7 +477,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) pActRed = rSh.SelPrevRedline(); } - bool bPrev = pActRed != 0; + bool bPrev = pActRed != nullptr; rSh.Pop(false); rSh.EndAction(); @@ -487,7 +487,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) rSh.StartAction(); rSh.Push(); pActRed = rSh.SelNextRedline(); - bool bNext = pActRed != 0; + bool bNext = pActRed != nullptr; rSh.Pop(false); // Restore cursor position if( rSh.IsCrsrPtAtEnd() ) @@ -525,7 +525,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) } pDlg.reset(); - SwViewShell::SetCareWin(NULL); + SwViewShell::SetCareWin(nullptr); g_bNoInterrupt = false; rSh.ClearMark(); GetView().AttrChangedNotify(GetShellPtr()); @@ -643,7 +643,7 @@ void SwTextShell::StateField( SfxItemSet &rSet ) { SwWrtShell& rSh = GetShell(); SfxWhichIter aIter( rSet ); - const SwField* pField = 0; + const SwField* pField = nullptr; bool bGetField = false; sal_uInt16 nWhich = aIter.FirstWhich(); @@ -869,7 +869,7 @@ IMPL_LINK_TYPED( SwTextShell, RedlineNextHdl, AbstractSvxPostItDialog&, rDlg, vo pSh->Push(); const SwRangeRedline *pActRed = pSh->SelNextRedline(); - pSh->Pop(pActRed != 0); + pSh->Pop(pActRed != nullptr); bool bEnable = false; @@ -877,7 +877,7 @@ IMPL_LINK_TYPED( SwTextShell, RedlineNextHdl, AbstractSvxPostItDialog&, rDlg, vo { pSh->StartAction(); pSh->Push(); - bEnable = pSh->SelNextRedline() != 0; + bEnable = pSh->SelNextRedline() != nullptr; pSh->Pop(false); pSh->EndAction(); } @@ -913,7 +913,7 @@ IMPL_LINK_TYPED( SwTextShell, RedlinePrevHdl, AbstractSvxPostItDialog&, rDlg, vo // Traveling only if more than one field. pSh->Push(); const SwRangeRedline *pActRed = pSh->SelPrevRedline(); - pSh->Pop(pActRed != 0); + pSh->Pop(pActRed != nullptr); bool bEnable = false; @@ -921,7 +921,7 @@ IMPL_LINK_TYPED( SwTextShell, RedlinePrevHdl, AbstractSvxPostItDialog&, rDlg, vo { pSh->StartAction(); pSh->Push(); - bEnable = pSh->SelPrevRedline() != 0; + bEnable = pSh->SelPrevRedline() != nullptr; pSh->Pop(false); pSh->EndAction(); } diff --git a/sw/source/uibase/shells/textglos.cxx b/sw/source/uibase/shells/textglos.cxx index 525b3e94ee64..855d6c803394 100644 --- a/sw/source/uibase/shells/textglos.cxx +++ b/sw/source/uibase/shells/textglos.cxx @@ -41,7 +41,7 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq) bool bUpdateList = false; const SfxItemSet *pArgs = rReq.GetArgs(); - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if(pArgs) pArgs->GetItemState(nSlot, false, &pItem ); diff --git a/sw/source/uibase/shells/textidx.cxx b/sw/source/uibase/shells/textidx.cxx index 9686c3ca2fdd..7eacd872d994 100644 --- a/sw/source/uibase/shells/textidx.cxx +++ b/sw/source/uibase/shells/textidx.cxx @@ -44,7 +44,7 @@ void SwTextShell::ExecIdx(SfxRequest &rReq) { const SfxItemSet *pArgs = rReq.GetArgs(); - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; const sal_uInt16 nSlot = rReq.GetSlot(); if(pArgs) pArgs->GetItemState(nSlot, false, &pItem ); @@ -121,7 +121,7 @@ void SwTextShell::ExecIdx(SfxRequest &rReq) aSet.Put(SwFormatFrmSize(ATT_VAR_SIZE, nWidth)); // Height = width for a more consistent preview (analogous to edit range) aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth))); - const SwTOXBase* pCurTOX = 0; + const SwTOXBase* pCurTOX = nullptr; bool bGlobal = false; if(pItem) { @@ -170,8 +170,8 @@ void SwTextShell::GetIdxState(SfxItemSet &rSet) SfxChildWindow* pAuthMark = pVFrame->GetChildWindow(FN_INSERT_AUTH_ENTRY_DLG); const bool bHtmlMode = 0 != ::GetHtmlMode( GetView().GetDocShell() ); - const SwTOXBase* pBase = 0; - if( bHtmlMode || 0 != ( pBase = rSh.GetCurTOX()) ) + const SwTOXBase* pBase = nullptr; + if( bHtmlMode || nullptr != ( pBase = rSh.GetCurTOX()) ) { if( pBase ) { @@ -229,14 +229,14 @@ void SwTextShell::GetIdxState(SfxItemSet &rSet) } else rSet.Put(SfxBoolItem(FN_INSERT_IDX_ENTRY_DLG, - 0 != pIdxMrk)); + nullptr != pIdxMrk)); SwField* pField = rSh.GetCurField(); if(bInReadonly) rSet.DisableItem(FN_INSERT_AUTH_ENTRY_DLG); else - rSet.Put(SfxBoolItem(FN_INSERT_AUTH_ENTRY_DLG, 0 != pAuthMark)); + rSet.Put(SfxBoolItem(FN_INSERT_AUTH_ENTRY_DLG, nullptr != pAuthMark)); if( bInReadonly || !pField || pField->GetTyp()->Which() != RES_AUTHORITY) diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index 8c65f71359fd..619186115204 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -143,7 +143,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) "wrong shell on dispatcher" ); const SfxItemSet *pArgs = rReq.GetArgs(); - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; const sal_uInt16 nSlot = rReq.GetSlot(); if(pArgs) pArgs->GetItemState(nSlot, false, &pItem ); @@ -272,7 +272,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) } } - rSh.InsertObject( xObj, 0, true, nSlot); + rSh.InsertObject( xObj, nullptr, true, nSlot); } } } @@ -283,7 +283,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) case SID_INSERT_PLUGIN: { const SfxGlobalNameItem* pNameItem = rReq.GetArg<SfxGlobalNameItem>(SID_INSERT_OBJECT); - SvGlobalName *pName = NULL; + SvGlobalName *pName = nullptr; SvGlobalName aName; if ( pNameItem ) { @@ -413,7 +413,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) } else { - rSh.InsertObject( xObj, 0, true, nSlot); + rSh.InsertObject( xObj, nullptr, true, nSlot); rReq.Done(); } } @@ -526,7 +526,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) case FN_INSERT_FRAME: { bool bSingleCol = false; - if( 0!= dynamic_cast< SwWebDocShell*>( GetView().GetDocShell()) ) + if( nullptr!= dynamic_cast< SwWebDocShell*>( GetView().GetDocShell()) ) { SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get(); if( HTML_CFG_MSIE == rHtmlOpt.GetExportMode() ) @@ -926,7 +926,7 @@ void SwTextShell::ExecRotateTransliteration( SfxRequest & rReq ) } SwTextShell::SwTextShell(SwView &_rView) : - SwBaseShell(_rView), pPostItFieldMgr( 0 ) + SwBaseShell(_rView), pPostItFieldMgr( nullptr ) { SetName("Text"); SetHelpId(SW_TEXTSHELL); @@ -983,7 +983,7 @@ SfxItemSet SwTextShell::CreateInsertFrameItemSet(SwFlyFrmAttrMgr& rMgr) void SwTextShell::InsertSymbol( SfxRequest& rReq ) { const SfxItemSet *pArgs = rReq.GetArgs(); - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; if( pArgs ) pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), false, &pItem); @@ -991,7 +991,7 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq ) if ( pItem ) { aChars = static_cast<const SfxStringItem*>(pItem)->GetValue(); - const SfxPoolItem* pFtItem = NULL; + const SfxPoolItem* pFtItem = nullptr; pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem); const SfxStringItem* pFontItem = dynamic_cast<const SfxStringItem*>( pFtItem ); if ( pFontItem ) diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 94f95fe0bd53..3e3e2e3b1ba6 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -194,7 +194,7 @@ void sw_CharDialog( SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot,const pDlg->SetCurPageId(OUStringToOString(pItem->GetValue(), RTL_TEXTENCODING_UTF8)); } - const SfxItemSet* pSet = NULL; + const SfxItemSet* pSet = nullptr; if ( !bUseDialog ) pSet = pArgs; else if ( pDlg && pDlg->Execute() == RET_OK ) /* #110771# pDlg can be NULL */ @@ -283,7 +283,7 @@ void SwTextShell::Execute(SfxRequest &rReq) bool bUseDialog = true; const SfxItemSet *pArgs = rReq.GetArgs(); SwWrtShell& rWrtSh = GetShell(); - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; const sal_uInt16 nSlot = rReq.GetSlot(); if(pArgs) pArgs->GetItemState(GetPool().GetWhich(nSlot), false, &pItem); @@ -473,7 +473,7 @@ void SwTextShell::Execute(SfxRequest &rReq) SvxFontItem aFont( rFont.GetFamily(), pFont->GetValue(), rFont.GetStyleName(), rFont.GetPitch(), RTL_TEXTENCODING_DONTKNOW, RES_CHRATR_FONT ); rWrtSh.SetAttrSet( aSet, SetAttrMode::DONTEXPAND ); - rWrtSh.ResetSelect(0, false); + rWrtSh.ResetSelect(nullptr, false); rWrtSh.EndSelect(); rWrtSh.GotoFootnoteText(); } @@ -900,11 +900,11 @@ void SwTextShell::Execute(SfxRequest &rReq) } case SID_PARA_DLG: { - SwPaM* pPaM = NULL; + SwPaM* pPaM = nullptr; if ( pArgs ) { - const SfxPoolItem* pPaMItem = 0; + const SfxPoolItem* pPaMItem = nullptr; pArgs->GetItemState( GetPool().GetWhich( FN_PARAM_PAM ), false, &pPaMItem ); if ( pPaMItem ) pPaM = static_cast< const SwPaMItem* >( pPaMItem )->GetValue( ); @@ -1006,10 +1006,10 @@ void SwTextShell::Execute(SfxRequest &rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - pDlg.reset(pFact->CreateSwParaDlg( GetView().GetWindow(),GetView(), aCoreSet, DLG_STD, NULL, false, sDefPage )); + pDlg.reset(pFact->CreateSwParaDlg( GetView().GetWindow(),GetView(), aCoreSet, DLG_STD, nullptr, false, sDefPage )); OSL_ENSURE(pDlg, "Dialog creation failed!"); } - SfxItemSet* pSet = NULL; + SfxItemSet* pSet = nullptr; if ( !bUseDialog ) { if ( nSlot == SID_ATTR_PARA_LRSPACE) @@ -1526,7 +1526,7 @@ void SwTextShell::GetState( SfxItemSet &rSet ) { const FrmTypeFlags nNoType = FrmTypeFlags::FLY_ANY | FrmTypeFlags::HEADER | FrmTypeFlags::FOOTER | FrmTypeFlags::FOOTNOTE; - if ( rSh.GetFrmType(0,true) & nNoType ) + if ( rSh.GetFrmType(nullptr,true) & nNoType ) rSet.DisableItem(nWhich); if ( rSh.CrsrInsideInputField() ) @@ -1549,7 +1549,7 @@ void SwTextShell::GetState( SfxItemSet &rSet ) case FN_INSERT_TABLE: if ( rSh.CrsrInsideInputField() || rSh.GetTableFormat() - || (rSh.GetFrmType(0,true) & FrmTypeFlags::FOOTNOTE) ) + || (rSh.GetFrmType(nullptr,true) & FrmTypeFlags::FOOTNOTE) ) { rSet.DisableItem( nWhich ); } @@ -1708,7 +1708,7 @@ void SwTextShell::GetState( SfxItemSet &rSet ) } else { - rSet.Put(SfxBoolItem( nWhich, 0 != GetView().GetViewFrame()->GetChildWindow( nWhich ) )); + rSet.Put(SfxBoolItem( nWhich, nullptr != GetView().GetViewFrame()->GetChildWindow( nWhich ) )); } break; diff --git a/sw/source/uibase/shells/textsh2.cxx b/sw/source/uibase/shells/textsh2.cxx index fddb21522455..6d2ccb2dd468 100644 --- a/sw/source/uibase/shells/textsh2.cxx +++ b/sw/source/uibase/shells/textsh2.cxx @@ -90,12 +90,12 @@ void SwTextShell::ExecDB(SfxRequest &rReq) OUString sSourceArg, sCommandArg; sal_Int32 nCommandTypeArg = 0; - const SfxPoolItem* pSourceItem = 0; - const SfxPoolItem* pCursorItem = 0; - const SfxPoolItem* pConnectionItem = 0; - const SfxPoolItem* pCommandItem = 0; - const SfxPoolItem* pCommandTypeItem = 0; - const SfxPoolItem* pSelectionItem = 0; + const SfxPoolItem* pSourceItem = nullptr; + const SfxPoolItem* pCursorItem = nullptr; + const SfxPoolItem* pConnectionItem = nullptr; + const SfxPoolItem* pCommandItem = nullptr; + const SfxPoolItem* pCommandTypeItem = nullptr; + const SfxPoolItem* pSelectionItem = nullptr; // first get the selection of rows to be inserted pArgs->GetItemState(FN_DB_DATA_SELECTION_ANY, false, &pSelectionItem); @@ -187,8 +187,8 @@ void SwTextShell::ExecDB(SfxRequest &rReq) case FN_QRY_INSERT_FIELD: { - const SfxPoolItem* pColumnItem = 0; - const SfxPoolItem* pColumnNameItem = 0; + const SfxPoolItem* pColumnItem = nullptr; + const SfxPoolItem* pColumnNameItem = nullptr; pArgs->GetItemState(FN_DB_COLUMN_ANY, false, &pColumnItem); pArgs->GetItemState(FN_DB_DATA_COLUMN_NAME_ANY, false, &pColumnNameItem); diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx index ddd1de7e8288..55aae8590a50 100644 --- a/sw/source/uibase/shells/txtattr.cxx +++ b/sw/source/uibase/shells/txtattr.cxx @@ -171,16 +171,16 @@ void SwTextShell::ExecCharAttrArgs(SfxRequest &rReq) { sal_uInt16 nSlot = rReq.GetSlot(); const SfxItemSet* pArgs = rReq.GetArgs(); - bool bArgs = pArgs != 0 && pArgs->Count() > 0; + bool bArgs = pArgs != nullptr && pArgs->Count() > 0; SwWrtShell& rWrtSh = GetShell(); - SwTextFormatColl* pColl = 0; + SwTextFormatColl* pColl = nullptr; // Is only set if the whole paragraph is selected and AutoUpdateFormat is set. if (rWrtSh.HasSelection() && rWrtSh.IsSelFullPara()) { pColl = rWrtSh.GetCurTextFormatColl(); if ( pColl && !pColl->IsAutoUpdateFormat() ) - pColl = 0; + pColl = nullptr; } SfxItemPool& rPool = GetPool(); sal_uInt16 nWhich = rPool.GetWhich( nSlot ); @@ -389,7 +389,7 @@ SET_LINESPACE: else if(SVX_ADJUST_RIGHT == aFormat.GetNumAdjust()) aFormat.SetNumAdjust( SVX_ADJUST_LEFT ); - aRule.SetLevel(i, aFormat, aRule.Get(i) != 0); + aRule.SetLevel(i, aFormat, aRule.Get(i) != nullptr); } SwNumRule aSetRule( pCurRule->GetName(), pCurRule->Get( 0 ).GetPositionAndSpaceMode() ); @@ -421,7 +421,7 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq) { SwWrtShell &rSh = GetShell(); const SfxItemSet *pArgs = rReq.GetArgs(); - const SfxPoolItem *pItem = 0; + const SfxPoolItem *pItem = nullptr; sal_uInt16 nSlot = rReq.GetSlot(); if(pArgs) @@ -435,7 +435,7 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq) SfxItemSet aSet(GetPool(), RES_PARATR_DROP, RES_PARATR_DROP, 0L); rSh.GetCurAttr(aSet); SwFormatDrop aDropItem(static_cast<const SwFormatDrop&>(aSet.Get(RES_PARATR_DROP))); - SwCharFormat* pFormat = 0; + SwCharFormat* pFormat = nullptr; if(!sCharStyleName.isEmpty()) pFormat = rSh.FindCharFormatByName( sCharStyleName ); aDropItem.SetCharFormat( pFormat ); @@ -519,7 +519,7 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet) sal_uInt16 nSlot = aIter.FirstWhich(); bool bFlag = false; SfxBoolItem aFlagItem; - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; int eAdjust = -1; // Illegal value to recognize DONTCARE. SfxItemState eState = aCoreSet.GetItemState(RES_PARATR_ADJUST, false, &pItem); diff --git a/sw/source/uibase/shells/txtcrsr.cxx b/sw/source/uibase/shells/txtcrsr.cxx index 6ed39e5740b8..1d85bfbd188b 100644 --- a/sw/source/uibase/shells/txtcrsr.cxx +++ b/sw/source/uibase/shells/txtcrsr.cxx @@ -318,11 +318,11 @@ void SwTextShell::ExecMoveMisc(SfxRequest &rReq) case SID_FM_TOGGLECONTROLFOCUS: { const SwDoc* pDoc = rSh.GetDoc(); - const SwDocShell* pDocShell = pDoc ? pDoc->GetDocShell() : NULL; - const SwView* pView = pDocShell ? pDocShell->GetView() : NULL; - const FmFormShell* pFormShell = pView ? pView->GetFormShell() : NULL; - SdrView* pDrawView = pView ? pView->GetDrawView() : NULL; - vcl::Window* pWindow = pView ? pView->GetWrtShell().GetWin() : NULL; + const SwDocShell* pDocShell = pDoc ? pDoc->GetDocShell() : nullptr; + const SwView* pView = pDocShell ? pDocShell->GetView() : nullptr; + const FmFormShell* pFormShell = pView ? pView->GetFormShell() : nullptr; + SdrView* pDrawView = pView ? pView->GetDrawView() : nullptr; + vcl::Window* pWindow = pView ? pView->GetWrtShell().GetWin() : nullptr; OSL_ENSURE( pFormShell && pDrawView && pWindow, "SwXTextView::ExecMoveMisc: no chance!" ); if ( !pFormShell || !pDrawView || !pWindow ) @@ -363,7 +363,7 @@ void SwTextShell::ExecMoveMisc(SfxRequest &rReq) break; case FN_TO_HEADER: rSh.MoveCrsr(); - if ( FrmTypeFlags::HEADER & rSh.GetFrmType(0,false) ) + if ( FrmTypeFlags::HEADER & rSh.GetFrmType(nullptr,false) ) rSh.SttPg(); else { @@ -375,7 +375,7 @@ void SwTextShell::ExecMoveMisc(SfxRequest &rReq) break; case FN_TO_FOOTER: rSh.MoveCrsr(); - if ( FrmTypeFlags::FOOTER & rSh.GetFrmType(0,false) ) + if ( FrmTypeFlags::FOOTER & rSh.GetFrmType(nullptr,false) ) rSh.EndPg(); else { @@ -387,7 +387,7 @@ void SwTextShell::ExecMoveMisc(SfxRequest &rReq) break; case FN_FOOTNOTE_TO_ANCHOR: rSh.MoveCrsr(); - if ( FrmTypeFlags::FOOTNOTE & rSh.GetFrmType(0,false) ) + if ( FrmTypeFlags::FOOTNOTE & rSh.GetFrmType(nullptr,false) ) rSh.GotoFootnoteAnchor(); else rSh.GotoFootnoteText(); diff --git a/sw/source/uibase/shells/txtnum.cxx b/sw/source/uibase/shells/txtnum.cxx index 1db6124b9e3a..acebe2535ad3 100644 --- a/sw/source/uibase/shells/txtnum.cxx +++ b/sw/source/uibase/shells/txtnum.cxx @@ -116,7 +116,7 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) SwDocShell* pDocSh = GetView().GetDocShell(); const bool bHtml = dynamic_cast<SwWebDocShell*>( pDocSh ) != nullptr; const SwNumRule* pNumRuleAtCurrentSelection = GetShell().GetNumRuleAtCurrentSelection(); - if ( pNumRuleAtCurrentSelection != NULL ) + if ( pNumRuleAtCurrentSelection != nullptr ) { SvxNumRule aRule = pNumRuleAtCurrentSelection->MakeSvxNumRule(); @@ -129,7 +129,7 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) const SvxBrushItem* pBrush = aFormat.GetBrush(); if(pBrush && !pBrush->GetGraphicLink().isEmpty()) aFormat.SetNumberingType(SvxExtNumType(SVX_NUM_BITMAP|LINK_TOKEN)); - aRule.SetLevel(i, aFormat, aRule.Get(i) != 0); + aRule.SetLevel(i, aFormat, aRule.Get(i) != nullptr); } } if(bHtml) @@ -199,7 +199,7 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) rReq.Done(); SvxNumRule* pSetRule = static_cast<const SvxNumBulletItem*>( pItem )->GetNumRule(); pSetRule->UnLinkGraphics(); - SwNumRule aSetRule( pNumRuleAtCurrentSelection != NULL + SwNumRule aSetRule( pNumRuleAtCurrentSelection != nullptr ? pNumRuleAtCurrentSelection->GetName() : GetShell().GetUniqueNumRuleName(), numfunc::GetDefaultPositionAndSpaceMode() ); @@ -207,12 +207,12 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) aSetRule.SetAutoRule( true ); // No start of new list, if an existing list style is edited. // Otherwise start a new list. - const bool bCreateList = ( pNumRuleAtCurrentSelection == NULL ); + const bool bCreateList = ( pNumRuleAtCurrentSelection == nullptr ); GetShell().SetCurNumRule( aSetRule, bCreateList ); } // If the Dialog was leaved with OK but nothing was chosen then the // numbering must be at least activated, if it is not already. - else if ( pNumRuleAtCurrentSelection == NULL + else if ( pNumRuleAtCurrentSelection == nullptr && SfxItemState::SET == aSet.GetItemState( SID_ATTR_NUMBERING_RULE, false, &pItem ) ) { rReq.AppendItem( *pItem ); @@ -248,18 +248,18 @@ void SwTextShell::ExecSetNumber(SfxRequest &rReq) case FN_SVX_SET_BULLET: { const SfxUInt16Item* pItem = rReq.GetArg<SfxUInt16Item>(nSlot); - if ( pItem != NULL ) + if ( pItem != nullptr ) { const sal_uInt16 nChoosenItemIdx = pItem->GetValue(); svx::sidebar::NBOTypeMgrBase* pNBOTypeMgr = nSlot == FN_SVX_SET_NUMBER ? svx::sidebar::NBOutlineTypeMgrFact::CreateInstance( svx::sidebar::eNBOType::NUMBERING ) : svx::sidebar::NBOutlineTypeMgrFact::CreateInstance( svx::sidebar::eNBOType::BULLETS ); - if ( pNBOTypeMgr != NULL ) + if ( pNBOTypeMgr != nullptr ) { const SwNumRule* pNumRuleAtCurrentSelection = GetShell().GetNumRuleAtCurrentSelection(); sal_uInt16 nActNumLvl = USHRT_MAX; - if ( pNumRuleAtCurrentSelection != NULL ) + if ( pNumRuleAtCurrentSelection != nullptr ) { const sal_uInt16 nLevel = GetShell().GetNumLevel(); if ( nLevel < MAXLEVEL ) @@ -268,9 +268,9 @@ void SwTextShell::ExecSetNumber(SfxRequest &rReq) } } SwNumRule aNewNumRule( - pNumRuleAtCurrentSelection != NULL ? pNumRuleAtCurrentSelection->GetName() : GetShell().GetUniqueNumRuleName(), + pNumRuleAtCurrentSelection != nullptr ? pNumRuleAtCurrentSelection->GetName() : GetShell().GetUniqueNumRuleName(), numfunc::GetDefaultPositionAndSpaceMode() ); - SvxNumRule aNewSvxNumRule = pNumRuleAtCurrentSelection != NULL + SvxNumRule aNewSvxNumRule = pNumRuleAtCurrentSelection != nullptr ? pNumRuleAtCurrentSelection->MakeSvxNumRule() : aNewNumRule.MakeSvxNumRule(); // set unit attribute to NB Manager @@ -281,7 +281,7 @@ void SwTextShell::ExecSetNumber(SfxRequest &rReq) aNewNumRule.SetSvxRule( aNewSvxNumRule, GetShell().GetDoc() ); aNewNumRule.SetAutoRule( true ); - const bool bCreateNewList = ( pNumRuleAtCurrentSelection == NULL ); + const bool bCreateNewList = ( pNumRuleAtCurrentSelection == nullptr ); GetShell().SetCurNumRule( aNewNumRule, bCreateNewList ); } } |