diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-29 09:54:10 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-30 20:17:13 +0200 |
commit | d0a8d4a973b5ae395b6fa925e27c7a120a324f4a (patch) | |
tree | b2e527a20258a829bffc3918e4a7f81119411bbe /package/source/zipapi | |
parent | ce9611d13ff69306f8c44ac53110cc2cb4116e85 (diff) |
Prepare for removal of non-const operator[] from Sequence in package
Change-Id: Ib5d7fa143c4c5e3b4862ed4b91acf1e2dfc4d8bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124378
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'package/source/zipapi')
-rw-r--r-- | package/source/zipapi/XBufferedThreadedStream.cxx | 3 | ||||
-rw-r--r-- | package/source/zipapi/ZipFile.cxx | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/package/source/zipapi/XBufferedThreadedStream.cxx b/package/source/zipapi/XBufferedThreadedStream.cxx index c36a1845be6c..e2f963bf88c1 100644 --- a/package/source/zipapi/XBufferedThreadedStream.cxx +++ b/package/source/zipapi/XBufferedThreadedStream.cxx @@ -137,6 +137,7 @@ sal_Int32 SAL_CALL XBufferedThreadedStream::readBytes( Sequence< sal_Int8 >& rDa const sal_Int32 nAvailableSize = static_cast< sal_Int32 > ( std::min< sal_Int64 >( nBytesToRead, remainingSize() ) ); rData.realloc( nAvailableSize ); + auto pData = rData.getArray(); sal_Int32 i = 0, nPendingBytes = nAvailableSize; while( nPendingBytes ) @@ -149,7 +150,7 @@ sal_Int32 SAL_CALL XBufferedThreadedStream::readBytes( Sequence< sal_Int8 >& rDa } const sal_Int32 limit = std::min<sal_Int32>( nPendingBytes, pBuffer.getLength() - mnOffset ); - memcpy( &rData[i], &pBuffer[mnOffset], limit ); + memcpy( &pData[i], &pBuffer[mnOffset], limit ); nPendingBytes -= limit; mnOffset += limit; diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index 0869d58931c9..2b298e0ebdf8 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -579,10 +579,11 @@ public: sal_Int32 nReadSize = std::min<sal_Int32>(nBytesToRead, remainingSize()); rData.realloc(nReadSize); + auto pData = rData.getArray(); std::vector<sal_Int8>::const_iterator it = maBytes.cbegin(); std::advance(it, mnPos); for (sal_Int32 i = 0; i < nReadSize; ++i, ++it) - rData[i] = *it; + pData[i] = *it; mnPos += nReadSize; |