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 /svtools | |
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 'svtools')
-rw-r--r-- | svtools/source/brwbox/brwbox2.cxx | 2 | ||||
-rw-r--r-- | svtools/source/contnr/svimpbox.cxx | 2 | ||||
-rw-r--r-- | svtools/source/control/autocmpledit.cxx | 4 | ||||
-rw-r--r-- | svtools/source/control/tabbar.cxx | 2 | ||||
-rw-r--r-- | svtools/source/control/valueset.cxx | 4 | ||||
-rw-r--r-- | svtools/source/dialogs/wizardmachine.cxx | 2 | ||||
-rw-r--r-- | svtools/source/misc/templatefoldercache.cxx | 2 |
7 files changed, 9 insertions, 9 deletions
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index 6126f341ec6a..c9ba487b91e0 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -258,7 +258,7 @@ void BrowseBox::ToggleSelection() tools::Rectangle aAddRect( Point( nOfsX, (nRow-nTopRow)*GetDataRowHeight() ), Size( pDataWin->GetSizePixel().Width(), GetDataRowHeight() ) ); - if ( aHighlightList.size() && nLastRowInRect == ( nRow - 1 ) ) + if ( !aHighlightList.empty() && nLastRowInRect == ( nRow - 1 ) ) aHighlightList[ 0 ].Union( aAddRect ); else aHighlightList.emplace( aHighlightList.begin(), aAddRect ); diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index 551122ad913d..11a1f6e6890a 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -202,7 +202,7 @@ void SvImpLBox::UpdateContextBmpWidthVectorFromMovedEntry( SvTreeListEntry* pEnt void SvImpLBox::UpdateContextBmpWidthMax( SvTreeListEntry const * pEntry ) { sal_uInt16 nDepth = pView->pModel->GetDepth( pEntry ); - if( aContextBmpWidthVector.size() < 1 ) + if( aContextBmpWidthVector.empty() ) return; short nWidth = aContextBmpWidthVector[ nDepth ]; if( nWidth != pView->nContextBmpWidthMax ) { diff --git a/svtools/source/control/autocmpledit.cxx b/svtools/source/control/autocmpledit.cxx index d008ee41bc69..8bffcd166eb4 100644 --- a/svtools/source/control/autocmpledit.cxx +++ b/svtools/source/control/autocmpledit.cxx @@ -44,7 +44,7 @@ IMPL_LINK_NOARG(AutocompleteEdit, AutoCompleteHdl_Impl, Edit&, void) if( aCurText.isEmpty() ) return; - if( m_aEntries.size() ) + if( !m_aEntries.empty() ) { if( Match( aCurText ) ) { @@ -89,7 +89,7 @@ bool AutocompleteEdit::PreNotify( NotifyEvent& rNEvt ) Selection aSelection( GetSelection() ); sal_uInt16 nLen = static_cast<sal_uInt16>(aSelection.Min()); - if( m_aMatching.size() && + if( !m_aMatching.empty() && ( ( aCode == KEY_DOWN && m_nCurrent + 1 < m_aMatching.size() ) || ( aCode == KEY_UP && m_nCurrent > 0 ) ) ) { diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index cebb1172587a..3f97b55b1e10 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -2531,7 +2531,7 @@ Size TabBar::CalcWindowSizePixel() const { long nWidth = 0; - if (mpImpl->mpItemList.size() > 0) + if (!mpImpl->mpItemList.empty()) { const_cast<TabBar*>(this)->ImplCalcWidth(); for (auto& pItem : mpImpl->mpItemList) diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index 275ac4dcc550..04d3622ed4ec 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -1033,7 +1033,7 @@ ValueSetItem* ValueSet::ImplGetItem( size_t nPos ) ValueSetItem* ValueSet::ImplGetFirstItem() { - return mItemList.size() ? mItemList[0].get() : nullptr; + return !mItemList.empty() ? mItemList[0].get() : nullptr; } sal_uInt16 ValueSet::ImplGetVisibleItemCount() const @@ -2404,7 +2404,7 @@ SvtValueSetItem* SvtValueSet::ImplGetItem( size_t nPos ) SvtValueSetItem* SvtValueSet::ImplGetFirstItem() { - return mItemList.size() ? mItemList[0].get() : nullptr; + return !mItemList.empty() ? mItemList[0].get() : nullptr; } sal_uInt16 SvtValueSet::ImplGetVisibleItemCount() const diff --git a/svtools/source/dialogs/wizardmachine.cxx b/svtools/source/dialogs/wizardmachine.cxx index e76aa4266214..b2ff6deef3d7 100644 --- a/svtools/source/dialogs/wizardmachine.cxx +++ b/svtools/source/dialogs/wizardmachine.cxx @@ -549,7 +549,7 @@ namespace svt bool OWizardMachine::travelPrevious() { - DBG_ASSERT(m_pImpl->aStateHistory.size() > 0, "OWizardMachine::travelPrevious: have no previous page!"); + DBG_ASSERT(!m_pImpl->aStateHistory.empty(), "OWizardMachine::travelPrevious: have no previous page!"); // allowed to leave the current page? if ( !prepareLeaveCurrentState( eTravelBackward ) ) diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx index 355fbd4695c3..a2b0b09acbc9 100644 --- a/svtools/source/misc/templatefoldercache.cxx +++ b/svtools/source/misc/templatefoldercache.cxx @@ -218,7 +218,7 @@ namespace svt if ( _rLHS->getSubContents().size() != _rRHS->getSubContents().size() ) return false; - if ( _rLHS->getSubContents().size() ) + if ( !_rLHS->getSubContents().empty() ) { // there are children // -> compare them ::std::pair< FolderIterator, FolderIterator > aFirstDifferent = ::std::mismatch( |