diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-05 13:27:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-06 08:35:23 +0200 |
commit | ab9b38a4064141705aa3a3de9a5d73b465ad3af3 (patch) | |
tree | 888fcc6b517c44d77e2d297c13ee84fb487dd7a7 /comphelper/source/misc/namedvaluecollection.cxx | |
parent | 13341ffa49d58f313a05edae4f4f04c215658e9f (diff) |
use more begin()/end() for Sequence
Change-Id: I399be6b6ef7a6ce01e883569a177c0969bc29c69
Diffstat (limited to 'comphelper/source/misc/namedvaluecollection.cxx')
-rw-r--r-- | comphelper/source/misc/namedvaluecollection.cxx | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/comphelper/source/misc/namedvaluecollection.cxx b/comphelper/source/misc/namedvaluecollection.cxx index a6f732937b4e..9c03be3fd861 100644 --- a/comphelper/source/misc/namedvaluecollection.cxx +++ b/comphelper/source/misc/namedvaluecollection.cxx @@ -192,21 +192,19 @@ namespace comphelper PropertyValue aPropertyValue; NamedValue aNamedValue; - const Any* pArgument = _rArguments.getConstArray(); - const Any* pArgumentEnd = _rArguments.getConstArray() + _rArguments.getLength(); - for ( ; pArgument != pArgumentEnd; ++pArgument ) + for ( auto const & argument : _rArguments ) { - if ( *pArgument >>= aPropertyValue ) + if ( argument >>= aPropertyValue ) m_pImpl->aValues[ aPropertyValue.Name ] = aPropertyValue.Value; - else if ( *pArgument >>= aNamedValue ) + else if ( argument >>= aNamedValue ) m_pImpl->aValues[ aNamedValue.Name ] = aNamedValue.Value; else { SAL_WARN_IF( - pArgument->hasValue(), "comphelper", + argument.hasValue(), "comphelper", ("NamedValueCollection::impl_assign: encountered a value" " type which I cannot handle: " - + pArgument->getValueTypeName())); + + argument.getValueTypeName())); } } } @@ -219,10 +217,8 @@ namespace comphelper m_pImpl->aValues.swap( aEmpty ); } - const PropertyValue* pArgument = _rArguments.getConstArray(); - const PropertyValue* pArgumentEnd = _rArguments.getConstArray() + _rArguments.getLength(); - for ( ; pArgument != pArgumentEnd; ++pArgument ) - m_pImpl->aValues[ pArgument->Name ] = pArgument->Value; + for ( auto const & argument : _rArguments ) + m_pImpl->aValues[ argument.Name ] = argument.Value; } @@ -233,10 +229,8 @@ namespace comphelper m_pImpl->aValues.swap( aEmpty ); } - const NamedValue* pArgument = _rArguments.getConstArray(); - const NamedValue* pArgumentEnd = _rArguments.getConstArray() + _rArguments.getLength(); - for ( ; pArgument != pArgumentEnd; ++pArgument ) - m_pImpl->aValues[ pArgument->Name ] = pArgument->Value; + for ( auto const & argument : _rArguments ) + m_pImpl->aValues[ argument.Name ] = argument.Value; } |