summaryrefslogtreecommitdiff
path: root/unotools/source/i18n/textsearch.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'unotools/source/i18n/textsearch.cxx')
-rw-r--r--unotools/source/i18n/textsearch.cxx5
1 files changed, 3 insertions, 2 deletions
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;
}