diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-02-12 00:00:22 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-12 07:37:08 +0100 |
commit | 3f08be2e511dc2300021486a1cc2f1e8ba530373 (patch) | |
tree | 4498ff04e82aa36b94274af254b60f35e29805a8 /reportdesign/source/ui/dlg/GroupsSorting.cxx | |
parent | f9c57cae202818258b416b4ca28040a44e8887c2 (diff) |
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'reportdesign/source/ui/dlg/GroupsSorting.cxx')
-rw-r--r-- | reportdesign/source/ui/dlg/GroupsSorting.cxx | 13 |
1 files changed, 4 insertions, 9 deletions
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<ColumnInfo>::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&) |