From 14f6700fefa945c4cf995c09af9326c2a022f886 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 13 Apr 2022 20:44:55 +0200 Subject: 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 --- editeng/source/misc/svxacorr.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'editeng') 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 SvxAutoCorrect::GetChunkForAutoText(const OUString& rTxt, +std::vector SvxAutoCorrect::GetChunkForAutoText(std::u16string_view rTxt, const sal_Int32 nPos) { constexpr sal_Int32 nMinLen = 3; @@ -1761,7 +1761,7 @@ std::vector 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) -- cgit