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/core/attr | |
parent | 6cd7bf2043146a630925a2e49336f02c802f707a (diff) |
loplugin:nullptr (automatic rewrite)
Change-Id: I01e11fa956a249974e77dce9deebe79311f098d0
Diffstat (limited to 'sw/source/core/attr')
-rw-r--r-- | sw/source/core/attr/cellatr.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/attr/format.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/attr/hints.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/attr/swatrset.cxx | 40 |
4 files changed, 39 insertions, 39 deletions
diff --git a/sw/source/core/attr/cellatr.cxx b/sw/source/core/attr/cellatr.cxx index 177f66a2c25e..9df9a1c520d3 100644 --- a/sw/source/core/attr/cellatr.cxx +++ b/sw/source/core/attr/cellatr.cxx @@ -51,7 +51,7 @@ SfxPoolItem* SwTableBoxNumFormat::Clone( SfxItemPool* ) const SwTableBoxFormula::SwTableBoxFormula( const OUString& rFormula ) : SfxPoolItem( RES_BOXATR_FORMULA ), SwTableFormula( rFormula ), - pDefinedIn( 0 ) + pDefinedIn( nullptr ) { } @@ -79,7 +79,7 @@ SfxPoolItem* SwTableBoxFormula::Clone( SfxItemPool* ) const */ const SwNode* SwTableBoxFormula::GetNodeOfFormula() const { - const SwNode* pRet = 0; + const SwNode* pRet = nullptr; if( pDefinedIn ) { SwTableBox* pBox = SwIterator<SwTableBox,SwModify>( *pDefinedIn ).First(); @@ -91,7 +91,7 @@ const SwNode* SwTableBoxFormula::GetNodeOfFormula() const SwTableBox* SwTableBoxFormula::GetTableBox() { - SwTableBox* pBox = 0; + SwTableBox* pBox = nullptr; if( pDefinedIn ) pBox = SwIterator<SwTableBox,SwModify>( *pDefinedIn ).First(); return pBox; @@ -116,7 +116,7 @@ void SwTableBoxFormula::ChangeState( const SfxPoolItem* pItem ) const SwTableNode* pTableNd; const SwNode* pNd = GetNodeOfFormula(); if( pNd && &pNd->GetNodes() == &pNd->GetDoc()->GetNodes() && - 0 != ( pTableNd = pNd->FindTableNode() )) + nullptr != ( pTableNd = pNd->FindTableNode() )) { switch( pUpdateField->m_eFlags ) { diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx index ad99ba98ef58..580b2c623ecd 100644 --- a/sw/source/core/attr/format.cxx +++ b/sw/source/core/attr/format.cxx @@ -140,7 +140,7 @@ SwFormat &SwFormat::operator=(const SwFormat& rFormat) } else { - m_aSet.SetParent( 0 ); + m_aSet.SetParent( nullptr ); } } m_bAutoFormat = rFormat.m_bAutoFormat; @@ -281,7 +281,7 @@ void SwFormat::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValu { // otherwise de-register at least from dying one DerivedFrom()->Remove( this ); - m_aSet.SetParent( 0 ); + m_aSet.SetParent( nullptr ); } } } @@ -311,7 +311,7 @@ void SwFormat::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValu static_cast<const SwFormatChg*>(pNewValue)->pChangedFormat == GetRegisteredIn() ) { // attach Set to new parent - m_aSet.SetParent( DerivedFrom() ? &DerivedFrom()->m_aSet : 0 ); + m_aSet.SetParent( DerivedFrom() ? &DerivedFrom()->m_aSet : nullptr ); } break; case RES_RESET_FMTWRITTEN: @@ -351,7 +351,7 @@ bool SwFormat::SetDerivedFrom(SwFormat *pDerFrom) if ( pDerFrom ) { const SwFormat* pFormat = pDerFrom; - while ( pFormat != 0 ) + while ( pFormat != nullptr ) { if ( pFormat == this ) return false; @@ -443,7 +443,7 @@ SfxItemState SwFormat::GetItemState( sal_uInt16 nWhich, bool bSrchInParent, cons // if not, reset pointer and return SfxItemState::DEFAULT to signal that // the item is not set if( ppItem ) - *ppItem = NULL; + *ppItem = nullptr; return SfxItemState::DEFAULT; } @@ -472,7 +472,7 @@ SfxItemState SwFormat::GetBackgroundState(SvxBrushItem &rItem, bool bSrchInParen return SfxItemState::DEFAULT; } - const SfxPoolItem* pItem = 0; + const SfxPoolItem* pItem = nullptr; SfxItemState eRet = m_aSet.GetItemState(RES_BACKGROUND, bSrchInParent, &pItem); if (pItem) rItem = *static_cast<const SvxBrushItem*>(pItem); @@ -537,7 +537,7 @@ bool SwFormat::SetFormatAttr( const SfxPoolItem& rAttr ) (RES_GRFFMTCOLL == nFormatWhich || RES_TXTFMTCOLL == nFormatWhich ) ) ) { - if( ( bRet = (0 != m_aSet.Put( rAttr ))) ) + if( ( bRet = (nullptr != m_aSet.Put( rAttr ))) ) m_aSet.SetModifyAtAttr( this ); // #i71574# if ( nFormatWhich == RES_TXTFMTCOLL && rAttr.Which() == RES_PARATR_NUMRULE ) @@ -593,7 +593,7 @@ bool SwFormat::SetFormatAttr( const SfxItemSet& rSet ) if (supportsFullDrawingLayerFillAttributeSet()) { - const SfxPoolItem* pSource = 0; + const SfxPoolItem* pSource = nullptr; if(SfxItemState::SET == aTempSet.GetItemState(RES_BACKGROUND, false, &pSource)) { diff --git a/sw/source/core/attr/hints.cxx b/sw/source/core/attr/hints.cxx index 47d25a70e3ea..04176ba1e703 100644 --- a/sw/source/core/attr/hints.cxx +++ b/sw/source/core/attr/hints.cxx @@ -63,16 +63,16 @@ SwDocPosUpdate::SwDocPosUpdate( const SwTwips nDcPos ) SwTableFormulaUpdate::SwTableFormulaUpdate( const SwTable* pNewTable ) : SwMsgPoolItem( RES_TABLEFML_UPDATE ), - m_pTable( pNewTable ), m_pHistory( 0 ), m_nSplitLine( USHRT_MAX ), + m_pTable( pNewTable ), m_pHistory( nullptr ), m_nSplitLine( USHRT_MAX ), m_eFlags( TBL_CALC ) { - m_aData.pDelTable = 0; + m_aData.pDelTable = nullptr; m_bModified = m_bBehindSplitLine = false; OSL_ENSURE( m_pTable, "No Table pointer" ); } SwAutoFormatGetDocNode::SwAutoFormatGetDocNode( const SwNodes* pNds ) - : SwMsgPoolItem( RES_AUTOFMT_DOCNODE ), pContentNode( 0 ), pNodes( pNds ) + : SwMsgPoolItem( RES_AUTOFMT_DOCNODE ), pContentNode( nullptr ), pNodes( pNds ) { } @@ -120,7 +120,7 @@ bool SwMsgPoolItem::operator==( const SfxPoolItem& ) const SfxPoolItem* SwMsgPoolItem::Clone( SfxItemPool* ) const { OSL_FAIL( "SwMsgPoolItem knows no Clone" ); - return 0; + return nullptr; } #if OSL_DEBUG_LEVEL > 0 @@ -145,12 +145,12 @@ SwCondCollCondChg::SwCondCollCondChg( SwFormat *pFormat ) } SwVirtPageNumInfo::SwVirtPageNumInfo( const SwPageFrm *pPg ) : - SwMsgPoolItem( RES_VIRTPAGENUM_INFO ), m_pPage( 0 ), m_pOrigPage( pPg ), m_pFrm( 0 ) + SwMsgPoolItem( RES_VIRTPAGENUM_INFO ), m_pPage( nullptr ), m_pOrigPage( pPg ), m_pFrm( nullptr ) { } SwFindNearestNode::SwFindNearestNode( const SwNode& rNd ) - : SwMsgPoolItem( RES_FINDNEARESTNODE ), m_pNode( &rNd ), m_pFound( 0 ) + : SwMsgPoolItem( RES_FINDNEARESTNODE ), m_pNode( &rNd ), m_pFound( nullptr ) { } @@ -213,7 +213,7 @@ sal_uInt16 GetWhichOfScript( sal_uInt16 nWhich, sal_uInt16 nScript ) break; default: - pM = 0; + pM = nullptr; } sal_uInt16 nRet; diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx index d2f906fcc885..2f88ebf0bed3 100644 --- a/sw/source/core/attr/swatrset.cxx +++ b/sw/source/core/attr/swatrset.cxx @@ -136,8 +136,8 @@ void SwAttrPool::removeAndDeleteSecondaryPools() // first delete the items, then break the linking pSdrPool->Delete(); - SetSecondaryPool(0); - pSdrPool->SetSecondaryPool(0); + SetSecondaryPool(nullptr); + pSdrPool->SetSecondaryPool(nullptr); // final cleanup of secondary pool(s) SfxItemPool::Free(pSdrPool); @@ -145,17 +145,17 @@ void SwAttrPool::removeAndDeleteSecondaryPools() } SwAttrSet::SwAttrSet( SwAttrPool& rPool, sal_uInt16 nWh1, sal_uInt16 nWh2 ) - : SfxItemSet( rPool, nWh1, nWh2 ), m_pOldSet( 0 ), m_pNewSet( 0 ) + : SfxItemSet( rPool, nWh1, nWh2 ), m_pOldSet( nullptr ), m_pNewSet( nullptr ) { } SwAttrSet::SwAttrSet( SwAttrPool& rPool, const sal_uInt16* nWhichPairTable ) - : SfxItemSet( rPool, nWhichPairTable ), m_pOldSet( 0 ), m_pNewSet( 0 ) + : SfxItemSet( rPool, nWhichPairTable ), m_pOldSet( nullptr ), m_pNewSet( nullptr ) { } SwAttrSet::SwAttrSet( const SwAttrSet& rSet ) - : SfxItemSet( rSet ), m_pOldSet( 0 ), m_pNewSet( 0 ) + : SfxItemSet( rSet ), m_pOldSet( nullptr ), m_pNewSet( nullptr ) { } @@ -164,7 +164,7 @@ SfxItemSet* SwAttrSet::Clone( bool bItems, SfxItemPool *pToPool ) const if ( pToPool && pToPool != GetPool() ) { SwAttrPool* pAttrPool = dynamic_cast< SwAttrPool* >(pToPool); - SfxItemSet* pTmpSet = 0; + SfxItemSet* pTmpSet = nullptr; if ( !pAttrPool ) pTmpSet = SfxItemSet::Clone( bItems, pToPool ); else @@ -196,8 +196,8 @@ bool SwAttrSet::Put_BC( const SfxPoolItem& rAttr, { m_pNewSet = pNew; m_pOldSet = pOld; - bool bRet = 0 != SfxItemSet::Put( rAttr ); - m_pOldSet = m_pNewSet = 0; + bool bRet = nullptr != SfxItemSet::Put( rAttr ); + m_pOldSet = m_pNewSet = nullptr; return bRet; } @@ -207,7 +207,7 @@ bool SwAttrSet::Put_BC( const SfxItemSet& rSet, m_pNewSet = pNew; m_pOldSet = pOld; bool bRet = SfxItemSet::Put( rSet ); - m_pOldSet = m_pNewSet = 0; + m_pOldSet = m_pNewSet = nullptr; return bRet; } @@ -217,7 +217,7 @@ sal_uInt16 SwAttrSet::ClearItem_BC( sal_uInt16 nWhich, m_pNewSet = pNew; m_pOldSet = pOld; sal_uInt16 nRet = SfxItemSet::ClearItem( nWhich ); - m_pOldSet = m_pNewSet = 0; + m_pOldSet = m_pNewSet = nullptr; return nRet; } @@ -230,7 +230,7 @@ sal_uInt16 SwAttrSet::ClearItem_BC( sal_uInt16 nWhich1, sal_uInt16 nWhich2, sal_uInt16 nRet = 0; for( ; nWhich1 <= nWhich2; ++nWhich1 ) nRet = nRet + SfxItemSet::ClearItem( nWhich1 ); - m_pOldSet = m_pNewSet = 0; + m_pOldSet = m_pNewSet = nullptr; return nRet; } @@ -240,7 +240,7 @@ int SwAttrSet::Intersect_BC( const SfxItemSet& rSet, m_pNewSet = pNew; m_pOldSet = pOld; SfxItemSet::Intersect( rSet ); - m_pOldSet = m_pNewSet = 0; + m_pOldSet = m_pNewSet = nullptr; return pNew ? pNew->Count() : ( pOld ? pOld->Count() : 0 ); } @@ -279,7 +279,7 @@ bool SwAttrSet::SetModifyAtAttr( const SwModify* pModify ) // If CharFormat is set and it is set in different attribute pools then // the CharFormat has to be copied. SwCharFormat* pCharFormat; - if( 0 != ( pCharFormat = const_cast<SwFormatDrop*>(static_cast<const SwFormatDrop*>(pItem))->GetCharFormat() ) + if( nullptr != ( pCharFormat = const_cast<SwFormatDrop*>(static_cast<const SwFormatDrop*>(pItem))->GetCharFormat() ) && GetPool() != pCharFormat->GetAttrSet().GetPool() ) { pCharFormat = GetDoc()->CopyCharFormat( *pCharFormat ); @@ -310,7 +310,7 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const if( Count() ) { // #i92811# - SfxStringItem* pNewListIdItem( 0 ); + SfxStringItem* pNewListIdItem( nullptr ); const SfxPoolItem* pItem; const SwDoc *pSrcDoc = GetDoc(); @@ -371,7 +371,7 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const } // check again, if list exist, because <SwDoc::MakeNumRule(..)> // could have also created it. - if ( pNewListIdItem == 0 && + if ( pNewListIdItem == nullptr && !pDstDoc->getIDocumentListsAccess().getListByName( sListId ) ) { // copy list @@ -385,7 +385,7 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const const SwPageDesc* pPgDesc; if( pSrcDoc != pDstDoc && SfxItemState::SET == GetItemState( RES_PAGEDESC, false, &pItem ) && - 0 != ( pPgDesc = static_cast<const SwFormatPageDesc*>(pItem)->GetPageDesc()) ) + nullptr != ( pPgDesc = static_cast<const SwFormatPageDesc*>(pItem)->GetPageDesc()) ) { if( !tmpSet ) tmpSet.reset( new SfxItemSet( *this )); @@ -402,7 +402,7 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const } if( pSrcDoc != pDstDoc && SfxItemState::SET == GetItemState( RES_ANCHOR, false, &pItem ) - && static_cast< const SwFormatAnchor* >( pItem )->GetContentAnchor() != NULL ) + && static_cast< const SwFormatAnchor* >( pItem )->GetContentAnchor() != nullptr ) { if( !tmpSet ) tmpSet.reset( new SfxItemSet( *this )); @@ -416,7 +416,7 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const if( pCNd ) { // #i92811# - if ( pNewListIdItem != 0 ) + if ( pNewListIdItem != nullptr ) { tmpSet->Put( *pNewListIdItem ); } @@ -430,7 +430,7 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const else if( pCNd ) { // #i92811# - if ( pNewListIdItem != 0 ) + if ( pNewListIdItem != nullptr ) { SfxItemSet aTmpSet( *this ); aTmpSet.Put( *pNewListIdItem ); @@ -448,7 +448,7 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const // #i92811# delete pNewListIdItem; - pNewListIdItem = 0; + pNewListIdItem = nullptr; } } #if OSL_DEBUG_LEVEL > 0 |