diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-13 20:44:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-14 11:24:40 +0200 |
commit | 14f6700fefa945c4cf995c09af9326c2a022f886 (patch) | |
tree | 0905c274bd29ead90d56a96be1313bca234af639 /editeng | |
parent | edadfb564f1334887df473f9bc05dab6b1e7ef9d (diff) |
use more string_view in editeng
Change-Id: I5104dc8ce24089b110f9cd73e0f5e62ad5b44a0a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132983
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index f77cf8821a4a..753e79a8126b 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -543,7 +543,7 @@ bool SvxAutoCorrect::FnChgOrdinalNumber( // Replace dashes bool SvxAutoCorrect::FnChgToEnEmDash( - SvxAutoCorrDoc& rDoc, const OUString& rTxt, + SvxAutoCorrDoc& rDoc, std::u16string_view rTxt, sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang ) { @@ -629,7 +629,7 @@ bool SvxAutoCorrect::FnChgToEnEmDash( bool bEnDash = (eLang == LANGUAGE_HUNGARIAN || eLang == LANGUAGE_FINNISH); if( 4 <= nEndPos - nSttPos ) { - OUString sTmp( rTxt.copy( nSttPos, nEndPos - nSttPos ) ); + OUString sTmp( rTxt.substr( nSttPos, nEndPos - nSttPos ) ); sal_Int32 nFndPos = sTmp.indexOf("--"); if( nFndPos != -1 && nFndPos && nFndPos + 2 < sTmp.getLength() && @@ -1744,7 +1744,7 @@ OUString SvxAutoCorrect::GetPrevAutoCorrWord(SvxAutoCorrDoc const& rDoc, const O } // static -std::vector<OUString> SvxAutoCorrect::GetChunkForAutoText(const OUString& rTxt, +std::vector<OUString> SvxAutoCorrect::GetChunkForAutoText(std::u16string_view rTxt, const sal_Int32 nPos) { constexpr sal_Int32 nMinLen = 3; @@ -1761,7 +1761,7 @@ std::vector<OUString> SvxAutoCorrect::GetChunkForAutoText(const OUString& rTxt, } if (nBegin + nMinLen <= nPos) { - OUString sRes = rTxt.copy(nBegin, nPos - nBegin); + OUString sRes( rTxt.substr(nBegin, nPos - nBegin) ); aRes.push_back(sRes); bool bLastStartedWithDelim = IsWordDelim(sRes[0]); for (sal_Int32 i = 1; i <= sRes.getLength() - nMinLen; ++i) |