summaryrefslogtreecommitdiff
path: root/i18npool/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-12-28 17:56:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-12-29 16:42:33 +0100
commit042033f1e6da22616cb76c8d950c20c9efecbad5 (patch)
tree26b3f1f42d067506f44550b410f3fb9640616a5b /i18npool/source
parentccfd8e9d09f9ac0a0ea92d0f378391006faaf934 (diff)
loplugin:stringviewparam: operator +
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'i18npool/source')
-rw-r--r--i18npool/source/indexentry/indexentrysupplier.cxx12
-rw-r--r--i18npool/source/nativenumber/nativenumbersupplier.cxx8
2 files changed, 11 insertions, 9 deletions
diff --git a/i18npool/source/indexentry/indexentrysupplier.cxx b/i18npool/source/indexentry/indexentrysupplier.cxx
index f98856ee2227..9fa060ee3c85 100644
--- a/i18npool/source/indexentry/indexentrysupplier.cxx
+++ b/i18npool/source/indexentry/indexentrysupplier.cxx
@@ -93,10 +93,10 @@ OUString SAL_CALL IndexEntrySupplier::getIndexCharacter( const OUString& rIndexE
getIndexCharacter( rIndexEntry, rLocale, rSortAlgorithm );
}
-bool IndexEntrySupplier::createLocaleSpecificIndexEntrySupplier(const OUString& name)
+bool IndexEntrySupplier::createLocaleSpecificIndexEntrySupplier(std::u16string_view name)
{
Reference < XInterface > xI = m_xContext->getServiceManager()->createInstanceWithContext(
- "com.sun.star.i18n.IndexEntrySupplier_" + name, m_xContext);
+ OUString::Concat("com.sun.star.i18n.IndexEntrySupplier_") + name, m_xContext);
if ( xI.is() ) {
xIES.set( xI, UNO_QUERY );
@@ -129,13 +129,15 @@ IndexEntrySupplier::getLocaleSpecificIndexEntrySupplier(const Locale& rLocale, c
// Load service with name <base>_<lang>_<country>_<algorithm>
// or <base>_<bcp47>_<algorithm> and fallbacks.
bLoaded = createLocaleSpecificIndexEntrySupplier(
- LocaleDataImpl::getFirstLocaleServiceName( rLocale) + "_" + aSortAlgorithm);
+ OUString(
+ LocaleDataImpl::getFirstLocaleServiceName( rLocale) + "_"
+ + aSortAlgorithm));
if (!bLoaded)
{
::std::vector< OUString > aFallbacks( LocaleDataImpl::getFallbackLocaleServiceNames( rLocale));
for (auto const& fallback : aFallbacks)
{
- bLoaded = createLocaleSpecificIndexEntrySupplier(fallback + "_" + aSortAlgorithm);
+ bLoaded = createLocaleSpecificIndexEntrySupplier(OUString(fallback + "_" + aSortAlgorithm));
if (bLoaded)
break;
}
@@ -149,7 +151,7 @@ IndexEntrySupplier::getLocaleSpecificIndexEntrySupplier(const Locale& rLocale, c
if (!bLoaded)
{
// load default service with name <base>_Unicode
- bLoaded = createLocaleSpecificIndexEntrySupplier( "Unicode");
+ bLoaded = createLocaleSpecificIndexEntrySupplier( u"Unicode");
if (!bLoaded)
{
throw RuntimeException(); // could not load any service
diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx
index a745396782df..a854d279f7bf 100644
--- a/i18npool/source/nativenumber/nativenumbersupplier.cxx
+++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx
@@ -565,7 +565,7 @@ Separators getLocaleSeparators(const Locale& rLocale, const OUString& rLocStr)
}
OUString getNumberText(const Locale& rLocale, const OUString& rNumberString,
- const OUString& sNumberTextParams)
+ std::u16string_view sNumberTextParams)
{
sal_Int32 i, count = 0;
const sal_Int32 len = rNumberString.getLength();
@@ -605,8 +605,8 @@ OUString getNumberText(const Locale& rLocale, const OUString& rNumberString,
= css::linguistic2::NumberText::create(comphelper::getProcessComponentContext());
OUString numbertext_prefix;
// default "cardinal" gets empty prefix
- if (!sNumberTextParams.isEmpty() && sNumberTextParams != "cardinal")
- numbertext_prefix = sNumberTextParams + " ";
+ if (!sNumberTextParams.empty() && sNumberTextParams != u"cardinal")
+ numbertext_prefix = OUString::Concat(sNumberTextParams) + " ";
// Several hundreds of headings could result typing lags because
// of the continuous update of the multiple number names during typing.
// We fix this by buffering the result of the conversion.
@@ -673,7 +673,7 @@ OUString NativeNumberSupplierService::getNativeNumberString(const OUString& aNum
if (nStripCase > 0 && (rNativeNumberParams.getLength() == nStripCase ||
rNativeNumberParams[nStripCase++] == ' '))
{
- OUString aStr = getNumberText(rLocale, aNumberString, rNativeNumberParams.copy(nStripCase));
+ OUString aStr = getNumberText(rLocale, aNumberString, rNativeNumberParams.subView(nStripCase));
if (!xCharClass.is())
xCharClass = CharacterClassification::create(comphelper::getProcessComponentContext());