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/fldui/fldmgr.cxx | |
parent | 6cd7bf2043146a630925a2e49336f02c802f707a (diff) |
loplugin:nullptr (automatic rewrite)
Change-Id: I01e11fa956a249974e77dce9deebe79311f098d0
Diffstat (limited to 'sw/source/uibase/fldui/fldmgr.cxx')
-rw-r--r-- | sw/source/uibase/fldui/fldmgr.cxx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx index fa6ecca7d6d8..cd0c9a0a9d18 100644 --- a/sw/source/uibase/fldui/fldmgr.cxx +++ b/sw/source/uibase/fldui/fldmgr.cxx @@ -207,18 +207,18 @@ static const SwFieldPack aSwFields[] = static SwWrtShell* lcl_GetShell() { SwView* pView; - if ( 0 != (pView = ::GetActiveView()) ) + if ( nullptr != (pView = ::GetActiveView()) ) return pView->GetWrtShellPtr(); OSL_FAIL("no current shell found!"); - return 0; + return nullptr; } inline sal_uInt16 GetPackCount() { return sizeof(aSwFields) / sizeof(SwFieldPack); } // FieldManager controls inserting and updating of fields SwFieldMgr::SwFieldMgr(SwWrtShell* pSh ) : - pModule(0), - pMacroItem(0), + pModule(nullptr), + pMacroItem(nullptr), pWrtShell(pSh), bEvalExp(true) { @@ -244,7 +244,7 @@ bool SwFieldMgr::CanInsertRefMark( const OUString& rStr ) if( 1 < nCnt && !pSh->SwCrsrShell::HasSelection() ) --nCnt; - bRet = 2 > nCnt && 0 == pSh->GetRefMark( rStr ); + bRet = 2 > nCnt && nullptr == pSh->GetRefMark( rStr ); } return bRet; } @@ -269,14 +269,14 @@ SwFieldType* SwFieldMgr::GetFieldType(sal_uInt16 nResId, size_t nField) const { SwWrtShell * pSh = pWrtShell ? pWrtShell : lcl_GetShell(); OSL_ENSURE(pSh, "no SwWrtShell found"); - return pSh ? pSh->GetFieldType(nField, nResId) : 0; + return pSh ? pSh->GetFieldType(nField, nResId) : nullptr; } SwFieldType* SwFieldMgr::GetFieldType(sal_uInt16 nResId, const OUString& rName) const { SwWrtShell * pSh = pWrtShell ? pWrtShell : lcl_GetShell(); OSL_ENSURE(pSh, "no SwWrtShell found"); - return pSh ? pSh->GetFieldType(nResId, rName) : 0; + return pSh ? pSh->GetFieldType(nResId, rName) : nullptr; } // determine current field @@ -286,7 +286,7 @@ SwField* SwFieldMgr::GetCurField() if ( pSh ) pCurField = pSh->GetCurField( true ); else - pCurField = NULL; + pCurField = nullptr; // initialise strings and format aCurPar1.clear(); @@ -295,7 +295,7 @@ SwField* SwFieldMgr::GetCurField() nCurFormat = 0; if(!pCurField) - return 0; + return nullptr; // preprocess current values; determine parameter 1 and parameter 2 // as well as the format @@ -731,7 +731,7 @@ bool SwFieldMgr::GoNextPrev( bool bNext, SwFieldType* pTyp ) if (pTyp && pTyp->Which() == RES_DBFLD) { // for fieldcommand-edit (hop to all DB fields) - return pSh->MoveFieldType( 0, bNext, RES_DBFLD ); + return pSh->MoveFieldType( nullptr, bNext, RES_DBFLD ); } return pTyp && pSh && pSh->MoveFieldType( pTyp, bNext ); @@ -756,7 +756,7 @@ sal_uInt16 SwFieldMgr::GetCurTypeId() const bool SwFieldMgr::InsertField( const SwInsertField_Data& rData) { - SwField* pField = 0; + SwField* pField = nullptr; bool bExp = false; bool bTable = false; bool bPageVar = false; @@ -1255,7 +1255,7 @@ bool SwFieldMgr::InsertField( case TYP_FORMELFLD: { - if(pCurShell->GetFrmType(0,false) & FrmTypeFlags::TABLE) + if(pCurShell->GetFrmType(nullptr,false) & FrmTypeFlags::TABLE) { pCurShell->StartAllAction(); @@ -1349,7 +1349,7 @@ bool SwFieldMgr::InsertField( else if( bPageVar ) static_cast<SwRefPageGetFieldType*>(pCurShell->GetFieldType( 0, RES_REFPAGEGETFLD ))->UpdateFields(); else if( TYP_GETREFFLD == rData.m_nTypeId ) - pField->GetTyp()->ModifyNotification( 0, 0 ); + pField->GetTyp()->ModifyNotification( nullptr, nullptr ); // delete temporary field delete pField; @@ -1369,7 +1369,7 @@ void SwFieldMgr::UpdateCurField(sal_uLong nFormat, bool bDelete = false; SwField *pTmpField; // mb: fixed memory leak - if (NULL != _pTmpField) + if (nullptr != _pTmpField) { pTmpField = _pTmpField; } @@ -1538,7 +1538,7 @@ void SwFieldMgr::UpdateCurField(sal_uLong nFormat, // explicitly evaluate ExpressionFields void SwFieldMgr::EvalExpFields(SwWrtShell* pSh) { - if (pSh == NULL) + if (pSh == nullptr) pSh = pWrtShell ? pWrtShell : ::lcl_GetShell(); if(pSh) |