From 40ab4d8fda9b69b388ac674c1ee4e88084af9519 Mon Sep 17 00:00:00 2001 From: Arkadiy Illarionov Date: Sun, 14 Oct 2018 20:25:12 +0300 Subject: Simplify containers iterations in unotools, unoxml, uui, vbahelper Use range-based loop or replace with STL functions. Change-Id: I5a43f6fc62c81453dcef3820bb715f4da76915af Reviewed-on: https://gerrit.libreoffice.org/61762 Tested-by: Jenkins Reviewed-by: Noel Grandin --- uui/source/fltdlg.cxx | 6 ++---- uui/source/iahndl.cxx | 11 ++--------- 2 files changed, 4 insertions(+), 13 deletions(-) (limited to 'uui') diff --git a/uui/source/fltdlg.cxx b/uui/source/fltdlg.cxx index 100f0e90bcb2..fb9516a50498 100644 --- a/uui/source/fltdlg.cxx +++ b/uui/source/fltdlg.cxx @@ -93,11 +93,9 @@ void FilterDialog::ChangeFilters( const FilterNameList* pFilterNames ) m_xLbFilters->clear(); if( m_pFilterNames != nullptr ) { - for( FilterNameListPtr pItem = m_pFilterNames->begin(); - pItem != m_pFilterNames->end() ; - ++pItem ) + for( const auto& rItem : *m_pFilterNames ) { - m_xLbFilters->append_text(pItem->sUI); + m_xLbFilters->append_text(rItem.sUI); } } } diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index eca18bd79a16..7b8ee8b8afe0 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -284,15 +284,8 @@ UUIInteractionHelper::tryOtherInteractionHandler( InteractionHandlerDataList dataList; getInteractionHandlerList(dataList); - InteractionHandlerDataList::const_iterator aEnd(dataList.end()); - for (InteractionHandlerDataList::const_iterator aIt(dataList.begin()); - aIt != aEnd; - ++aIt) - { - if ( handleCustomRequest( rRequest, aIt->ServiceName ) ) - return true; - } - return false; + return std::any_of(dataList.cbegin(), dataList.cend(), + [&](const InteractionHandlerData& rData) { return handleCustomRequest( rRequest, rData.ServiceName ); }); } namespace -- cgit