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 /editeng | |
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 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/impedit4.cxx | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 6637796ea687..06a18b7f7403 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -4017,9 +4017,9 @@ long ImpEditEngine::GetXPos( else if ( rPortion.GetKind() == PortionKind::TEXT ) { OSL_ENSURE( nIndex != pLine->GetStart(), "Strange behavior in new GetXPos()" ); - OSL_ENSURE( pLine && pLine->GetCharPosArray().size(), "svx::ImpEditEngine::GetXPos(), portion in an empty line?" ); + OSL_ENSURE( pLine && !pLine->GetCharPosArray().empty(), "svx::ImpEditEngine::GetXPos(), portion in an empty line?" ); - if( pLine->GetCharPosArray().size() ) + if( !pLine->GetCharPosArray().empty() ) { sal_Int32 nPos = nIndex - 1 - pLine->GetStart(); if (nPos < 0 || nPos >= static_cast<sal_Int32>(pLine->GetCharPosArray().size())) diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 631893e8326c..fadb8db0c56f 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -3311,7 +3311,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po // longer done in Overlay mode and allows to *read* the URL). // It would be difficult to change this due to needed adaptions in // EditEngine (look for lineBreaksList creation) - if( nullptr == pActiveView && bStripOnly && !bParsingFields && pExtraInfo && pExtraInfo->lineBreaksList.size() ) + if( nullptr == pActiveView && bStripOnly && !bParsingFields && pExtraInfo && !pExtraInfo->lineBreaksList.empty() ) { bParsingFields = true; itSubLines = pExtraInfo->lineBreaksList.begin(); @@ -3494,7 +3494,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po // StripPortions() data callback GetEditEnginePtr()->DrawingText( aOutPos, aText, nTextStart, nTextLen, pDXArray, aTmpFont, n, rTextPortion.GetRightToLeftLevel(), - aWrongSpellVector.size() ? &aWrongSpellVector : nullptr, + !aWrongSpellVector.empty() ? &aWrongSpellVector : nullptr, pFieldData, bEndOfLine, bEndOfParagraph, // support for EOL/EOP TEXT comments &aLocale, diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 66cd22344d0c..64bc7443014e 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -2067,7 +2067,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView const & rEditView, DBG_ASSERT(pSpellInfo, "pSpellInfo not initialized"); if (pSpellInfo && - pSpellInfo->aLastSpellPortions.size() > 0) // no portions -> no text to be changed + !pSpellInfo->aLastSpellPortions.empty()) // no portions -> no text to be changed { // get current paragraph length to calculate later on how the sentence length changed, // in order to place the cursor at the end of the sentence again @@ -2077,7 +2077,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView const & rEditView, UndoActionStart( EDITUNDO_INSERT ); if(pSpellInfo->aLastSpellPortions.size() == rNewPortions.size()) { - DBG_ASSERT( rNewPortions.size() > 0, "rNewPortions should not be empty here" ); + DBG_ASSERT( !rNewPortions.empty(), "rNewPortions should not be empty here" ); DBG_ASSERT( pSpellInfo->aLastSpellPortions.size() == pSpellInfo->aLastSpellContentSelections.size(), "aLastSpellPortions and aLastSpellContentSelections size mismatch" ); |