diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-01 20:34:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-03 09:12:32 +0200 |
commit | ddef1e2c017b7d8e421dedc1a0ce722ff4208985 (patch) | |
tree | 54e52c86e4e33bcb61eee44706117b1616e99624 /i18npool | |
parent | 0a6d946694e4fcb39228c5e1fec58fcfd8a45989 (diff) |
add o3tl::equalsAscii
Change-Id: I042b8dcadbf7581de325c161763fe35aecde5ca2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133694
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/inc/transliterationImpl.hxx | 2 | ||||
-rw-r--r-- | i18npool/source/transliteration/transliterationImpl.cxx | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/i18npool/inc/transliterationImpl.hxx b/i18npool/inc/transliterationImpl.hxx index 95c5fa2a088f..57441067346a 100644 --- a/i18npool/inc/transliterationImpl.hxx +++ b/i18npool/inc/transliterationImpl.hxx @@ -91,7 +91,7 @@ private: css::uno::Reference< css::i18n::XExtendedTransliteration > caseignore; /// @throws css::uno::RuntimeException - bool loadModuleByName( const OUString& implName, + bool loadModuleByName( std::u16string_view implName, css::uno::Reference<css::i18n::XExtendedTransliteration> & body, const css::lang::Locale& rLocale); void clear(); diff --git a/i18npool/source/transliteration/transliterationImpl.cxx b/i18npool/source/transliteration/transliterationImpl.cxx index c85d16442341..d397279435ce 100644 --- a/i18npool/source/transliteration/transliterationImpl.cxx +++ b/i18npool/source/transliteration/transliterationImpl.cxx @@ -27,6 +27,7 @@ #include <comphelper/sequence.hxx> #include <cppuhelper/supportsservice.hxx> +#include <o3tl/string_view.hxx> #include <rtl/ustring.hxx> #include <algorithm> @@ -203,11 +204,11 @@ TransliterationImpl::loadModule( TransliterationModules modType, const Locale& r // additional transliterations from TransliterationModulesExtra (we cannot extend TransliterationModules) if (bool(modType & TransliterationModules(TransliterationModulesExtra::IGNORE_DIACRITICS_CTL))) { - if (loadModuleByName("ignoreDiacritics_CTL", bodyCascade[numCascade], rLocale)) + if (loadModuleByName(u"ignoreDiacritics_CTL", bodyCascade[numCascade], rLocale)) numCascade++; } if (bool(modType & TransliterationModules(TransliterationModulesExtra::IGNORE_KASHIDA_CTL))) - if (loadModuleByName("ignoreKashida_CTL", bodyCascade[numCascade], rLocale)) + if (loadModuleByName(u"ignoreKashida_CTL", bodyCascade[numCascade], rLocale)) numCascade++; } else if (bool(modType & TransliterationModules_NON_IGNORE_MASK)) { @@ -600,17 +601,17 @@ void TransliterationImpl::loadBody( OUString const &implName, Reference<XExtende } bool -TransliterationImpl::loadModuleByName( const OUString& implName, +TransliterationImpl::loadModuleByName( std::u16string_view implName, Reference<XExtendedTransliteration>& body, const Locale& rLocale) { - OUString cname = TRLT_IMPLNAME_PREFIX + implName; + OUString cname = OUString::Concat(TRLT_IMPLNAME_PREFIX) + implName; loadBody(cname, body); if (body.is()) { body->loadModule(TransliterationModules(0), rLocale); // toUpper/toLoad need rLocale // if the module is ignore case/kana/width, load caseignore for equals/compareString mothed for (sal_Int16 i = 0; i < 3; i++) { - if (implName.equalsAscii(TMlist[i].implName)) { + if (o3tl::equalsAscii(implName, TMlist[i].implName)) { if (i == 0) // current module is caseignore body->loadModule(TMlist[0].tm, rLocale); // caseignore need to setup module name if (! caseignore.is()) { |