diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-11-12 08:13:40 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-11-12 16:53:30 +0100 |
commit | f34ac579fac16fff37bf00fe85d43ad6b938eca7 (patch) | |
tree | 0747c4d86bbf40a5093fb7a3215dd52a8e8586b2 /editeng | |
parent | c45753847dfc2b4645dc2f7500a18ec2c5d438df (diff) |
New loplugin:stringviewparam
...to "Find functions that take rtl::O[U]String parameters that can be
generalized to take std::[u16]string_view instead." (Which in turn can avoid
costly O[U]String constructions, see e.g. loplugin:stringview and subView.)
Some of those functions' call sites, passing plain char string literals, needed
to be adapted when converting them.
Change-Id: I644ab546d7a0ce9e470ab9b3196e3e60d1e812bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105622
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 4 | ||||
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index a490f3fa39e4..2c83c1165856 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -66,7 +66,7 @@ #include <unicode/ubidi.h> #include <algorithm> #include <memory> - +#include <string_view> #include <fstream> using namespace ::com::sun::star; @@ -1597,7 +1597,7 @@ bool ImpEditEngine::IsInputSequenceCheckingRequired( sal_Unicode nChar, const Ed return bIsSequenceChecking; } -static bool lcl_HasStrongLTR ( const OUString& rTxt, sal_Int32 nStart, sal_Int32 nEnd ) +static bool lcl_HasStrongLTR ( std::u16string_view rTxt, sal_Int32 nStart, sal_Int32 nEnd ) { for( sal_Int32 nCharIdx = nStart; nCharIdx < nEnd; ++nCharIdx ) { diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 70ff36c5594f..feab628d7f04 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -1279,7 +1279,7 @@ OUString SvxAutoCorrect::GetQuote( SvxAutoCorrDoc const & rDoc, sal_Int32 nInsPo } // search preceding opening quote in the paragraph before the insert position -static bool lcl_HasPrecedingChar( const OUString& rTxt, sal_Int32 nPos, +static bool lcl_HasPrecedingChar( std::u16string_view rTxt, sal_Int32 nPos, const sal_Unicode sPrecedingChar, const sal_Unicode* aStopChars ) { sal_Unicode cTmpChar; |