summaryrefslogtreecommitdiffstats
path: root/editeng
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 /editeng
parenttdf#120993 update Add fields icon in colibre (diff)
downloadcore-70519a43e0d89a6b5d89859a6851f8c757c6b0c7.tar.gz
core-70519a43e0d89a6b5d89859a6851f8c757c6b0c7.zip
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 'editeng')
-rw-r--r--editeng/source/editeng/editdoc.cxx3
-rw-r--r--editeng/source/misc/svxacorr.cxx5
2 files changed, 5 insertions, 3 deletions
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 86e4b53fced9..d19542ddc056 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -65,6 +65,7 @@
#include <limits>
#include <memory>
#include <set>
+#include <string_view>
using namespace ::com::sun::star;
@@ -1642,7 +1643,7 @@ OUString ContentNode::GetExpandedText(sal_Int32 nStartPos, sal_Int32 nEndPos) co
DBG_ASSERT( nEnd >= nIndex, "End in front of the index?" );
//!! beware of sub string length of -1
if (nEnd > nIndex)
- aStr.appendCopy( GetString(), nIndex, nEnd - nIndex );
+ aStr.append( std::u16string_view(GetString()).substr(nIndex, nEnd - nIndex) );
if ( pNextFeature )
{
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index c6cb322d58b0..2ef3ab48523a 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -18,6 +18,7 @@
*/
#include <memory>
+#include <string_view>
#include <sal/config.h>
#include <com/sun/star/io/IOException.hpp>
@@ -2810,12 +2811,12 @@ const SvxAutocorrWord* SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p
nTmp++;
if (nTmp < nSttWdPos)
break; // word delimiter found
- buf.appendCopy(rTxt, nFndPos, nSttWdPos - nFndPos).append(pFnd->GetLong());
+ buf.append(std::u16string_view(rTxt).substr(nFndPos, nSttWdPos - nFndPos)).append(pFnd->GetLong());
nFndPos = nSttWdPos + sTmp.getLength();
}
} while (nSttWdPos != -1);
if (nEndPos - nFndPos > extra_repl)
- buf.appendCopy(rTxt, nFndPos, nEndPos - nFndPos);
+ buf.append(std::u16string_view(rTxt).substr(nFndPos, nEndPos - nFndPos));
aLong = buf.makeStringAndClear();
}
SvxAutocorrWord* pNew = new SvxAutocorrWord(aShort, aLong);