From 20571c472528c4f98fe3f55700d134915d32a49a Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 10 Jul 2017 16:12:07 +0200 Subject: use more range-for on uno::Sequence Change-Id: Ifad32425d79be5a22d33d721bdc5fb993f699759 Reviewed-on: https://gerrit.libreoffice.org/39763 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- xmloff/source/core/xmlexp.cxx | 13 ++++--------- xmloff/source/draw/ximpcustomshape.cxx | 17 ++++++----------- 2 files changed, 10 insertions(+), 20 deletions(-) (limited to 'xmloff') diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index c2ae8e7663e3..c331d833a72c 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -635,16 +635,11 @@ void SAL_CALL SvXMLExport::setSourceDocument( const uno::Reference< lang::XCompo if( xNamespaceMap.is() ) { Sequence< OUString > aPrefixes( xNamespaceMap->getElementNames() ); - - OUString* pPrefix = aPrefixes.getArray(); - const sal_Int32 nCount = aPrefixes.getLength(); - sal_Int32 nIndex; - OUString aURL; - - for( nIndex = 0; nIndex < nCount; ++nIndex, ++pPrefix ) + for( OUString const & prefix : aPrefixes ) { - if( xNamespaceMap->getByName( *pPrefix ) >>= aURL ) - GetNamespaceMap_().Add( *pPrefix, aURL ); + OUString aURL; + if( xNamespaceMap->getByName( prefix ) >>= aURL ) + GetNamespaceMap_().Add( prefix, aURL ); } } } diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx index 68eba5a5bf62..0a9dc7be5b43 100644 --- a/xmloff/source/draw/ximpcustomshape.cxx +++ b/xmloff/source/draw/ximpcustomshape.cxx @@ -1250,14 +1250,11 @@ void XMLEnhancedCustomShapeContext::EndElement() } ++aPathIter; } - std::vector< beans::PropertyValues >::iterator aHandleIter = maHandles.begin(); - std::vector< beans::PropertyValues >::iterator aHandleEnd = maHandles.end(); - while ( aHandleIter != aHandleEnd ) + for ( css::beans::PropertyValues const & aHandle : maHandles ) { - beans::PropertyValue* pValues = aHandleIter->getArray(); - for ( i = 0; i < aHandleIter->getLength(); i++ ) + for ( beans::PropertyValue const & propValue : aHandle ) { - switch( EASGet( pValues->Name ) ) + switch( EASGet( propValue.Name ) ) { case EAS_RangeYMinimum : case EAS_RangeYMaximum : @@ -1267,7 +1264,7 @@ void XMLEnhancedCustomShapeContext::EndElement() case EAS_RadiusRangeMaximum : { CheckAndResolveEquationParameter( const_cast(*o3tl::doAccess( - pValues->Value)), pH.get() ); + propValue.Value)), pH.get() ); } break; @@ -1275,17 +1272,15 @@ void XMLEnhancedCustomShapeContext::EndElement() case EAS_Polar : { CheckAndResolveEquationParameter( const_cast((*o3tl::doAccess( - pValues->Value)).First), pH.get() ); + propValue.Value)).First), pH.get() ); CheckAndResolveEquationParameter( const_cast((*o3tl::doAccess( - pValues->Value)).Second), pH.get() ); + propValue.Value)).Second), pH.get() ); } break; default: break; } - pValues++; } - ++aHandleIter; } } -- cgit