diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-19 08:12:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-19 10:02:39 +0200 |
commit | 2c1b7e8d6a7fa22cb91919238418816671c3a497 (patch) | |
tree | 6f356017d24dffcd25261295ab25a21b738dc835 /sw/source/core/doc | |
parent | ad18bb24d51e4f735085d50c496d28bd637dbb0b (diff) |
clang-tidy readability-container-size-empty
Change-Id: I1df70b7dff5ebb6048f7fc618789faa15ca5d422
Reviewed-on: https://gerrit.libreoffice.org/61967
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/doc')
-rw-r--r-- | sw/source/core/doc/DocumentContentOperationsManager.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentRedlineManager.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/docdraw.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/docnum.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/docsort.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/htmltbl.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/tblrwcl.cxx | 8 |
7 files changed, 11 insertions, 11 deletions
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 679fd7d1f098..1b40c8605e49 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -4090,7 +4090,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt } else { - if( !m_rDoc.getIDocumentRedlineAccess().IsIgnoreRedline() && m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().size() ) + if( !m_rDoc.getIDocumentRedlineAccess().IsIgnoreRedline() && !m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty() ) m_rDoc.getIDocumentRedlineAccess().DeleteRedline( aDelPam, true, USHRT_MAX ); SwUndoReplace* pUndoRpl = nullptr; diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 076428024811..4e203e565108 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -2540,7 +2540,7 @@ void DocumentRedlineManager::AcceptAllRedline(bool bAccept) rUndoMgr.StartUndo(bAccept ? SwUndoId::ACCEPT_REDLINE : SwUndoId::REJECT_REDLINE, &aRewriter); } - while (mpRedlineTable->size() > 0) + while (!mpRedlineTable->empty()) { if (bAccept) AcceptRedline(mpRedlineTable->size() - 1, true); diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx index 18f59510ed43..9eb49b95a44b 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -366,7 +366,7 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView ) GetIDocumentUndoRedo().AppendUndo(std::unique_ptr<SwUndo>(pUndo)); } - while ( pFormatsAndObjs[i].size() > 0 ) + while ( !pFormatsAndObjs[i].empty() ) { SwDrawFrameFormat* pFormat( pFormatsAndObjs[i].back().first ); SdrObject* pObj( pFormatsAndObjs[i].back().second ); diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 92a49b7c5205..28d5cd766aea 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -1141,7 +1141,7 @@ bool SwDoc::ReplaceNumRule( const SwPosition& rPos, SwNumRule::tTextNodeList aTextNodeList; pOldRule->GetTextNodeList( aTextNodeList ); - if ( aTextNodeList.size() > 0 ) + if ( !aTextNodeList.empty() ) { SwRegHistory aRegH( pUndo ? pUndo->GetHistory() : nullptr ); sal_uInt16 nChgFormatLevel = 0; diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index d5cc122cc9f0..70633e0eada5 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -849,7 +849,7 @@ sal_uInt16 FlatFndBox::GetRowCount(const FndBox_& rBox) sal_uInt16 nLn = 1; for (const auto &rpB : rBoxes) { - if (rpB->GetLines().size()) + if (!rpB->GetLines().empty()) { // Iterate recursively over the Lines nLn = std::max(GetRowCount(*rpB), nLn); } diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx index f82d8bb706d3..da0135abd966 100644 --- a/sw/source/core/doc/htmltbl.cxx +++ b/sw/source/core/doc/htmltbl.cxx @@ -392,9 +392,9 @@ const SwStartNode *SwHTMLTableLayout::GetAnyBoxStartNode() const const SwTableBox* pBox = m_pSwTable->GetTabLines()[0]->GetTabBoxes()[0]; while( nullptr == (pBoxSttNd = pBox->GetSttNd()) ) { - OSL_ENSURE( pBox->GetTabLines().size() > 0, + OSL_ENSURE( !pBox->GetTabLines().empty(), "Box without start node and lines" ); - OSL_ENSURE( pBox->GetTabLines().front()->GetTabBoxes().size() > 0, + OSL_ENSURE( !pBox->GetTabLines().front()->GetTabBoxes().empty(), "Line without boxes" ); pBox = pBox->GetTabLines().front()->GetTabBoxes().front(); } diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index 710b693bfb7b..ee0050226efe 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -297,7 +297,7 @@ static void lcl_CopyCol( FndBox_ & rFndBox, CpyPara *const pCpyPara) SwFormatFrameSize aFrameSz( pNewFormat->GetFrameSize() ); bool bDiffCount = false; - if( pBox->GetTabLines().size() ) + if( !pBox->GetTabLines().empty() ) { pCmpLine = rFndBox.GetLines().front().get(); if ( pCmpLine->GetBoxes().size() != pCmpLine->GetLine()->GetTabBoxes().size() ) @@ -1411,7 +1411,7 @@ static void lcl_Merge_MoveBox(FndBox_ & rFndBox, InsULPara *const pULPara) pBoxes = &pULPara->pInsLine->GetTabBoxes(); // Is there still a level to step down to? - if (rFndBox.GetBox()->GetTabLines().size()) + if (!rFndBox.GetBox()->GetTabLines().empty()) { SwTableBox* pBox = new SwTableBox( static_cast<SwTableBoxFormat*>(rFndBox.GetBox()->GetFrameFormat()), @@ -1423,7 +1423,7 @@ static void lcl_Merge_MoveBox(FndBox_ & rFndBox, InsULPara *const pULPara) { lcl_Merge_MoveLine(**it, &aPara); } - if( pBox->GetTabLines().size() ) + if( !pBox->GetTabLines().empty() ) { if( USHRT_MAX == nInsPos ) nInsPos = pBoxes->size(); @@ -1730,7 +1730,7 @@ static void lcl_CalcNewWidths(const FndLines_t& rFndLines, CpyPara& rPara) { std::vector< sal_uLong > &rWidth = (*rPara.pWidths.get())[ nLine ]; const FndLine_ *pFndLine = rFndLines[ nLine ].get(); - if( pFndLine && pFndLine->GetBoxes().size() ) + if( pFndLine && !pFndLine->GetBoxes().empty() ) { const SwTableLine *pLine = pFndLine->GetLine(); if( pLine && !pLine->GetTabBoxes().empty() ) |