diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-12-22 14:08:08 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-12-27 11:26:32 +0100 |
commit | 9013dc1650aa8400f63da5f584df9058b1740eb3 (patch) | |
tree | a1ba4f196070459d5d823d942e5a0a121b09ea3d /i18npool | |
parent | db97e00893c204226a2eab2d95c9837bce3cddb0 (diff) |
Simplify loplugin:stringviewparam comparison operator handling
In practice, it works fine to look at all of them, regardless of actual argument
types.
Change-Id: Ifc49cbcd6003c8837c1b3f81d432c59fb0657bf1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108366
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/inc/indexentrysupplier_default.hxx | 3 | ||||
-rw-r--r-- | i18npool/inc/localedata.hxx | 12 | ||||
-rw-r--r-- | i18npool/source/indexentry/indexentrysupplier_default.cxx | 2 | ||||
-rw-r--r-- | i18npool/source/localedata/localedata.cxx | 10 |
4 files changed, 15 insertions, 12 deletions
diff --git a/i18npool/inc/indexentrysupplier_default.hxx b/i18npool/inc/indexentrysupplier_default.hxx index 29fe3cdbf214..f45dd8f8b2d3 100644 --- a/i18npool/inc/indexentrysupplier_default.hxx +++ b/i18npool/inc/indexentrysupplier_default.hxx @@ -22,6 +22,7 @@ #include "indexentrysupplier_common.hxx" #include <memory> +#include <string_view> namespace i18npool { @@ -85,7 +86,7 @@ public: void init(const css::lang::Locale& rLocale, const OUString& algorithm); /// @throws css::uno::RuntimeException - void makeIndexKeys(const css::lang::Locale &rLocale, const OUString &algorithm); + void makeIndexKeys(const css::lang::Locale &rLocale, std::u16string_view algorithm); sal_Int16 getIndexWeight(const OUString& rIndexEntry); OUString getIndexDescription(const OUString& rIndexEntry); diff --git a/i18npool/inc/localedata.hxx b/i18npool/inc/localedata.hxx index 19933376776f..327e9c196bc7 100644 --- a/i18npool/inc/localedata.hxx +++ b/i18npool/inc/localedata.hxx @@ -31,6 +31,7 @@ #include <rtl/ref.hxx> #include <rtl/ustring.hxx> #include <vector> +#include <string_view> #include <memory> #include <osl/module.hxx> @@ -79,7 +80,7 @@ public: virtual css::uno::Sequence< css::i18n::FormatElement > SAL_CALL getAllFormats( const css::lang::Locale& rLocale ) override; virtual css::uno::Sequence< css::i18n::Implementation > SAL_CALL getCollatorImplementations( const css::lang::Locale& rLocale ) override; /// @throws css::uno::RuntimeException - OUString getCollatorRuleByAlgorithm( const css::lang::Locale& rLocale, const OUString& algorithm ); + OUString getCollatorRuleByAlgorithm( const css::lang::Locale& rLocale, std::u16string_view algorithm ); virtual css::uno::Sequence< OUString > SAL_CALL getTransliterations( const css::lang::Locale& rLocale ) override; virtual css::i18n::ForbiddenCharacters SAL_CALL getForbiddenCharacters( const css::lang::Locale& rLocale ) override; virtual css::uno::Sequence< OUString > SAL_CALL getReservedWord( const css::lang::Locale& rLocale ) override ; @@ -106,9 +107,10 @@ public: /// @throws css::uno::RuntimeException OUString getDefaultIndexAlgorithm( const css::lang::Locale& rLocale ); /// @throws css::uno::RuntimeException - OUString getIndexKeysByAlgorithm( const css::lang::Locale& rLocale, const OUString& algorithm ); + OUString getIndexKeysByAlgorithm( + const css::lang::Locale& rLocale, std::u16string_view algorithm ); /// @throws css::uno::RuntimeException - OUString getIndexModuleByAlgorithm( const css::lang::Locale& rLocale, const OUString& algorithm ); + OUString getIndexModuleByAlgorithm( const css::lang::Locale& rLocale, std::u16string_view algorithm ); /// @throws css::uno::RuntimeException css::uno::Sequence< css::i18n::UnicodeScript > getUnicodeScripts( const css::lang::Locale& rLocale ); /// @throws css::uno::RuntimeException @@ -116,7 +118,7 @@ public: /// @throws css::uno::RuntimeException bool hasPhonetic( const css::lang::Locale& rLocale ); /// @throws css::uno::RuntimeException - bool isPhonetic( const css::lang::Locale& rLocale, const OUString& algorithm ); + bool isPhonetic( const css::lang::Locale& rLocale, std::u16string_view algorithm ); /// @throws css::uno::RuntimeException OUString getHangingCharacters( const css::lang::Locale& rLocale ); @@ -133,7 +135,7 @@ private: /// @throws css::uno::RuntimeException oslGenericFunction getFunctionSymbol( const css::lang::Locale& rLocale, const char* pFunction ); sal_Unicode ** getIndexArray(const css::lang::Locale& rLocale, sal_Int16& indexCount); - sal_Unicode ** getIndexArrayForAlgorithm(const css::lang::Locale& rLocale, const OUString& rAlgorithm); + sal_Unicode ** getIndexArrayForAlgorithm(const css::lang::Locale& rLocale, std::u16string_view rAlgorithm); /// @throws css::uno::RuntimeException css::uno::Sequence< css::i18n::CalendarItem2 > & getCalendarItemByName(const OUString& name, diff --git a/i18npool/source/indexentry/indexentrysupplier_default.cxx b/i18npool/source/indexentry/indexentrysupplier_default.cxx index 399b19b17382..519c99ce860e 100644 --- a/i18npool/source/indexentry/indexentrysupplier_default.cxx +++ b/i18npool/source/indexentry/indexentrysupplier_default.cxx @@ -165,7 +165,7 @@ OUString Index::getIndexDescription(const OUString& rIndexEntry) #define LOCALE_EN lang::Locale("en", OUString(), OUString()) -void Index::makeIndexKeys(const lang::Locale &rLocale, const OUString &algorithm) +void Index::makeIndexKeys(const lang::Locale &rLocale, std::u16string_view algorithm) { OUString keyStr = LocaleDataImpl::get()->getIndexKeysByAlgorithm(rLocale, algorithm); diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx index ac4950741129..273415d9461e 100644 --- a/i18npool/source/localedata/localedata.cxx +++ b/i18npool/source/localedata/localedata.cxx @@ -922,7 +922,7 @@ LocaleDataImpl::getDateAcceptancePatterns( const Locale& rLocale ) #define COLLATOR_ELEMENTS 3 OUString -LocaleDataImpl::getCollatorRuleByAlgorithm( const Locale& rLocale, const OUString& algorithm ) +LocaleDataImpl::getCollatorRuleByAlgorithm( const Locale& rLocale, std::u16string_view algorithm ) { MyFunc_Type func = reinterpret_cast<MyFunc_Type>(getFunctionSymbol( rLocale, "getCollatorImplementation" )); if ( func ) { @@ -1059,7 +1059,7 @@ LocaleDataImpl::hasPhonetic( const Locale& rLocale ) } sal_Unicode ** -LocaleDataImpl::getIndexArrayForAlgorithm(const Locale& rLocale, const OUString& algorithm) +LocaleDataImpl::getIndexArrayForAlgorithm(const Locale& rLocale, std::u16string_view algorithm) { sal_Int16 indexCount = 0; sal_Unicode **indexArray = getIndexArray(rLocale, indexCount); @@ -1073,21 +1073,21 @@ LocaleDataImpl::getIndexArrayForAlgorithm(const Locale& rLocale, const OUString& } bool -LocaleDataImpl::isPhonetic( const Locale& rLocale, const OUString& algorithm ) +LocaleDataImpl::isPhonetic( const Locale& rLocale, std::u16string_view algorithm ) { sal_Unicode **indexArray = getIndexArrayForAlgorithm(rLocale, algorithm); return indexArray && indexArray[4][0]; } OUString -LocaleDataImpl::getIndexKeysByAlgorithm( const Locale& rLocale, const OUString& algorithm ) +LocaleDataImpl::getIndexKeysByAlgorithm( const Locale& rLocale, std::u16string_view algorithm ) { sal_Unicode **indexArray = getIndexArrayForAlgorithm(rLocale, algorithm); return indexArray ? (OUString::Concat(u"0-9") + indexArray[2]) : OUString(); } OUString -LocaleDataImpl::getIndexModuleByAlgorithm( const Locale& rLocale, const OUString& algorithm ) +LocaleDataImpl::getIndexModuleByAlgorithm( const Locale& rLocale, std::u16string_view algorithm ) { sal_Unicode **indexArray = getIndexArrayForAlgorithm(rLocale, algorithm); return indexArray ? OUString(indexArray[1]) : OUString(); |