diff options
Diffstat (limited to 'editeng/source')
-rw-r--r-- | editeng/source/editeng/editdoc.cxx | 3 | ||||
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 5 |
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); |