summaryrefslogtreecommitdiff
path: root/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-10-29 10:27:52 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-11-01 07:44:25 +0100
commitcae7b855a5fd479e6df822f974870f42e91ce068 (patch)
tree43021b16d679f1b15c8ffb84f4d4d906f366c482 /xmlhelp/source/cxxhelp/provider/urlparameter.cxx
parent38979c6abd4bcac13e9674187e73ccf675fbaf55 (diff)
Prepare for removal of non-const operator[] from Sequence in xmlhelp
Change-Id: I58c6fd9abf53a9ce3b16a31e7452bb5cb895e669 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124415 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'xmlhelp/source/cxxhelp/provider/urlparameter.cxx')
-rw-r--r--xmlhelp/source/cxxhelp/provider/urlparameter.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
index 0474bc5738fa..9393692b7656 100644
--- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
+++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
@@ -41,6 +41,7 @@
#include "urlparameter.hxx"
#include "databases.hxx"
+#include <algorithm>
#include <memory>
#include <mutex>
@@ -914,8 +915,8 @@ sal_Int32 SAL_CALL InputStreamTransformer::readBytes( Sequence< sal_Int8 >& aDat
if( 0 <= curr && aData.getLength() < curr )
aData.realloc( curr );
- for( int k = 0; k < curr; ++k )
- aData[k] = buffer[pos++];
+ std::copy_n(buffer.getStr() + pos, curr, aData.getArray());
+ pos += curr;
return std::max(curr, 0);
}