summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/inc/indexentrysupplier.hxx6
-rw-r--r--i18npool/source/indexentry/indexentrysupplier.cxx12
-rw-r--r--i18npool/source/nativenumber/nativenumbersupplier.cxx8
3 files changed, 16 insertions, 10 deletions
diff --git a/i18npool/inc/indexentrysupplier.hxx b/i18npool/inc/indexentrysupplier.hxx
index 6a441f3f91e2..44056d32ced2 100644
--- a/i18npool/inc/indexentrysupplier.hxx
+++ b/i18npool/inc/indexentrysupplier.hxx
@@ -19,6 +19,10 @@
#ifndef INCLUDED_I18NPOOL_INC_INDEXENTRYSUPPLIER_HXX
#define INCLUDED_I18NPOOL_INC_INDEXENTRYSUPPLIER_HXX
+#include <sal/config.h>
+
+#include <string_view>
+
#include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp>
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -77,7 +81,7 @@ private:
css::uno::Reference < css::i18n::XExtendedIndexEntrySupplier > xIES;
css::uno::Reference < css::uno::XComponentContext > m_xContext;
/// @throws css::uno::RuntimeException
- bool createLocaleSpecificIndexEntrySupplier(const OUString& name);
+ bool createLocaleSpecificIndexEntrySupplier(std::u16string_view name);
/// @throws css::uno::RuntimeException
css::uno::Reference < css::i18n::XExtendedIndexEntrySupplier > const & getLocaleSpecificIndexEntrySupplier(
const css::lang::Locale& rLocale, const OUString& rSortAlgorithm);
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());