diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-10 16:12:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-11 12:50:55 +0200 |
commit | 20571c472528c4f98fe3f55700d134915d32a49a (patch) | |
tree | 9b350824d845b8aaeb13d087ef74febb454b821b /connectivity | |
parent | b401896a56149aa2871b65a330a6f601a9830ccd (diff) |
use more range-for on uno::Sequence
Change-Id: Ifad32425d79be5a22d33d721bdc5fb993f699759
Reviewed-on: https://gerrit.libreoffice.org/39763
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/commontools/ConnectionWrapper.cxx | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/connectivity/source/commontools/ConnectionWrapper.cxx b/connectivity/source/commontools/ConnectionWrapper.cxx index 2ca1e2993ffb..7ac9ed6dc1c2 100644 --- a/connectivity/source/commontools/ConnectionWrapper.cxx +++ b/connectivity/source/commontools/ConnectionWrapper.cxx @@ -202,32 +202,26 @@ void OConnectionWrapper::createUniqueId( const OUString& _rURL if ( !_rPassword.isEmpty() ) rtl_digest_update(aDigest,_rPassword.getStr(),_rPassword.getLength()*sizeof(sal_Unicode)); // now we need to sort the properties - PropertyValue* pBegin = _rInfo.getArray(); - PropertyValue* pEnd = pBegin + _rInfo.getLength(); - std::sort(pBegin,pEnd,TPropertyValueLessFunctor()); + std::sort(_rInfo.begin(),_rInfo.end(),TPropertyValueLessFunctor()); - pBegin = _rInfo.getArray(); - pEnd = pBegin + _rInfo.getLength(); - for (; pBegin != pEnd; ++pBegin) + for (PropertyValue const & prop : _rInfo) { // we only include strings an integer values OUString sValue; - if ( pBegin->Value >>= sValue ) + if ( prop.Value >>= sValue ) ; else { sal_Int32 nValue = 0; - if ( pBegin->Value >>= nValue ) + if ( prop.Value >>= nValue ) sValue = OUString::number(nValue); else { Sequence< OUString> aSeq; - if ( pBegin->Value >>= aSeq ) + if ( prop.Value >>= aSeq ) { - const OUString* pSBegin = aSeq.getConstArray(); - const OUString* pSEnd = pSBegin + aSeq.getLength(); - for(;pSBegin != pSEnd;++pSBegin) - rtl_digest_update(aDigest,pSBegin->getStr(),pSBegin->getLength()*sizeof(sal_Unicode)); + for(OUString const & s : aSeq) + rtl_digest_update(aDigest,s.getStr(),s.getLength()*sizeof(sal_Unicode)); } } } |