diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-04-29 01:31:19 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-04-29 23:15:33 +0200 |
commit | 8755c80018bec656e1b102da25edc450da4eee52 (patch) | |
tree | 2bb7559605c11e18f7e9063f15e4772b438d4582 /connectivity/source/drivers/ado | |
parent | 20070d12c85ae6db8d5b1374a49f92b34137c8b1 (diff) |
Drop uses of css::uno::Sequence::getConstArray in canvas .. connectivity
where it was obsoleted by commits 2484de6728bd11bb7949003d112f1ece2223c7a1
(Remove non-const Sequence::begin()/end() in internal code, 2021-10-15) and
fb3c04bd1930eedacd406874e1a285d62bbf27d9 (Drop non-const Sequence::operator[]
in internal code 2021-11-05).
Change-Id: I9467028fd1a7eeafad7f0dd776a91a9a40770b48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166816
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'connectivity/source/drivers/ado')
-rw-r--r-- | connectivity/source/drivers/ado/AConnection.cxx | 16 | ||||
-rw-r--r-- | connectivity/source/drivers/ado/AResultSet.cxx | 6 | ||||
-rw-r--r-- | connectivity/source/drivers/ado/Aolevariant.cxx | 6 | ||||
-rw-r--r-- | connectivity/source/drivers/ado/Awrapado.cxx | 6 |
4 files changed, 13 insertions, 21 deletions
diff --git a/connectivity/source/drivers/ado/AConnection.cxx b/connectivity/source/drivers/ado/AConnection.cxx index b879e1b11801..600604e5eafb 100644 --- a/connectivity/source/drivers/ado/AConnection.cxx +++ b/connectivity/source/drivers/ado/AConnection.cxx @@ -96,16 +96,14 @@ void OConnection::construct(std::u16string_view url,const Sequence< PropertyValu o3tl::starts_with(aDSN, u"access:", &aDSN); sal_Int32 nTimeout = 20; - const PropertyValue *pIter = info.getConstArray(); - const PropertyValue *pEnd = pIter + info.getLength(); - for(;pIter != pEnd;++pIter) + for (const auto& propval : info) { - if(pIter->Name == "Timeout") - pIter->Value >>= nTimeout; - else if(pIter->Name == "user") - pIter->Value >>= aUID; - else if(pIter->Name == "password") - pIter->Value >>= aPWD; + if (propval.Name == "Timeout") + propval.Value >>= nTimeout; + else if (propval.Name == "user") + propval.Value >>= aUID; + else if (propval.Name == "password") + propval.Value >>= aPWD; } try { diff --git a/connectivity/source/drivers/ado/AResultSet.cxx b/connectivity/source/drivers/ado/AResultSet.cxx index 85ca2b081a07..7e633130d95e 100644 --- a/connectivity/source/drivers/ado/AResultSet.cxx +++ b/connectivity/source/drivers/ado/AResultSet.cxx @@ -927,11 +927,9 @@ Sequence< sal_Int32 > SAL_CALL OResultSet::deleteRows( const Sequence< Any >& ro rgsabound[0].cElements = rows.getLength(); SAFEARRAY *psa = SafeArrayCreate( VT_VARIANT, 1, rgsabound ); - const Any* pBegin = rows.getConstArray(); - const Any* pEnd = pBegin + rows.getLength(); - for(sal_Int32 i=0;pBegin != pEnd ;++pBegin,++i) + for (sal_Int32 i = 0; i < rows.getLength(); ++i) { - *pBegin >>= nPos; + rows[i] >>= nPos; SafeArrayPutElement(psa,&i,&m_aBookmarks[nPos]); } diff --git a/connectivity/source/drivers/ado/Aolevariant.cxx b/connectivity/source/drivers/ado/Aolevariant.cxx index c082c1987ff0..75591468be36 100644 --- a/connectivity/source/drivers/ado/Aolevariant.cxx +++ b/connectivity/source/drivers/ado/Aolevariant.cxx @@ -117,12 +117,10 @@ OLEVariant::OLEVariant(const css::uno::Sequence< sal_Int8 >& x) vt = VT_ARRAY|VT_UI1; parray = SafeArrayCreateVector(VT_UI1, 0, x.getLength()); - const sal_Int8* pBegin = x.getConstArray(); - const sal_Int8* pEnd = pBegin + x.getLength(); - for(sal_Int32 i=0;pBegin != pEnd;++i,++pBegin) + for (sal_Int32 i = 0; i < x.getLength(); ++i) { - sal_Int32 nData = *pBegin; + sal_Int32 nData = x[i]; HRESULT rs = SafeArrayPutElement(parray,&i,&nData); OSL_ENSURE(S_OK == rs,"Error while copy byte data"); } diff --git a/connectivity/source/drivers/ado/Awrapado.cxx b/connectivity/source/drivers/ado/Awrapado.cxx index eebdc5d8c5a7..fe2e7e344857 100644 --- a/connectivity/source/drivers/ado/Awrapado.cxx +++ b/connectivity/source/drivers/ado/Awrapado.cxx @@ -1821,13 +1821,11 @@ ADORecordset* WpADOConnection::getTables( const css::uno::Any& catalog, ++nPos; OUStringBuffer aTypes; - const OUString* pIter = types.getConstArray(); - const OUString* pEnd = pIter + types.getLength(); - for( ; pIter != pEnd ; ++pIter) + for (auto& type : types) { if ( aTypes.getLength() ) aTypes.append(","); - aTypes.append(*pIter); + aTypes.append(type); } OUString sTypeNames = aTypes.makeStringAndClear(); |