summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-08-28 17:14:50 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-08-30 20:42:56 +0200
commit2e21240f23ac2191a3535d697a7308b29303c67c (patch)
tree89f6e634912c2d1d476cddb2550e7368b10427b9 /i18npool
parent6379f799704935a571a4b3af44cabd0671c48dbe (diff)
Goodbye O[U]StringView, welcome O[U]String::Concat
O[U]StringView had an odd mixture of uses. For one, it was used like std::[u16]string_view, for which directly using the latter std types is clearly the better alternative. For another, it was used in concatenation sequences, when neither of the two leading terms were of our rtl string-related types. For that second use case introduce O[U]String::Concat (as std::[u16]string_view can obviously not be used, those not being one of our rtl string-related types). Also, O[U]StringLiteral is occasionally used for this, but the planned changes outlined in the 33ecd0d5c4fff9511a8436513936a3f7044a775a "Change OUStringLiteral from char[] to char16_t[]" commit message will make that no longer work, so O[U]String::Concat will be the preferred solution in such use cases going forward, too. O[U]StringView was also occasionally used to include O[U]StringBuffer values in concatenation sequences, for which a more obvious alternative is to make O[U]StringBuffer participate directly in the ToStringHelper/O[U]StringConcat machinery. Change-Id: I1f0e8d836796c9ae01c45f32c518be5f52976622 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101586 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/source/breakiterator/breakiterator_unicode.cxx2
-rw-r--r--i18npool/source/breakiterator/xdictionary.cxx4
-rw-r--r--i18npool/source/localedata/localedata.cxx10
3 files changed, 8 insertions, 8 deletions
diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx b/i18npool/source/breakiterator/breakiterator_unicode.cxx
index 7c79b99ec028..bb8d7d9862aa 100644
--- a/i18npool/source/breakiterator/breakiterator_unicode.cxx
+++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx
@@ -199,7 +199,7 @@ void BreakIterator_Unicode::loadICUBreakIterator(const css::lang::Locale& rLocal
}
status = U_ZERO_ERROR;
- OString aUDName = rtl::OStringView(rule) + "_" + aLanguage;
+ OString aUDName = OString::Concat(rule) + "_" + aLanguage;
UDataMemory* pUData = udata_open("OpenOffice", "brk", aUDName.getStr(), &status);
if( U_SUCCESS(status) )
rbi = std::make_shared<OOoRuleBasedBreakIterator>( pUData, status);
diff --git a/i18npool/source/breakiterator/xdictionary.cxx b/i18npool/source/breakiterator/xdictionary.cxx
index a57a3b0d4a4d..e8d732c882b2 100644
--- a/i18npool/source/breakiterator/xdictionary.cxx
+++ b/i18npool/source/breakiterator/xdictionary.cxx
@@ -166,11 +166,11 @@ void xdictionary::initDictionaryData(const char *pLang)
#ifdef SAL_DLLPREFIX
OString sModuleName = // mostly "lib*.so" (with * == dict_zh)
- SAL_DLLPREFIX
+ OString::Concat(SAL_DLLPREFIX "dict_") + pLang + SAL_DLLEXTENSION;
#else
OString sModuleName = // mostly "*.dll" (with * == dict_zh)
+ OString::Concat("dict_") + pLang + SAL_DLLEXTENSION;
#endif
- "dict_" + rtl::OStringView(pLang) + SAL_DLLEXTENSION;
aEntry.mhModule = osl_loadModuleRelativeAscii( &thisModule, sModuleName.getStr(), SAL_LOADMODULE_DEFAULT );
if( aEntry.mhModule ) {
oslGenericFunction func;
diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx
index d98a2e840460..61d04abbdfc0 100644
--- a/i18npool/source/localedata/localedata.cxx
+++ b/i18npool/source/localedata/localedata.cxx
@@ -550,7 +550,7 @@ oslGenericFunction lcl_LookupTableHelper::getFunctionSymbolByName(
{
(*pOutCachedItem).reset(new LocaleDataLookupTableItem( rCurrent ));
(*pOutCachedItem)->localeName = i.pLocale;
- OString sSymbolName = rtl::OStringView(pFunction) + "_" +
+ OString sSymbolName = OString::Concat(pFunction) + "_" +
(*pOutCachedItem)->localeName;
return (*pOutCachedItem)->module->getFunctionSymbol(
sSymbolName.getStr());
@@ -563,10 +563,10 @@ oslGenericFunction lcl_LookupTableHelper::getFunctionSymbolByName(
// Library not loaded, load it and add it to the list.
#ifdef SAL_DLLPREFIX
OString sModuleName = // mostly "lib*.so"
- SAL_DLLPREFIX + rtl::OStringView(i.pLib) + SAL_DLLEXTENSION;
+ OString::Concat(SAL_DLLPREFIX) + i.pLib + SAL_DLLEXTENSION;
#else
OString sModuleName = // mostly "*.dll"
- rtl::OStringView(i.pLib) + SAL_DLLEXTENSION;
+ OString::Concat(i.pLib) + SAL_DLLEXTENSION;
#endif
std::unique_ptr<osl::Module> module(new osl::Module());
if ( module->loadRelative(&thisModule, sModuleName.getStr()) )
@@ -578,7 +578,7 @@ oslGenericFunction lcl_LookupTableHelper::getFunctionSymbolByName(
if( pOutCachedItem )
{
pOutCachedItem->reset(new LocaleDataLookupTableItem( maLookupTable.back() ));
- OString sSymbolName = rtl::OStringView(pFunction) + "_" + (*pOutCachedItem)->localeName;
+ OString sSymbolName = OString::Concat(pFunction) + "_" + (*pOutCachedItem)->localeName;
return pTmpModule->getFunctionSymbol(sSymbolName.getStr());
}
else
@@ -1436,7 +1436,7 @@ oslGenericFunction LocaleDataImpl::getFunctionSymbol( const Locale& rLocale, con
if (cachedItem && cachedItem->equals(rLocale))
{
- OString sSymbolName = rtl::OStringView(pFunction) + "_" +
+ OString sSymbolName = OString::Concat(pFunction) + "_" +
cachedItem->localeName;
return cachedItem->module->getFunctionSymbol(sSymbolName.getStr());
}