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 /cui | |
parent | Turn ScGridWin::AutoFilterMode into scoped enum (diff) | |
download | core-2c1b7e8d6a7fa22cb91919238418816671c3a497.tar.gz core-2c1b7e8d6a7fa22cb91919238418816671c3a497.zip |
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 'cui')
-rw-r--r-- | cui/source/customize/cfg.cxx | 4 | ||||
-rw-r--r-- | cui/source/options/cfgchart.cxx | 2 | ||||
-rw-r--r-- | cui/source/options/optsave.cxx | 2 | ||||
-rw-r--r-- | cui/source/options/treeopt.cxx | 10 | ||||
-rw-r--r-- | cui/source/tabpages/autocdlg.cxx | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 3d48ae269a56..70644c7ed9d3 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -864,7 +864,7 @@ bool ContextMenuSaveInData::HasURL( const OUString& rURL ) bool ContextMenuSaveInData::HasSettings() { - return m_pRootEntry && m_pRootEntry->GetEntries()->size(); + return m_pRootEntry && !m_pRootEntry->GetEntries()->empty(); } bool ContextMenuSaveInData::Apply() @@ -2473,7 +2473,7 @@ ToolbarSaveInData::HasURL( const OUString& rURL ) bool ToolbarSaveInData::HasSettings() { // return true if there is at least one toolbar entry - return GetEntries()->size() > 0; + return !GetEntries()->empty(); } void ToolbarSaveInData::Reset() diff --git a/cui/source/options/cfgchart.cxx b/cui/source/options/cfgchart.cxx index 5d97a788fa2f..474cb0e9c4dd 100644 --- a/cui/source/options/cfgchart.cxx +++ b/cui/source/options/cfgchart.cxx @@ -69,7 +69,7 @@ void SvxChartColorTable::append( const XColorEntry & _rEntry ) void SvxChartColorTable::remove( size_t _nIndex ) { - if (m_aColorEntries.size() > 0) + if (!m_aColorEntries.empty()) m_aColorEntries.erase( m_aColorEntries.begin() + _nIndex); for (size_t i=0 ; i<m_aColorEntries.size(); i++) diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx index 1a80a97b1438..49ea86844901 100644 --- a/cui/source/options/optsave.cxx +++ b/cui/source/options/optsave.cxx @@ -565,7 +565,7 @@ IMPL_LINK( SvxSaveTabPage, FilterHdl_Impl, ListBox&, rBox, void ) { aSaveAsLB->Clear(); auto & rFilters = pImpl->aFilterArr[nData]; - if(!pImpl->aUIFilterArr[nData].size()) + if(pImpl->aUIFilterArr[nData].empty()) { pImpl->aUIFilterArr[nData].resize(pImpl->aFilterArr[nData].size()); auto & rUIFilters = pImpl->aUIFilterArr[nData]; diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 7002296cf0da..47d3a7ffcaa7 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -1946,11 +1946,11 @@ VectorOfNodes OfaTreeOptionsDialog::LoadNodes( if ( !sLeafGrpId.isEmpty() ) { bool bAlreadyOpened = false; - if ( pNode->m_aGroupedLeaves.size() > 0 ) + if ( !pNode->m_aGroupedLeaves.empty() ) { for (auto & rGroup : pNode->m_aGroupedLeaves) { - if ( rGroup.size() > 0 && + if ( !rGroup.empty() && rGroup[0]->m_sGroupId == sLeafGrpId ) { std::vector<std::unique_ptr<OptionsLeaf>>::size_type l = 0; @@ -1980,14 +1980,14 @@ VectorOfNodes OfaTreeOptionsDialog::LoadNodes( } // do not insert nodes without leaves - if ( pNode->m_aLeaves.size() > 0 || pNode->m_aGroupedLeaves.size() > 0 ) + if ( !pNode->m_aLeaves.empty() || !pNode->m_aGroupedLeaves.empty() ) { pModule ? aNodeList.push_back( std::move(pNode) ) : aOutNodeList.push_back( std::move(pNode) ); } } } - if ( pModule && aNodeList.size() > 0 ) + if ( pModule && !aNodeList.empty() ) { for ( auto const & i: pModule->m_aNodeList ) { @@ -2057,7 +2057,7 @@ void OfaTreeOptionsDialog::InsertNodes( const VectorOfNodes& rNodeList ) { for (auto const& node : rNodeList) { - if ( node->m_aLeaves.size() > 0 || node->m_aGroupedLeaves.size() > 0 ) + if ( !node->m_aLeaves.empty() || !node->m_aGroupedLeaves.empty() ) { for ( auto const & j: node->m_aGroupedLeaves ) { diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 2fdb140df21c..20e8429ba0ec 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -2308,7 +2308,7 @@ void OfaAutoCompleteTabPage::Reset( const SfxItemSet* ) } } - if (pOpt->m_pAutoCompleteList && pOpt->m_pAutoCompleteList->size()) + if (pOpt->m_pAutoCompleteList && !pOpt->m_pAutoCompleteList->empty()) { m_pAutoCompleteList = const_cast<editeng::SortedAutoCompleteStrings*>( pOpt->m_pAutoCompleteList); |