summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-01-11 11:21:46 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-01-11 13:55:14 +0100
commit70519a43e0d89a6b5d89859a6851f8c757c6b0c7 (patch)
treebc1f4a6b6510e3bff75e9dc54eb71e2fa6cfc3c8 /unotools
parenta0210c5c5e8fd47b55567a8b18788d57d2b7decb (diff)
Replace OUStringBuffer::appendCopy with append(std::u16string_view)
...which is more general Change-Id: I94f28f8eda887120cf5f143b4549e0339b60e6a7 Reviewed-on: https://gerrit.libreoffice.org/66155 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/config/configpaths.cxx8
-rw-r--r--unotools/source/i18n/textsearch.cxx5
2 files changed, 9 insertions, 4 deletions
diff --git a/unotools/source/config/configpaths.cxx b/unotools/source/config/configpaths.cxx
index 6625b3d382d4..81d8cb828c6e 100644
--- a/unotools/source/config/configpaths.cxx
+++ b/unotools/source/config/configpaths.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <string_view>
+
#include <unotools/configpaths.hxx>
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
@@ -49,7 +53,7 @@ void lcl_resolveCharEntities(OUString & aLocalString)
OSL_ENSURE(ch,"Configuration path contains '&' that is not part of a valid character escape");
if (ch)
{
- aResult.appendCopy(aLocalString, nStart,nEscapePos-nStart).append(ch);
+ aResult.append(std::u16string_view(aLocalString).substr(nStart,nEscapePos-nStart)).append(ch);
sal_Int32 nEscapeEnd=aLocalString.indexOf(';',nEscapePos);
nStart = nEscapeEnd+1;
@@ -62,7 +66,7 @@ void lcl_resolveCharEntities(OUString & aLocalString)
}
while ( nEscapePos > 0);
- aResult.appendCopy(aLocalString, nStart);
+ aResult.append(std::u16string_view(aLocalString).substr(nStart));
aLocalString = aResult.makeStringAndClear();
}
diff --git a/unotools/source/i18n/textsearch.cxx b/unotools/source/i18n/textsearch.cxx
index 81768e9d021e..bd0f3f9bcb2e 100644
--- a/unotools/source/i18n/textsearch.cxx
+++ b/unotools/source/i18n/textsearch.cxx
@@ -20,6 +20,7 @@
#include <sal/config.h>
#include <cstdlib>
+#include <string_view>
#include <i18nlangtag/languagetag.hxx>
#include <i18nutil/searchopt.hxx>
@@ -316,7 +317,7 @@ void TextSearch::ReplaceBackReferences( OUString& rReplaceStr, const OUString &r
{
sal_Int32 nStart = rResult.startOffset[0];
sal_Int32 nLength = rResult.endOffset[0] - rResult.startOffset[0];
- sBuff.appendCopy(rStr, nStart, nLength);
+ sBuff.append(std::u16string_view(rStr).substr(nStart, nLength));
}
else if((i < rReplaceStr.getLength() - 1) && rReplaceStr[i] == '$')
{
@@ -353,7 +354,7 @@ void TextSearch::ReplaceBackReferences( OUString& rReplaceStr, const OUString &r
nSttReg = rResult.endOffset[j];
}
// Copy reference from found string
- sBuff.appendCopy(rStr, nSttReg, nRegLen);
+ sBuff.append(std::u16string_view(rStr).substr(nSttReg, nRegLen));
}
i += 1;
}