diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-29 10:19:55 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-11-01 08:23:16 +0100 |
commit | 5e7e62b937721850ff762c063e9e58c58ce2fb80 (patch) | |
tree | e1646f71285b049e4852abde2b323fe608d0a3fa /ucb/source/cacher | |
parent | cae7b855a5fd479e6df822f974870f42e91ce068 (diff) |
Prepare for removal of non-const operator[] from Sequence in ucb
Change-Id: I16f3de8398323a308e20d04643a11dd9c3ec59f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124404
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'ucb/source/cacher')
-rw-r--r-- | ucb/source/cacher/cachedcontentresultset.cxx | 14 | ||||
-rw-r--r-- | ucb/source/cacher/cachedcontentresultsetstub.cxx | 8 |
2 files changed, 14 insertions, 8 deletions
diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx index 3adfcc45a225..c169a3734b58 100644 --- a/ucb/source/cacher/cachedcontentresultset.cxx +++ b/ucb/source/cacher/cachedcontentresultset.cxx @@ -212,7 +212,7 @@ Any& CachedContentResultSet::CCRS_Cache if( nDiff < 0 ) nDiff *= -1; - return (m_pResult->Rows)[nDiff]; + return m_pResult->Rows.getArray()[nDiff]; } void CachedContentResultSet::CCRS_Cache @@ -226,7 +226,10 @@ void CachedContentResultSet::CCRS_Cache nDiff *= -1; Sequence< sal_Bool >& rMappedReminder = getMappedReminder(); if( nDiff < rMappedReminder.getLength() ) - rMappedReminder[nDiff] = true; + { + sal_Bool* pMappedReminder = rMappedReminder.getArray(); + pMappedReminder[nDiff] = true; + } } bool CachedContentResultSet::CCRS_Cache @@ -449,15 +452,16 @@ CCRS_PropertySetInfo::CCRS_PropertySetInfo( sal_Int32 nOrigProps = aOrigProps.getLength(); m_xProperties->realloc( nOrigProps + 2 - nDeleted );//note that nDeleted is <= 2 + auto pProperties = m_xProperties->getArray(); for( sal_Int32 n = 0, m = 0; n < nOrigProps; n++, m++ ) { if( n == nFetchSize || n == nFetchDirection ) m--; else - (*m_xProperties)[ m ] = aOrigProps[ n ]; + pProperties[ m ] = aOrigProps[ n ]; } { - Property& rMyProp = (*m_xProperties)[ nOrigProps - nDeleted ]; + Property& rMyProp = pProperties[ nOrigProps - nDeleted ]; rMyProp.Name = g_sPropertyNameForFetchSize; rMyProp.Type = cppu::UnoType<sal_Int32>::get(); rMyProp.Attributes = PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT; @@ -471,7 +475,7 @@ CCRS_PropertySetInfo::CCRS_PropertySetInfo( } { - Property& rMyProp = (*m_xProperties)[ nOrigProps - nDeleted + 1 ]; + Property& rMyProp = pProperties[ nOrigProps - nDeleted + 1 ]; rMyProp.Name = g_sPropertyNameForFetchDirection; rMyProp.Type = cppu::UnoType<sal_Bool>::get(); rMyProp.Attributes = PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT; diff --git a/ucb/source/cacher/cachedcontentresultsetstub.cxx b/ucb/source/cacher/cachedcontentresultsetstub.cxx index 19ca0dd060f8..a84d8f98f5bf 100644 --- a/ucb/source/cacher/cachedcontentresultsetstub.cxx +++ b/ucb/source/cacher/cachedcontentresultsetstub.cxx @@ -211,7 +211,7 @@ FetchResult CachedContentResultSetStub::impl_fetchHelper( try { - impl_loadRow( aRet.Rows[0] ); + impl_loadRow( aRet.Rows.getArray()[0] ); } catch( SQLException& ) { @@ -222,6 +222,7 @@ FetchResult CachedContentResultSetStub::impl_fetchHelper( return aRet; } aRet.Rows.realloc( nRowCount ); + auto pRows = aRet.Rows.getArray(); bool bOldOriginal_AfterLast = false; if( !nOldOriginal_Pos ) bOldOriginal_AfterLast = m_xResultSetOrigin->isAfterLast(); @@ -257,7 +258,7 @@ FetchResult CachedContentResultSetStub::impl_fetchHelper( } for( ; nN <= nRowCount; ) { - impl_loadRow( aRet.Rows[nN-1] ); + impl_loadRow( pRows[nN-1] ); nN++; if( nN <= nRowCount ) { @@ -344,9 +345,10 @@ void CachedContentResultSetStub sal_Int32 nCount = impl_getColumnCount(); Sequence< Any > aContent( nCount ); + auto aContentRange = asNonConstRange(aContent); for( sal_Int32 nN = 1; nN <= nCount; nN++ ) { - aContent[nN-1] = xRow->getObject( nN, nullptr ); + aContentRange[nN-1] = xRow->getObject( nN, nullptr ); } rRowContent <<= aContent; |