From 30530afaaa715473a2f9c3f068beeed5f3a98daf Mon Sep 17 00:00:00 2001 From: Arkadiy Illarionov Date: Sun, 16 Sep 2018 13:53:43 +0300 Subject: Simplify containers iterations in xmloff/source/[f-t]* Use range-based loop or replace with STL functions. Change-Id: Ic94c7e292f44d460038d3ca99c7e4cc02958d8a3 Reviewed-on: https://gerrit.libreoffice.org/60549 Tested-by: Jenkins Reviewed-by: Noel Grandin --- xmloff/source/transform/ChartPlotAreaOOoTContext.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'xmloff/source/transform/ChartPlotAreaOOoTContext.cxx') diff --git a/xmloff/source/transform/ChartPlotAreaOOoTContext.cxx b/xmloff/source/transform/ChartPlotAreaOOoTContext.cxx index ee9c86acfd68..770cf41f531c 100644 --- a/xmloff/source/transform/ChartPlotAreaOOoTContext.cxx +++ b/xmloff/source/transform/ChartPlotAreaOOoTContext.cxx @@ -138,13 +138,12 @@ rtl::Reference XMLChartPlotAreaOOoTContext::CreateChildCo pContext.set(new XMLPersAttrListTContext( GetTransformer(), rQName )); // put categories at correct axis - XMLAxisContextVector::iterator aIter = m_aChildContexts.begin(); bool bFound =false; // iterate over axis elements - for( ; ! bFound && aIter != m_aChildContexts.end(); ++aIter ) + for( auto& rChildContext : m_aChildContexts ) { - XMLAxisOOoContext * pAxisContext = (*aIter).get(); + XMLAxisOOoContext * pAxisContext = rChildContext.get(); if( pAxisContext != nullptr ) { // iterate over attributes to find category axis @@ -169,6 +168,9 @@ rtl::Reference XMLChartPlotAreaOOoTContext::CreateChildCo } } } + + if (bFound) + break; } OSL_ENSURE( bFound, "No suitable axis for categories found." ); } @@ -198,11 +200,9 @@ void XMLChartPlotAreaOOoTContext::AddContent(rtl::Reference c void XMLChartPlotAreaOOoTContext::ExportContent() { - XMLAxisContextVector::iterator aIter = m_aChildContexts.begin(); - - for( ; aIter != m_aChildContexts.end(); ++aIter ) + for( auto& rChildContext : m_aChildContexts ) { - (*aIter)->Export(); + rChildContext->Export(); } m_aChildContexts.clear(); -- cgit