diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-06-10 10:02:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-06-10 20:43:38 +0200 |
commit | 474a9171e7e996116037bb9ca6c985d0a3d6c0c3 (patch) | |
tree | 7ca10ffc1a6514817ff173e41d1ac04251b69c9a /sw/source/core/docnode/node.cxx | |
parent | b0ede91f5e64767bd3ba9f427687e1faf2297e0c (diff) |
loplugin:buriedassign in sw
limited this only fixing assignments inside "if" statements, since other
things are harder to change
Change-Id: If3188a3e3d5fcd94123211c97fee097ece5e2797
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95990
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/docnode/node.cxx')
-rw-r--r-- | sw/source/core/docnode/node.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index e5b0a4061d64..171aa8454744 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -296,7 +296,8 @@ SwNode::SwNode( const SwNodeIndex &rWhere, const SwNodeType nNdType ) SwNodes& rNodes = const_cast<SwNodes&> (rWhere.GetNodes()); SwNode* pNd = rNodes[ rWhere.GetIndex() -1 ]; rNodes.InsertNode( this, rWhere ); - if( nullptr == ( m_pStartOfSection = pNd->GetStartNode()) ) + m_pStartOfSection = pNd->GetStartNode(); + if( nullptr == m_pStartOfSection ) { m_pStartOfSection = pNd->m_pStartOfSection; if( pNd->GetEndNode() ) // Skip EndNode ? Section @@ -328,7 +329,8 @@ SwNode::SwNode( SwNodes& rNodes, sal_uLong nPos, const SwNodeType nNdType ) { SwNode* pNd = rNodes[ nPos - 1 ]; rNodes.InsertNode( this, nPos ); - if( nullptr == ( m_pStartOfSection = pNd->GetStartNode()) ) + m_pStartOfSection = pNd->GetStartNode(); + if( nullptr == m_pStartOfSection ) { m_pStartOfSection = pNd->m_pStartOfSection; if( pNd->GetEndNode() ) // Skip EndNode ? Section! @@ -423,7 +425,8 @@ bool SwNode::IsProtect() const if( pSttNd && static_cast<const SwSectionNode*>(pSttNd)->GetSection().IsProtectFlag() ) return true; - if( nullptr != ( pSttNd = FindTableBoxStartNode() ) ) + pSttNd = FindTableBoxStartNode(); + if( nullptr != pSttNd ) { SwContentFrame* pCFrame; if( IsContentNode() && nullptr != (pCFrame = static_cast<const SwContentNode*>(this)->getLayoutFrame( GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout() ) )) @@ -449,7 +452,8 @@ bool SwNode::IsProtect() const return &rAnchorNd != this && rAnchorNd.IsProtect(); } - if( nullptr != ( pSttNd = FindFootnoteStartNode() ) ) + pSttNd = FindFootnoteStartNode(); + if( nullptr != pSttNd ) { const SwTextFootnote* pTFootnote = GetDoc()->GetFootnoteIdxs().SeekEntry( SwNodeIndex( *pSttNd ) ); @@ -682,7 +686,8 @@ const SwPageDesc* SwNode::FindPageDesc( size_t* pPgDescNdIdx ) const } } - if( nullptr != ( pNd = aInfo.GetFoundNode() )) + pNd = aInfo.GetFoundNode(); + if( nullptr != pNd ) { if( pNd->IsContentNode() ) pPgDesc = static_cast<const SwFormatPageDesc&>(pNd->GetContentNode()-> |