diff options
Diffstat (limited to 'i18npool/source')
18 files changed, 90 insertions, 90 deletions
diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx index 51f191326e5f..0f23a59cc1e9 100644 --- a/i18npool/source/breakiterator/breakiteratorImpl.cxx +++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx @@ -646,12 +646,12 @@ BreakIteratorImpl::getLocaleSpecificBreakIterator(const Locale& rLocale) // load service with name <base>_<lang> createLocaleSpecificBreakIterator(rLocale.Language)) || // load default service with name <base>_Unicode - createLocaleSpecificBreakIterator("Unicode")) { + createLocaleSpecificBreakIterator(u"Unicode"_ustr)) { lookupTable.emplace_back( aLocale, xBI ); return xBI; } } - throw RuntimeException("getLocaleSpecificBreakIterator: iterator not found"); + throw RuntimeException(u"getLocaleSpecificBreakIterator: iterator not found"_ustr); } OUString SAL_CALL diff --git a/i18npool/source/breakiterator/breakiterator_cjk.cxx b/i18npool/source/breakiterator/breakiterator_cjk.cxx index 23706c200594..d674b8649341 100644 --- a/i18npool/source/breakiterator/breakiterator_cjk.cxx +++ b/i18npool/source/breakiterator/breakiterator_cjk.cxx @@ -96,7 +96,7 @@ LineBreakResults SAL_CALL BreakIterator_CJK::getLineBreak( BreakIterator_zh::BreakIterator_zh() { assert(hangingCharacters.pData); - hangingCharacters = LocaleDataImpl::get()->getHangingCharacters(LOCALE("zh", "CN")); + hangingCharacters = LocaleDataImpl::get()->getHangingCharacters(LOCALE(u"zh"_ustr, u"CN"_ustr)); cBreakIterator = u"com.sun.star.i18n.BreakIterator_zh"_ustr; } @@ -106,7 +106,7 @@ BreakIterator_zh::BreakIterator_zh() BreakIterator_zh_TW::BreakIterator_zh_TW() { assert(hangingCharacters.pData); - hangingCharacters = LocaleDataImpl::get()->getHangingCharacters(LOCALE("zh", "TW")); + hangingCharacters = LocaleDataImpl::get()->getHangingCharacters(LOCALE(u"zh"_ustr, u"TW"_ustr)); cBreakIterator = u"com.sun.star.i18n.BreakIterator_zh_TW"_ustr; } @@ -116,7 +116,7 @@ BreakIterator_zh_TW::BreakIterator_zh_TW() BreakIterator_ja::BreakIterator_ja() { assert(hangingCharacters.pData); - hangingCharacters = LocaleDataImpl::get()->getHangingCharacters(LOCALE("ja", "JP")); + hangingCharacters = LocaleDataImpl::get()->getHangingCharacters(LOCALE(u"ja"_ustr, u"JP"_ustr)); cBreakIterator = u"com.sun.star.i18n.BreakIterator_ja"_ustr; } @@ -126,7 +126,7 @@ BreakIterator_ja::BreakIterator_ja() BreakIterator_ko::BreakIterator_ko() { assert(hangingCharacters.pData); - hangingCharacters = LocaleDataImpl::get()->getHangingCharacters(LOCALE("ko", "KR")); + hangingCharacters = LocaleDataImpl::get()->getHangingCharacters(LOCALE(u"ko"_ustr, u"KR"_ustr)); cBreakIterator = u"com.sun.star.i18n.BreakIterator_ko"_ustr; } diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx b/i18npool/source/breakiterator/breakiterator_unicode.cxx index 952a5d5490c0..9b47c433f296 100644 --- a/i18npool/source/breakiterator/breakiterator_unicode.cxx +++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx @@ -290,7 +290,7 @@ void BreakIterator_Unicode::loadICUBreakIterator(const css::lang::Locale& rLocal theBIMap.insert( std::make_pair( aBIMapLocaleTypeKey, icuBI->mpValue)); } while (false); if (!icuBI->mpValue || !icuBI->mpValue->mpBreakIterator) { - throw uno::RuntimeException("ICU BreakIterator is not properly initialized"); + throw uno::RuntimeException(u"ICU BreakIterator is not properly initialized"_ustr); } icuBI->maBIMapKey = aBIMapGlobalKey; if (!bInMap) diff --git a/i18npool/source/calendar/calendarImpl.cxx b/i18npool/source/calendar/calendarImpl.cxx index 1dde59ef2b55..650629cf69cb 100644 --- a/i18npool/source/calendar/calendarImpl.cxx +++ b/i18npool/source/calendar/calendarImpl.cxx @@ -37,7 +37,7 @@ CalendarImpl::CalendarImpl() : m_xContext(comphelper::getProcessComponentContext CalendarImpl::CalendarImpl(const Reference< XComponentContext > &rxContext) : m_xContext(rxContext) { if (!m_xContext.is()) - throw RuntimeException("CalendarImpl::CalendarImpl: empty m_xContext"); + throw RuntimeException(u"CalendarImpl::CalendarImpl: empty m_xContext"_ustr); } CalendarImpl::~CalendarImpl() @@ -50,7 +50,7 @@ CalendarImpl::loadDefaultCalendarTZ( const css::lang::Locale& rLocale, const OUS const Sequence< Calendar2 > xC = LocaleDataImpl::get()->getAllCalendars2(rLocale); auto pCal = std::find_if(xC.begin(), xC.end(), [](const Calendar2& rCal) { return rCal.Default; }); if (pCal == xC.end()) - throw RuntimeException("CalendarImpl::loadDefaultCalendarTZ: no default calendar found for this locale"); + throw RuntimeException(u"CalendarImpl::loadDefaultCalendarTZ: no default calendar found for this locale"_ustr); loadCalendarTZ(pCal->Name, rLocale, rTimeZone); } @@ -78,11 +78,11 @@ CalendarImpl::loadCalendarTZ( const OUString& uniqueID, const css::lang::Locale& // check if the calendar is defined in localedata, load gregorian calendar service. const Sequence< Calendar2 > xC = LocaleDataImpl::get()->getAllCalendars2(rLocale); if (std::any_of(xC.begin(), xC.end(), [&uniqueID](const Calendar2& rCal) { return uniqueID == rCal.Name; })) - xI = m_xContext->getServiceManager()->createInstanceWithContext("com.sun.star.i18n.Calendar_gregorian", m_xContext); + xI = m_xContext->getServiceManager()->createInstanceWithContext(u"com.sun.star.i18n.Calendar_gregorian"_ustr, m_xContext); } if ( !xI.is() ) - throw RuntimeException("CalendarImpl::loadCalendarTZ: no calendar found for this locale"); + throw RuntimeException(u"CalendarImpl::loadCalendarTZ: no calendar found for this locale"_ustr); xCalendar.set(xI, UNO_QUERY); if (!rTimeZone.isEmpty()) @@ -100,7 +100,7 @@ CalendarImpl::loadCalendarTZ( const OUString& uniqueID, const css::lang::Locale& if ( !xCalendar.is() ) { xCalendar = xOldCalendar; - throw RuntimeException("CalendarImpl::loadCalendarTZ: no calendar found for this locale, should use old one?"); + throw RuntimeException(u"CalendarImpl::loadCalendarTZ: no calendar found for this locale, should use old one?"_ustr); } try @@ -115,14 +115,14 @@ CalendarImpl::loadCalendarTZ( const OUString& uniqueID, const css::lang::Locale& if (!bTimeZone) // The calendar is usable but is not in the expected time zone. - throw RuntimeException("CalendarImpl::loadCalendarTZ: the calendar is usable but is not in the expected time zone"); + throw RuntimeException(u"CalendarImpl::loadCalendarTZ: the calendar is usable but is not in the expected time zone"_ustr); } Calendar2 SAL_CALL CalendarImpl::getLoadedCalendar2() { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::getLoadedCalendar2: no calendar"); + throw RuntimeException(u"CalendarImpl::getLoadedCalendar2: no calendar"_ustr); return xCalendar->getLoadedCalendar2(); } @@ -130,7 +130,7 @@ CalendarImpl::getLoadedCalendar2() CalendarImpl::getLoadedCalendar() { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::getLoadedCalendar: no calendar"); + throw RuntimeException(u"CalendarImpl::getLoadedCalendar: no calendar"_ustr); return xCalendar->getLoadedCalendar(); } @@ -148,7 +148,7 @@ void SAL_CALL CalendarImpl::setDateTime( double fTimeInDays ) { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::setDateTime: no calendar"); + throw RuntimeException(u"CalendarImpl::setDateTime: no calendar"_ustr); xCalendar->setDateTime( fTimeInDays ); } @@ -156,7 +156,7 @@ double SAL_CALL CalendarImpl::getDateTime() { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::getDateTime: no calendar"); + throw RuntimeException(u"CalendarImpl::getDateTime: no calendar"_ustr); return xCalendar->getDateTime(); } @@ -164,7 +164,7 @@ void SAL_CALL CalendarImpl::setLocalDateTime( double fTimeInDays ) { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::setLocalDateTime: no calendar"); + throw RuntimeException(u"CalendarImpl::setLocalDateTime: no calendar"_ustr); xCalendar->setLocalDateTime( fTimeInDays ); } @@ -172,7 +172,7 @@ double SAL_CALL CalendarImpl::getLocalDateTime() { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::getLocalDateTime: no calendar"); + throw RuntimeException(u"CalendarImpl::getLocalDateTime: no calendar"_ustr); return xCalendar->getLocalDateTime(); } @@ -190,7 +190,7 @@ OUString SAL_CALL CalendarImpl::getUniqueID() { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::getUniqueID: no calendar"); + throw RuntimeException(u"CalendarImpl::getUniqueID: no calendar"_ustr); return xCalendar->getUniqueID(); } @@ -198,7 +198,7 @@ void SAL_CALL CalendarImpl::setValue( sal_Int16 fieldIndex, sal_Int16 value ) { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::setValue: no calendar"); + throw RuntimeException(u"CalendarImpl::setValue: no calendar"_ustr); xCalendar->setValue( fieldIndex, value ); } @@ -206,7 +206,7 @@ sal_Int16 SAL_CALL CalendarImpl::getValue( sal_Int16 fieldIndex ) { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::getValue: no calendar"); + throw RuntimeException(u"CalendarImpl::getValue: no calendar"_ustr); return xCalendar->getValue( fieldIndex ); } @@ -214,7 +214,7 @@ void SAL_CALL CalendarImpl::addValue( sal_Int16 fieldIndex, sal_Int32 amount ) { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::addValue: no calendar"); + throw RuntimeException(u"CalendarImpl::addValue: no calendar"_ustr); xCalendar->addValue( fieldIndex, amount); } @@ -222,7 +222,7 @@ sal_Int16 SAL_CALL CalendarImpl::getFirstDayOfWeek() { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::getFirstDayOfWeek: no calendar"); + throw RuntimeException(u"CalendarImpl::getFirstDayOfWeek: no calendar"_ustr); return xCalendar->getFirstDayOfWeek(); } @@ -230,7 +230,7 @@ void SAL_CALL CalendarImpl::setFirstDayOfWeek( sal_Int16 day ) { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::setFirstDayOfWeek: no calendar"); + throw RuntimeException(u"CalendarImpl::setFirstDayOfWeek: no calendar"_ustr); xCalendar->setFirstDayOfWeek(day); } @@ -238,7 +238,7 @@ void SAL_CALL CalendarImpl::setMinimumNumberOfDaysForFirstWeek( sal_Int16 days ) { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::setMinimumNumberOfDaysForFirstWeek: no calendar"); + throw RuntimeException(u"CalendarImpl::setMinimumNumberOfDaysForFirstWeek: no calendar"_ustr); xCalendar->setMinimumNumberOfDaysForFirstWeek(days); } @@ -246,7 +246,7 @@ sal_Int16 SAL_CALL CalendarImpl::getMinimumNumberOfDaysForFirstWeek() { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::getMinimumNumberOfDaysForFirstWeek: no calendar"); + throw RuntimeException(u"CalendarImpl::getMinimumNumberOfDaysForFirstWeek: no calendar"_ustr); return xCalendar->getMinimumNumberOfDaysForFirstWeek(); } @@ -255,7 +255,7 @@ OUString SAL_CALL CalendarImpl::getDisplayName( sal_Int16 displayIndex, sal_Int16 idx, sal_Int16 nameType ) { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::getDisplayName: no calendar"); + throw RuntimeException(u"CalendarImpl::getDisplayName: no calendar"_ustr); return xCalendar->getDisplayName( displayIndex, idx, nameType ); } @@ -263,7 +263,7 @@ sal_Int16 SAL_CALL CalendarImpl::getNumberOfMonthsInYear() { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::setDisplayName: no calendar"); + throw RuntimeException(u"CalendarImpl::setDisplayName: no calendar"_ustr); return xCalendar->getNumberOfMonthsInYear(); } @@ -272,7 +272,7 @@ sal_Int16 SAL_CALL CalendarImpl::getNumberOfDaysInWeek() { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::getNumberOfDaysInWeek: no calendar"); + throw RuntimeException(u"CalendarImpl::getNumberOfDaysInWeek: no calendar"_ustr); return xCalendar->getNumberOfDaysInWeek(); } @@ -281,7 +281,7 @@ Sequence< CalendarItem > SAL_CALL CalendarImpl::getDays() { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::setNumberOfDaysInWeek: no calendar"); + throw RuntimeException(u"CalendarImpl::setNumberOfDaysInWeek: no calendar"_ustr); return xCalendar->getDays(); } @@ -290,7 +290,7 @@ Sequence< CalendarItem > SAL_CALL CalendarImpl::getMonths() { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::getMonths: no calendar"); + throw RuntimeException(u"CalendarImpl::getMonths: no calendar"_ustr); return xCalendar->getMonths(); } @@ -299,7 +299,7 @@ Sequence< CalendarItem2 > SAL_CALL CalendarImpl::getDays2() { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::getDays2: no calendar"); + throw RuntimeException(u"CalendarImpl::getDays2: no calendar"_ustr); return xCalendar->getDays2(); } @@ -308,7 +308,7 @@ Sequence< CalendarItem2 > SAL_CALL CalendarImpl::getMonths2() { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::getMonths2: no calendar"); + throw RuntimeException(u"CalendarImpl::getMonths2: no calendar"_ustr); return xCalendar->getMonths2(); } @@ -317,7 +317,7 @@ Sequence< CalendarItem2 > SAL_CALL CalendarImpl::getGenitiveMonths2() { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::getGenitiveMonths2: no calendar"); + throw RuntimeException(u"CalendarImpl::getGenitiveMonths2: no calendar"_ustr); return xCalendar->getGenitiveMonths2(); } @@ -326,7 +326,7 @@ Sequence< CalendarItem2 > SAL_CALL CalendarImpl::getPartitiveMonths2() { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::getPartitiveMonths2: no calendar"); + throw RuntimeException(u"CalendarImpl::getPartitiveMonths2: no calendar"_ustr); return xCalendar->getPartitiveMonths2(); } @@ -335,7 +335,7 @@ sal_Bool SAL_CALL CalendarImpl::isValid() { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::isValid: no calendar"); + throw RuntimeException(u"CalendarImpl::isValid: no calendar"_ustr); return xCalendar->isValid(); } @@ -343,7 +343,7 @@ OUString SAL_CALL CalendarImpl::getDisplayString( sal_Int32 nCalendarDisplayCode, sal_Int16 nNativeNumberMode ) { if (!xCalendar.is()) - throw RuntimeException("CalendarImpl::getDisplayString: no calendar"); + throw RuntimeException(u"CalendarImpl::getDisplayString: no calendar"_ustr); return xCalendar->getDisplayString(nCalendarDisplayCode, nNativeNumberMode); } diff --git a/i18npool/source/calendar/calendar_gregorian.cxx b/i18npool/source/calendar/calendar_gregorian.cxx index 72ac63e30fdb..a6e2febe553e 100644 --- a/i18npool/source/calendar/calendar_gregorian.cxx +++ b/i18npool/source/calendar/calendar_gregorian.cxx @@ -207,7 +207,7 @@ Calendar_hanja::getDisplayName( sal_Int16 displayIndex, sal_Int16 idx, sal_Int16 { if ( displayIndex == CalendarDisplayIndex::AM_PM ) { // Am/Pm string for Korean Hanja calendar will refer to Japanese locale - css::lang::Locale jaLocale("ja", OUString(), OUString()); + css::lang::Locale jaLocale(u"ja"_ustr, OUString(), OUString()); if (idx == 0) return LocaleDataImpl::get()->getLocaleItem(jaLocale).timeAM; else if (idx == 1) return LocaleDataImpl::get()->getLocaleItem(jaLocale).timePM; else throw RuntimeException(); @@ -227,7 +227,7 @@ Calendar_hanja_yoil::getDisplayName( sal_Int16 displayIndex, sal_Int16 idx, sal_ { if ( displayIndex == CalendarDisplayIndex::AM_PM ) { // Am/Pm string for Korean Hanja calendar will refer to Japanese locale - css::lang::Locale jaLocale("ja", OUString(), OUString()); + css::lang::Locale jaLocale(u"ja"_ustr, OUString(), OUString()); if (idx == 0) return LocaleDataImpl::get()->getLocaleItem(jaLocale).timeAM; else if (idx == 1) return LocaleDataImpl::get()->getLocaleItem(jaLocale).timePM; else throw RuntimeException(); diff --git a/i18npool/source/characterclassification/unoscripttypedetector.cxx b/i18npool/source/characterclassification/unoscripttypedetector.cxx index aef7497613ca..673b486d73aa 100644 --- a/i18npool/source/characterclassification/unoscripttypedetector.cxx +++ b/i18npool/source/characterclassification/unoscripttypedetector.cxx @@ -45,19 +45,19 @@ UnoScriptTypeDetector::endOfScriptDirection( const OUString& Text, sal_Int32 nPo sal_Int16 SAL_CALL UnoScriptTypeDetector::getCTLScriptType( const OUString&, sal_Int32 ) { - throw css::uno::RuntimeException("not implemented"); + throw css::uno::RuntimeException(u"not implemented"_ustr); } sal_Int32 SAL_CALL UnoScriptTypeDetector::beginOfCTLScriptType( const OUString&, sal_Int32 ) { - throw css::uno::RuntimeException("not implemented"); + throw css::uno::RuntimeException(u"not implemented"_ustr); } sal_Int32 SAL_CALL UnoScriptTypeDetector::endOfCTLScriptType( const OUString&, sal_Int32 ) { - throw css::uno::RuntimeException("not implemented"); + throw css::uno::RuntimeException(u"not implemented"_ustr); } OUString SAL_CALL diff --git a/i18npool/source/collator/collatorImpl.cxx b/i18npool/source/collator/collatorImpl.cxx index 5e5510587d19..a17d400ac6c1 100644 --- a/i18npool/source/collator/collatorImpl.cxx +++ b/i18npool/source/collator/collatorImpl.cxx @@ -196,7 +196,7 @@ CollatorImpl::loadCachedCollator(const lang::Locale& rLocale, const OUString& rS if (!bLoaded) { // load default service with name <base>_Unicode - bLoaded = createCollator( rLocale, "Unicode", rSortAlgorithm); + bLoaded = createCollator( rLocale, u"Unicode"_ustr, rSortAlgorithm); if (!bLoaded) { cachedItem.reset(); diff --git a/i18npool/source/collator/collator_unicode.cxx b/i18npool/source/collator/collator_unicode.cxx index 589c8ad6e6e9..0ecdae3e8569 100644 --- a/i18npool/source/collator/collator_unicode.cxx +++ b/i18npool/source/collator/collator_unicode.cxx @@ -162,7 +162,7 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang:: OUStringBuffer aBuf("get_collator_data_" + rLocale.Language + "_"); if ( rLocale.Language == "zh" ) { OUString func_base = aBuf.makeStringAndClear(); - if (OUString("TW HK MO").indexOf(rLocale.Country) >= 0) + if (u"TW HK MO"_ustr.indexOf(rLocale.Country) >= 0) { func = reinterpret_cast<const sal_uInt8* (*)()>(osl_getFunctionSymbol(hModule, OUString(func_base + "TW_" + rAlgorithm).pData)); @@ -385,7 +385,7 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang:: uppercase itself, so we don't have to bother with that. */ icu::Locale icuLocale( LanguageTagIcu::getIcuLocale( LanguageTag( rLocale), - u"", rAlgorithm.isEmpty() ? OUString("") : "collation=" + rAlgorithm)); + u"", rAlgorithm.isEmpty() ? u""_ustr : "collation=" + rAlgorithm)); // FIXME: apparently we get here in LOKit case only. When the language is Japanese, we pass "ja@collation=phonetic (alphanumeric first)" to ICU // and ICU does not like this (U_ILLEGAL_ARGUMENT_ERROR). Subsequently LOKit crashes, because collator is nullptr. diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx index 1caca1b3d054..a1630a1cc2bd 100644 --- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx +++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -1166,7 +1166,7 @@ OUString DefaultNumberingProvider::makeNumberingIdentifier(sal_Int16 index) return OUString(aSupportedTypes[index].cSymbol, strlen(aSupportedTypes[index].cSymbol), RTL_TEXTENCODING_UTF8); else { OUStringBuffer result; - Locale aLocale("en", OUString(), OUString()); + Locale aLocale(u"en"_ustr, OUString(), OUString()); Sequence<beans::PropertyValue> aProperties(2); auto aPropertiesRange = asNonConstRange(aProperties); aPropertiesRange[0].Name = "NumberingType"; @@ -1210,11 +1210,11 @@ DefaultNumberingProvider::isScriptFlagEnabled(const OUString& aName) uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence( { - {"nodepath", uno::Any(OUString("/org.openoffice.Office.Common/I18N"))} + {"nodepath", uno::Any(u"/org.openoffice.Office.Common/I18N"_ustr)} })); Reference<XInterface> xInterface = xConfigProvider->createInstanceWithArguments( - "com.sun.star.configuration.ConfigurationAccess", aArgs); + u"com.sun.star.configuration.ConfigurationAccess"_ustr, aArgs); xHierarchicalNameAccess.set(xInterface, UNO_QUERY_THROW); } @@ -1233,8 +1233,8 @@ Sequence< sal_Int16 > DefaultNumberingProvider::getSupportedNumberingTypes( ) Sequence< sal_Int16 > aRet(nSupported_NumberingTypes ); sal_Int16* pArray = aRet.getArray(); - bool cjkEnabled = isScriptFlagEnabled("CJK/CJKFont"); - bool ctlEnabled = isScriptFlagEnabled("CTL/CTLFont"); + bool cjkEnabled = isScriptFlagEnabled(u"CJK/CJKFont"_ustr); + bool ctlEnabled = isScriptFlagEnabled(u"CTL/CTLFont"_ustr); for(sal_Int16 i = 0; i < nSupported_NumberingTypes; i++) { if ( (aSupportedTypes[i].langOption & LANG_ALL) || @@ -1283,7 +1283,7 @@ OUString DefaultNumberingProvider::getNumberingIdentifier( sal_Int16 nNumberingT OUString DefaultNumberingProvider::getImplementationName() { - return "com.sun.star.text.DefaultNumberingProvider"; + return u"com.sun.star.text.DefaultNumberingProvider"_ustr; } sal_Bool DefaultNumberingProvider::supportsService(const OUString& rServiceName) @@ -1293,7 +1293,7 @@ sal_Bool DefaultNumberingProvider::supportsService(const OUString& rServiceName) Sequence< OUString > DefaultNumberingProvider::getSupportedServiceNames() { - Sequence< OUString > aRet { "com.sun.star.text.DefaultNumberingProvider" }; + Sequence< OUString > aRet { u"com.sun.star.text.DefaultNumberingProvider"_ustr }; return aRet; } diff --git a/i18npool/source/indexentry/indexentrysupplier_asian.cxx b/i18npool/source/indexentry/indexentrysupplier_asian.cxx index 97bae784b669..07d08a3bdb37 100644 --- a/i18npool/source/indexentry/indexentrysupplier_asian.cxx +++ b/i18npool/source/indexentry/indexentrysupplier_asian.cxx @@ -47,7 +47,7 @@ IndexEntrySupplier_asian::getIndexCharacter( const OUString& rIndexEntry, sal_uInt32 ch = rIndexEntry.iterateCodePoints(&o3tl::temporary(sal_Int32(0)), 0); const sal_uInt16** (*func)(sal_Int16&)=nullptr; - if ( rLocale.Language == "zh" && OUString( "TW HK MO" ).indexOf(rLocale.Country) >= 0 ) { + if ( rLocale.Language == "zh" && u"TW HK MO"_ustr.indexOf(rLocale.Country) >= 0 ) { if ( rAlgorithm == "radical" ) func = get_indexdata_zh_TW_radical; else if ( rAlgorithm == "stroke" ) @@ -117,7 +117,7 @@ IndexEntrySupplier_asian::getPhoneticCandidate( const OUString& rIndexEntry, { sal_uInt16 const **(*func)(sal_Int16&)=nullptr; if ( rLocale.Language == "zh" ) - func = (OUString("TW HK MO").indexOf(rLocale.Country) >= 0) ? get_zh_zhuyin : get_zh_pinyin; + func = (u"TW HK MO"_ustr.indexOf(rLocale.Country) >= 0) ? get_zh_zhuyin : get_zh_pinyin; else if ( rLocale.Language == "ko" ) func = get_ko_phonetic; diff --git a/i18npool/source/indexentry/indexentrysupplier_default.cxx b/i18npool/source/indexentry/indexentrysupplier_default.cxx index f65ee2843857..f616c041ac71 100644 --- a/i18npool/source/indexentry/indexentrysupplier_default.cxx +++ b/i18npool/source/indexentry/indexentrysupplier_default.cxx @@ -175,7 +175,7 @@ void Index::makeIndexKeys(const lang::Locale &rLocale, std::u16string_view algor LocaleDataImpl::get()->getDefaultIndexAlgorithm(LOCALE_EN)); if (keyStr.isEmpty()) throw RuntimeException( - "Index::makeIndexKeys: No index keys returned by algorithm"); + u"Index::makeIndexKeys: No index keys returned by algorithm"_ustr); } sal_Int16 len = sal::static_int_cast<sal_Int16>( keyStr.getLength() ); @@ -194,8 +194,8 @@ void Index::makeIndexKeys(const lang::Locale &rLocale, std::u16string_view algor switch(curr) { case u'-': { if (key_count <= 0 || i + 1 >= len) - throw RuntimeException("Index::makeIndexKeys: key_count<=0||" - "'-' is the last char of KeyString"); + throw RuntimeException(u"Index::makeIndexKeys: key_count<=0||" + "'-' is the last char of KeyString"_ustr); for (curr = keyStr[++i]; key_count < MAX_KEYS && keys[key_count-1].key < curr; key_count++) { keys[key_count].key = keys[key_count-1].key+1; keys[key_count].desc.clear(); @@ -220,13 +220,13 @@ void Index::makeIndexKeys(const lang::Locale &rLocale, std::u16string_view algor [[fallthrough]]; case u'(': { if (key_count <= 0) - throw RuntimeException("Index::makeIndexKeys: key_count<=0"); + throw RuntimeException(u"Index::makeIndexKeys: key_count<=0"_ustr); sal_Int16 end = i+1; for (; end < len && keyStr[end] != close; end++) ; if (end >= len) // no found - throw RuntimeException("Index::makeIndexKeys: Closing bracket not found"); + throw RuntimeException(u"Index::makeIndexKeys: Closing bracket not found"_ustr); if (close == ')') keys[key_count-1].desc = keyStr.copy(i+1, end-i-1); else { @@ -264,12 +264,12 @@ void Index::init(const lang::Locale &rLocale, const OUString& algorithm) if (!scriptList.hasElements()) { scriptList = LocaleDataImpl::get()->getUnicodeScripts(LOCALE_EN); if (!scriptList.hasElements()) - throw RuntimeException("Index::init: scriptList is empty"); + throw RuntimeException(u"Index::init: scriptList is empty"_ustr); } table_count = sal::static_int_cast<sal_Int16>( scriptList.getLength() ); if (table_count > MAX_TABLES) - throw RuntimeException("Index::init: Length of scriptList is too big"); + throw RuntimeException(u"Index::init: Length of scriptList is too big"_ustr); collator->loadCollatorAlgorithm(algorithm, rLocale, CollatorOptions::CollatorOptions_IGNORE_CASE_ACCENT); sal_Int16 j=0; diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx index 4aca351fc2c4..ad6be9d12633 100644 --- a/i18npool/source/localedata/LocaleNode.cxx +++ b/i18npool/source/localedata/LocaleNode.cxx @@ -1577,17 +1577,17 @@ void LCCalendarNode::generateCode (const OFileWriter &of) const // Of course there must be an implementation for new to be added // identifiers.. see data/locale.dtd std::map< OUString, bool > aCalendars; - aCalendars["buddhist"] = false; - aCalendars["gengou"] = false; - aCalendars["gregorian"] = false; - aCalendars["hanja"] = false; - aCalendars["hanja_yoil"] = false; - aCalendars["hijri"] = false; - aCalendars["jewish"] = false; - aCalendars["ROC"] = false; + aCalendars[u"buddhist"_ustr] = false; + aCalendars[u"gengou"_ustr] = false; + aCalendars[u"gregorian"_ustr] = false; + aCalendars[u"hanja"_ustr] = false; + aCalendars[u"hanja_yoil"_ustr] = false; + aCalendars[u"hijri"_ustr] = false; + aCalendars[u"jewish"_ustr] = false; + aCalendars[u"ROC"_ustr] = false; // Not in ODF: - aCalendars["dangi"] = false; - aCalendars["persian"] = false; + aCalendars[u"dangi"_ustr] = false; + aCalendars[u"persian"_ustr] = false; sal_Int16 j; sal_Int16 i; diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx index 7f59dabda5fb..750e2c2bb844 100644 --- a/i18npool/source/localedata/localedata.cxx +++ b/i18npool/source/localedata/localedata.cxx @@ -670,7 +670,7 @@ Sequence< CalendarItem2 > &LocaleDataImpl::getCalendarItemByName(const OUString& ref_cal = *pCal; else { // Referred locale not found, return name for en_US locale. - cals = getAllCalendars2( Locale("en", "US", OUString()) ); + cals = getAllCalendars2( Locale(u"en"_ustr, u"US"_ustr, OUString()) ); if (!cals.hasElements()) throw RuntimeException(); ref_cal = cals.getConstArray()[0]; @@ -1433,7 +1433,7 @@ oslGenericFunction LocaleDataImpl::getFunctionSymbol( const Locale& rLocale, con if (!pSymbol) { // load default function with name <func>_en_US - pSymbol = rLookupTable.getFunctionSymbolByName("en_US", pFunction, oCachedItem); + pSymbol = rLookupTable.getFunctionSymbolByName(u"en_US"_ustr, pFunction, oCachedItem); } if (!pSymbol) diff --git a/i18npool/source/localedata/saxparser.cxx b/i18npool/source/localedata/saxparser.cxx index 4f6051445f6a..2c959d0648bf 100644 --- a/i18npool/source/localedata/saxparser.cxx +++ b/i18npool/source/localedata/saxparser.cxx @@ -164,7 +164,7 @@ public: // Error handler ++nError; printf( "Error !\n" ); throw SAXException( - "error from error handler", + u"error from error handler"_ustr, Reference < XInterface >() , aSAXParseException ); } diff --git a/i18npool/source/numberformatcode/numberformatcode.cxx b/i18npool/source/numberformatcode/numberformatcode.cxx index 5562c301a300..2d63baf29fbd 100644 --- a/i18npool/source/numberformatcode/numberformatcode.cxx +++ b/i18npool/source/numberformatcode/numberformatcode.cxx @@ -165,11 +165,11 @@ NumberFormatCodeMapper::mapElementTypeShortToString(sal_Int16 formatType) switch ( formatType ) { case css::i18n::KNumberFormatType::SHORT : - return "short"; + return u"short"_ustr; case css::i18n::KNumberFormatType::MEDIUM : - return "medium"; + return u"medium"_ustr; case css::i18n::KNumberFormatType::LONG : - return "long"; + return u"long"_ustr; } return OUString(); } @@ -193,21 +193,21 @@ NumberFormatCodeMapper::mapElementUsageShortToString(sal_Int16 formatUsage) switch ( formatUsage ) { case css::i18n::KNumberFormatUsage::DATE : - return "DATE"; + return u"DATE"_ustr; case css::i18n::KNumberFormatUsage::TIME : - return "TIME"; + return u"TIME"_ustr; case css::i18n::KNumberFormatUsage::DATE_TIME : - return "DATE_TIME"; + return u"DATE_TIME"_ustr; case css::i18n::KNumberFormatUsage::FIXED_NUMBER : - return "FIXED_NUMBER"; + return u"FIXED_NUMBER"_ustr; case css::i18n::KNumberFormatUsage::FRACTION_NUMBER : - return "FRACTION_NUMBER"; + return u"FRACTION_NUMBER"_ustr; case css::i18n::KNumberFormatUsage::PERCENT_NUMBER : - return "PERCENT_NUMBER"; + return u"PERCENT_NUMBER"_ustr; case css::i18n::KNumberFormatUsage::CURRENCY : - return "CURRENCY"; + return u"CURRENCY"_ustr; case css::i18n::KNumberFormatUsage::SCIENTIFIC_NUMBER : - return "SCIENTIFIC_NUMBER"; + return u"SCIENTIFIC_NUMBER"_ustr; } return OUString(); } diff --git a/i18npool/source/textconversion/textconversionImpl.cxx b/i18npool/source/textconversion/textconversionImpl.cxx index af5bb288fe45..6f30a990b8dc 100644 --- a/i18npool/source/textconversion/textconversionImpl.cxx +++ b/i18npool/source/textconversion/textconversionImpl.cxx @@ -79,7 +79,7 @@ TextConversionImpl::getLocaleSpecificTextConversion(const Locale& rLocale) if (rLocale != aLocale) { aLocale = rLocale; - OUString aPrefix("com.sun.star.i18n.TextConversion_"); + OUString aPrefix(u"com.sun.star.i18n.TextConversion_"_ustr); Reference < XInterface > xI = m_xContext->getServiceManager()->createInstanceWithContext( aPrefix + LocaleDataImpl::getFirstLocaleServiceName( aLocale), m_xContext); if (!xI.is()) diff --git a/i18npool/source/textconversion/textconversion_ko.cxx b/i18npool/source/textconversion/textconversion_ko.cxx index c68c66a38cd4..19a4f07de2f9 100644 --- a/i18npool/source/textconversion/textconversion_ko.cxx +++ b/i18npool/source/textconversion/textconversion_ko.cxx @@ -45,7 +45,7 @@ TextConversion_ko::TextConversion_ko( const Reference < XComponentContext >& xCo : TextConversionService("com.sun.star.i18n.TextConversion_ko") { Reference < XInterface > xI = xContext->getServiceManager()->createInstanceWithContext( - "com.sun.star.i18n.ConversionDictionary_ko", xContext); + u"com.sun.star.i18n.ConversionDictionary_ko"_ustr, xContext); if ( xI.is() ) xCD.set( xI, UNO_QUERY ); @@ -56,7 +56,7 @@ TextConversion_ko::TextConversion_ko( const Reference < XComponentContext >& xCo // get maximum length of word in dictionary if (xCDL.is()) { - Locale loc("ko", "KR", OUString()); + Locale loc(u"ko"_ustr, u"KR"_ustr, OUString()); maxLeftLength = xCDL->queryMaxCharCount(loc, ConversionDictionaryType::HANGUL_HANJA, ConversionDirection_FROM_LEFT); diff --git a/i18npool/source/transliteration/transliterationImpl.cxx b/i18npool/source/transliteration/transliterationImpl.cxx index c5b6d9cf5cce..6224fa014d5b 100644 --- a/i18npool/source/transliteration/transliterationImpl.cxx +++ b/i18npool/source/transliteration/transliterationImpl.cxx @@ -184,7 +184,7 @@ TransliterationImpl::getName() if (numCascade == 1 && bodyCascade[0].is()) return bodyCascade[0]->getName(); if (numCascade < 1) - return ( OUString("Not Loaded")); + return ( u"Not Loaded"_ustr); throw RuntimeException(); } |