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/SwNumberTree | |
parent | 6cd7bf2043146a630925a2e49336f02c802f707a (diff) |
loplugin:nullptr (automatic rewrite)
Change-Id: I01e11fa956a249974e77dce9deebe79311f098d0
Diffstat (limited to 'sw/source/core/SwNumberTree')
-rw-r--r-- | sw/source/core/SwNumberTree/SwNodeNum.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/SwNumberTree/SwNumberTree.cxx | 30 |
2 files changed, 21 insertions, 21 deletions
diff --git a/sw/source/core/SwNumberTree/SwNodeNum.cxx b/sw/source/core/SwNumberTree/SwNodeNum.cxx index 14f16ff4946a..5b885a6c3a1a 100644 --- a/sw/source/core/SwNumberTree/SwNodeNum.cxx +++ b/sw/source/core/SwNumberTree/SwNodeNum.cxx @@ -28,13 +28,13 @@ SwNodeNum::SwNodeNum( SwTextNode* pTextNode ) : SwNumberTreeNode(), mpTextNode( pTextNode ), - mpNumRule( 0 ) + mpNumRule( nullptr ) { } SwNodeNum::SwNodeNum( SwNumRule* pNumRule ) : SwNumberTreeNode(), - mpTextNode( 0 ), + mpTextNode( nullptr ), mpNumRule( pNumRule ) { } @@ -118,7 +118,7 @@ void SwNodeNum::PostRemove() { GetNumRule()->RemoveTextNode( *(GetTextNode()) ); } - mpNumRule = 0; + mpNumRule = nullptr; } } @@ -228,9 +228,9 @@ bool SwNodeNum::LessThan(const SwNumberTreeNode & rNode) const bool bResult = false; const SwNodeNum & rTmpNode = static_cast<const SwNodeNum &>(rNode); - if (mpTextNode == NULL && rTmpNode.mpTextNode != NULL) + if (mpTextNode == nullptr && rTmpNode.mpTextNode != nullptr) bResult = true; - else if (mpTextNode != NULL && rTmpNode.mpTextNode != NULL) + else if (mpTextNode != nullptr && rTmpNode.mpTextNode != nullptr) { // #i83479# - refactoring // simplify comparison by comparing the indexes of the text nodes @@ -366,7 +366,7 @@ void SwNodeNum::_UnregisterMeAndChildrenDueToRootDelete( SwNodeNum& rNodeNum ) // #i81002# const SwNodeNum* SwNodeNum::GetPrecedingNodeNumOf( const SwTextNode& rTextNode ) const { - const SwNodeNum* pPrecedingNodeNum( 0 ); + const SwNodeNum* pPrecedingNodeNum( nullptr ); // #i83479# SwNodeNum aNodeNumForTextNode( const_cast<SwTextNode*>(&rTextNode) ); diff --git a/sw/source/core/SwNumberTree/SwNumberTree.cxx b/sw/source/core/SwNumberTree/SwNumberTree.cxx index 80151ff79fb2..459cf5425718 100644 --- a/sw/source/core/SwNumberTree/SwNumberTree.cxx +++ b/sw/source/core/SwNumberTree/SwNumberTree.cxx @@ -27,7 +27,7 @@ using std::find; SwNumberTreeNode::SwNumberTreeNode() : mChildren(), - mpParent( 0 ), + mpParent( nullptr ), mnNumber( 0 ), mbContinueingPreviousSubTree( false ), mbPhantom( false ), @@ -53,7 +53,7 @@ SwNumberTreeNode::~SwNumberTreeNode() } } - OSL_ENSURE( IsPhantom() || mpParent == NULL, ": I'm not supposed to have a parent."); + OSL_ENSURE( IsPhantom() || mpParent == nullptr, ": I'm not supposed to have a parent."); mpParent = reinterpret_cast<SwNumberTreeNode *>(0xdeadbeef); @@ -62,7 +62,7 @@ SwNumberTreeNode::~SwNumberTreeNode() SwNumberTreeNode * SwNumberTreeNode::CreatePhantom() { - SwNumberTreeNode * pNew = NULL; + SwNumberTreeNode * pNew = nullptr; if (! mChildren.empty() && (*mChildren.begin())->IsPhantom()) @@ -83,7 +83,7 @@ SwNumberTreeNode * SwNumberTreeNode::CreatePhantom() OSL_FAIL("insert of phantom failed!"); delete pNew; - pNew = NULL; + pNew = nullptr; } } @@ -404,7 +404,7 @@ void SwNumberTreeNode::MoveChildren(SwNumberTreeNode * pDest) if (pMyFirst->IsPhantom()) { - SwNumberTreeNode * pDestLast = NULL; + SwNumberTreeNode * pDestLast = nullptr; if (pDest->mChildren.empty()) pDestLast = pDest->CreatePhantom(); @@ -471,7 +471,7 @@ void SwNumberTreeNode::AddChild( SwNumberTreeNode * pChild, return; } - if ( pChild->GetParent() != NULL || pChild->GetChildCount() > 0 ) + if ( pChild->GetParent() != nullptr || pChild->GetChildCount() > 0 ) { OSL_FAIL("only orphans allowed."); return; @@ -616,7 +616,7 @@ void SwNumberTreeNode::RemoveChild(SwNumberTreeNode * pChild) { SwNumberTreeNode * pRemove = *aRemoveIt; - pRemove->mpParent = NULL; + pRemove->mpParent = nullptr; tSwNumberTreeChildren::const_iterator aItPred = mChildren.end(); @@ -965,9 +965,9 @@ bool SwNumberTreeNodeLessThan(const SwNumberTreeNode * pA, { bool bResult = false; - if (pA == NULL && pB != NULL) + if (pA == nullptr && pB != nullptr) bResult = true; - else if (pA != NULL && pB != NULL) + else if (pA != nullptr && pB != nullptr) bResult = pA->LessThan(*pB); return bResult; @@ -975,7 +975,7 @@ bool SwNumberTreeNodeLessThan(const SwNumberTreeNode * pA, SwNumberTreeNode * SwNumberTreeNode::GetLastDescendant() const { - SwNumberTreeNode * pResult = NULL; + SwNumberTreeNode * pResult = nullptr; tSwNumberTreeChildren::const_reverse_iterator aIt = mChildren.rbegin(); if (aIt != mChildren.rend()) @@ -996,7 +996,7 @@ bool SwNumberTreeNode::LessThan(const SwNumberTreeNode & rTreeNode) const SwNumberTreeNode * SwNumberTreeNode::GetPred(bool bSibling) const { - SwNumberTreeNode * pResult = NULL; + SwNumberTreeNode * pResult = nullptr; if (mpParent) { @@ -1007,7 +1007,7 @@ SwNumberTreeNode * SwNumberTreeNode::GetPred(bool bSibling) const { // #i64311# // root node is no valid predecessor - pResult = mpParent->GetParent() ? mpParent : NULL; + pResult = mpParent->GetParent() ? mpParent : nullptr; } else { @@ -1184,7 +1184,7 @@ void SwNumberTreeNode::NotifyInvalidChildren() void SwNumberTreeNode::NotifyInvalidSiblings() { - if (mpParent != NULL) + if (mpParent != nullptr) mpParent->NotifyInvalidChildren(); } @@ -1192,7 +1192,7 @@ void SwNumberTreeNode::NotifyInvalidSiblings() const SwNumberTreeNode* SwNumberTreeNode::GetPrecedingNodeOf( const SwNumberTreeNode& rNode ) const { - const SwNumberTreeNode* pPrecedingNode( 0 ); + const SwNumberTreeNode* pPrecedingNode( nullptr ); if ( GetChildCount() > 0 ) { @@ -1205,7 +1205,7 @@ const SwNumberTreeNode* SwNumberTreeNode::GetPrecedingNodeOf( } } - if ( pPrecedingNode == 0 && GetRoot() ) + if ( pPrecedingNode == nullptr && GetRoot() ) { // <this> node has no children or the given node precedes all its children // and the <this> node isn't the root node. |