diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-06-02 10:40:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-06-03 10:51:57 +0200 |
commit | 054c0e7177cbef26942f8ca7cb7b1422ceea721c (patch) | |
tree | 7390a1be5ee0797b7f43d7d433822315fd75c6dd /sw | |
parent | 0f499af8c2c22ccc8f1c19edeeb2bdac8cbcb7f0 (diff) |
loplugin:simplifypointertobool improve
to look for the
x.get() != null
pattern, which can be simplified to
x
I'll do the
x.get() == nullptr
pattern in a separate patch, to reduce the chances of a mistake
Change-Id: I45e0d178e75359857cdf50d712039cb526016555
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95354
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/WW8TableInfo.cxx | 14 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 2 |
4 files changed, 16 insertions, 16 deletions
diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx index 4d97fd7f6bab..ec7ec7603c64 100644 --- a/sw/source/filter/ww8/WW8TableInfo.cxx +++ b/sw/source/filter/ww8/WW8TableInfo.cxx @@ -812,7 +812,7 @@ WW8TableInfo::processTableBox(const SwTable * pTable, } while (!bDone); - if (pEndOfCellInfo.get() != nullptr) + if (pEndOfCellInfo) { pEndOfCellInfo->setEndOfCell(true); @@ -917,7 +917,7 @@ const SwNode * WW8TableInfo::getNextNode(const SwNode * pNode) WW8TableNodeInfo::Pointer_t pNodeInfo = getTableNodeInfo(pNode); - if (pNodeInfo.get() != nullptr) + if (pNodeInfo) { WW8TableNodeInfo * pNextInfo = pNodeInfo->getNext(); @@ -1153,7 +1153,7 @@ void WW8TableCellGrid::addShadowCells() } WW8TableCellGridRow::Pointer_t pRow = getRow(*aTopsIt); - if (pRow.get() != nullptr) + if (pRow) pRow->setRowSpans(pRowSpans); ++aTopsIt; @@ -1322,7 +1322,7 @@ std::string WW8TableCellGrid::toString() } RowSpansPtr pRowSpans = pRow->getRowSpans(); - if (pRowSpans.get() != nullptr) + if (pRowSpans) { sResult += "<rowspans>"; @@ -1358,7 +1358,7 @@ TableBoxVectorPtr WW8TableCellGrid::getTableBoxesOfRow WW8TableCellGridRow::Pointer_t pRow = getRow(pNodeInfoInner->getRect().Top(), false); - if (pRow.get() != nullptr) + if (pRow) { pResult = pRow->getTableBoxVector(); } @@ -1374,7 +1374,7 @@ WidthsPtr WW8TableCellGrid::getWidthsOfRow WW8TableCellGridRow::Pointer_t pRow = getRow(pNodeInfoInner->getRect().Top(), false); - if (pRow.get() != nullptr) + if (pRow) { pResult = pRow->getWidths(); } @@ -1390,7 +1390,7 @@ RowSpansPtr WW8TableCellGrid::getRowSpansOfRow WW8TableCellGridRow::Pointer_t pRow = getRow(pNodeInfoInner->getRect().Top(), false); - if (pRow.get() != nullptr) + if (pRow) { pResult = pRow->getRowSpans(); } diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index bec214a2830e..b66745241dd9 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -1840,7 +1840,7 @@ void WW8AttributeOutput::FormatDrop( const SwTextNode& rNode, const SwFormatDrop m_rWW8Export.WriteCR( pTextNodeInfoInner ); - if ( pTextNodeInfo.get() != nullptr ) + if ( pTextNodeInfo ) { #ifdef DBG_UTIL SAL_INFO( "sw.ww8", pTextNodeInfo->toString()); @@ -2294,7 +2294,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) sal_Int32 nOpenAttrWithRange = 0; ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner; - if ( pTextNodeInfo.get() != nullptr ) + if ( pTextNodeInfo ) { pTextNodeInfoInner = pTextNodeInfo->getFirstInner(); } @@ -2729,7 +2729,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) if ( m_pParentFrame && IsInTable() ) // Fly-Attrs OutputFormat( m_pParentFrame->GetFrameFormat(), false, false, true ); - if ( pTextNodeInfo.get() != nullptr ) + if ( pTextNodeInfo ) { #ifdef DBG_UTIL SAL_INFO( "sw.ww8", pTextNodeInfo->toString()); diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index c3fe9c0a36f9..6bdab61a8e9e 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -1881,7 +1881,7 @@ void WW8Export::OutSwString(const OUString& rStr, sal_Int32 nStt, void WW8Export::WriteCR(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) { - if (pTableTextNodeInfoInner.get() != nullptr && pTableTextNodeInfoInner->getDepth() == 1 && pTableTextNodeInfoInner->isEndOfCell()) + if (pTableTextNodeInfoInner && pTableTextNodeInfoInner->getDepth() == 1 && pTableTextNodeInfoInner->isEndOfCell()) WriteChar('\007'); else WriteChar( '\015' ); @@ -2952,11 +2952,11 @@ bool MSWordExportBase::IsInTable() const { SwNode& rNode = m_pCurPam->GetNode(); - if (m_pTableInfo.get() != nullptr) + if (m_pTableInfo) { ww8::WW8TableNodeInfo::Pointer_t pTableNodeInfo = m_pTableInfo->getTableNodeInfo(&rNode); - if (pTableNodeInfo.get() != nullptr && pTableNodeInfo->getDepth() > 0) + if (pTableNodeInfo && pTableNodeInfo->getDepth() > 0) { bResult = true; } @@ -4391,7 +4391,7 @@ void MSWordExportBase::OutputStartNode( const SwStartNode & rNode) ww8::WW8TableNodeInfo::Pointer_t pNodeInfo = m_pTableInfo->getTableNodeInfo( &rNode ); - if (pNodeInfo.get() != nullptr) + if (pNodeInfo) { #ifdef DBG_UTIL SAL_INFO( "sw.ww8", pNodeInfo->toString()); @@ -4418,7 +4418,7 @@ void MSWordExportBase::OutputEndNode( const SwEndNode &rNode ) ww8::WW8TableNodeInfo::Pointer_t pNodeInfo = m_pTableInfo->getTableNodeInfo( &rNode ); - if (pNodeInfo.get() != nullptr) + if (pNodeInfo) { #ifdef DBG_UTIL SAL_INFO( "sw.ww8", pNodeInfo->toString()); diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 4b913d9fa576..b11d85931a77 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -999,7 +999,7 @@ void WW8AttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTe mbOnTOXEnding = false; m_rWW8Export.pO->clear(); - if ( pTextNodeInfoInner.get() != nullptr ) + if ( pTextNodeInfoInner ) { if ( pTextNodeInfoInner->isEndOfLine() ) { |