From 3f08be2e511dc2300021486a1cc2f1e8ba530373 Mon Sep 17 00:00:00 2001 From: Arkadiy Illarionov Date: Tue, 12 Feb 2019 00:00:22 +0300 Subject: Simplify containers iterations in reportdesign, sal, sax Use range-based loop or replace with STL functions Change-Id: If6b734dab12a7298fce16003d3d175305fbe798d Reviewed-on: https://gerrit.libreoffice.org/67701 Tested-by: Jenkins Reviewed-by: Noel Grandin --- reportdesign/source/ui/dlg/GroupsSorting.cxx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'reportdesign/source/ui/dlg/GroupsSorting.cxx') diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx index e933b6218752..a12479660ad5 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.cxx +++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx @@ -503,15 +503,10 @@ OUString OFieldExpressionControl::GetCellText( long nRow, sal_uInt16 /*nColId*/ uno::Reference< report::XGroup> xGroup = m_pParent->getGroup(m_aGroupPositions[nRow]); OUString sExpression = xGroup->getExpression(); - for(::std::vector::const_iterator aIter = m_aColumnInfo.begin(); aIter != m_aColumnInfo.end();++aIter) - { - if ( aIter->sColumnName == sExpression ) - { - if ( !aIter->sLabel.isEmpty() ) - sExpression = aIter->sLabel; - break; - } - } + auto aIter = std::find_if(m_aColumnInfo.begin(), m_aColumnInfo.end(), + [&sExpression](const ColumnInfo& rColumnInfo) { return rColumnInfo.sColumnName == sExpression; }); + if (aIter != m_aColumnInfo.end() && !aIter->sLabel.isEmpty()) + sExpression = aIter->sLabel; sText = sExpression; } catch (const uno::Exception&) -- cgit