diff options
author | Noel <noelgrandin@gmail.com> | 2020-11-13 14:29:59 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-17 09:57:35 +0100 |
commit | 8ef6067596cf4b2c52fbce94b44bf7af9fefa643 (patch) | |
tree | f4cca1a99ba97683b14fa6fe0f1f45f75bf855c2 /unotools | |
parent | 75bada928cf08d2afc6efe52ba99b45088bc9eec (diff) |
loplugin:stringviewparam check methods too
not just functions
Change-Id: Icca295dd159002b428b73f2c95d40725434f04d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105789
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/i18n/localedatawrapper.cxx | 4 | ||||
-rw-r--r-- | unotools/source/i18n/textsearch.cxx | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx index c900de4452c5..3d3bee0d4892 100644 --- a/unotools/source/i18n/localedatawrapper.cxx +++ b/unotools/source/i18n/localedatawrapper.cxx @@ -488,9 +488,9 @@ void LocaleDataWrapper::getSecondaryCalendarImpl() } } -bool LocaleDataWrapper::doesSecondaryCalendarUseEC( const OUString& rName ) const +bool LocaleDataWrapper::doesSecondaryCalendarUseEC( std::u16string_view rName ) const { - if (rName.isEmpty()) + if (rName.empty()) return false; // Check language tag first to avoid loading all calendars of this locale. diff --git a/unotools/source/i18n/textsearch.cxx b/unotools/source/i18n/textsearch.cxx index b6c71aa25c1e..aae6cc573634 100644 --- a/unotools/source/i18n/textsearch.cxx +++ b/unotools/source/i18n/textsearch.cxx @@ -304,7 +304,7 @@ bool TextSearch::SearchBackward( const OUString & rStr, sal_Int32* pStart, return bRet; } -void TextSearch::ReplaceBackReferences( OUString& rReplaceStr, const OUString &rStr, const SearchResult& rResult ) const +void TextSearch::ReplaceBackReferences( OUString& rReplaceStr, std::u16string_view rStr, const SearchResult& rResult ) const { if( rResult.subRegExpressions <= 0 ) return; @@ -318,7 +318,7 @@ void TextSearch::ReplaceBackReferences( OUString& rReplaceStr, const OUString &r { sal_Int32 nStart = rResult.startOffset[0]; sal_Int32 nLength = rResult.endOffset[0] - rResult.startOffset[0]; - sBuff.append(std::u16string_view(rStr).substr(nStart, nLength)); + sBuff.append(rStr.substr(nStart, nLength)); } else if((i < rReplaceStr.getLength() - 1) && rReplaceStr[i] == '$') { @@ -355,7 +355,7 @@ void TextSearch::ReplaceBackReferences( OUString& rReplaceStr, const OUString &r nSttReg = rResult.endOffset[j]; } // Copy reference from found string - sBuff.append(std::u16string_view(rStr).substr(nSttReg, nRegLen)); + sBuff.append(rStr.substr(nSttReg, nRegLen)); } i += 1; } |