summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-12-12 12:20:12 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-12-12 12:20:12 +0100
commit2c571050006940a3a0be776efd8ad3b2854a1814 (patch)
tree923ef768e55f2ae4f056c81bc95b46bdc7b4354e /i18npool
parent7948b273a9725c546e0dc32bece296dc872bdc04 (diff)
i18npool: Use appropriate OUString functions on string constants
Change-Id: I82fea345a05c0327af3b75ccfd3358f54523c082
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/source/breakiterator/breakiteratorImpl.cxx6
-rw-r--r--i18npool/source/breakiterator/breakiterator_cjk.cxx2
-rw-r--r--i18npool/source/collator/collator_unicode.cxx2
-rw-r--r--i18npool/source/indexentry/indexentrysupplier.cxx4
-rw-r--r--i18npool/source/indexentry/indexentrysupplier_ja_phonetic.cxx8
-rw-r--r--i18npool/source/localedata/LocaleNode.cxx12
-rw-r--r--i18npool/source/nativenumber/nativenumbersupplier.cxx6
-rw-r--r--i18npool/source/ordinalsuffix/ordinalsuffix.cxx4
-rw-r--r--i18npool/source/search/textsearch.cxx5
9 files changed, 23 insertions, 26 deletions
diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index 3a19f5107204..8fe57f4774a0 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -581,9 +581,9 @@ BreakIteratorImpl::getLocaleSpecificBreakIterator(const Locale& rLocale) throw (
// load service with name <base>_<lang>_<country>
createLocaleSpecificBreakIterator(aBuf.append(rLocale.Language).append(under).append(
rLocale.Country).makeStringAndClear())) ||
- (l > 0 && c > 0 && rLocale.Language.equalsAscii("zh") &&
- (rLocale.Country.equalsAscii("HK") ||
- rLocale.Country.equalsAscii("MO") ) &&
+ (l > 0 && c > 0 && rLocale.Language == "zh" &&
+ (rLocale.Country == "HK" ||
+ rLocale.Country == "MO" ) &&
// if the country code is HK or MO, one more step to try TW.
createLocaleSpecificBreakIterator(aBuf.append(rLocale.Language).append(under).appendAscii(
"TW").makeStringAndClear())) ||
diff --git a/i18npool/source/breakiterator/breakiterator_cjk.cxx b/i18npool/source/breakiterator/breakiterator_cjk.cxx
index 31901b383463..487f06f5b1a7 100644
--- a/i18npool/source/breakiterator/breakiterator_cjk.cxx
+++ b/i18npool/source/breakiterator/breakiterator_cjk.cxx
@@ -110,7 +110,7 @@ LineBreakResults SAL_CALL BreakIterator_CJK::getLineBreak(
return lbr;
}
-#define LOCALE(language, country) lang::Locale(OUString::createFromAscii(language), OUString::createFromAscii(country), OUString())
+#define LOCALE(language, country) lang::Locale(language, country, OUString())
// ----------------------------------------------------
// class BreakIterator_zh
// ----------------------------------------------------;
diff --git a/i18npool/source/collator/collator_unicode.cxx b/i18npool/source/collator/collator_unicode.cxx
index ac05363f7e28..457f266e4985 100644
--- a/i18npool/source/collator/collator_unicode.cxx
+++ b/i18npool/source/collator/collator_unicode.cxx
@@ -139,7 +139,7 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang::
collator = new RuleBasedCollator(reinterpret_cast<const UChar *>(rule.getStr()), status); // UChar != sal_Unicode in MinGW
if (! U_SUCCESS(status)) throw RuntimeException();
}
- if (!collator && OUString::createFromAscii(LOCAL_RULE_LANGS).indexOf(rLocale.Language) >= 0) {
+ if (!collator && OUString(LOCAL_RULE_LANGS).indexOf(rLocale.Language) >= 0) {
const sal_uInt8* (*func)() = NULL;
size_t (*funclen)() = NULL;
diff --git a/i18npool/source/indexentry/indexentrysupplier.cxx b/i18npool/source/indexentry/indexentrysupplier.cxx
index 5704aa83841d..73ee94159d31 100644
--- a/i18npool/source/indexentry/indexentrysupplier.cxx
+++ b/i18npool/source/indexentry/indexentrysupplier.cxx
@@ -178,7 +178,7 @@ OUString SAL_CALL IndexEntrySupplier::getIndexFollowPageWord( sal_Bool bMorePage
OUString SAL_CALL
IndexEntrySupplier::getImplementationName() throw( RuntimeException, std::exception )
{
- return OUString::createFromAscii( implementationName );
+ return OUString( implementationName );
}
sal_Bool SAL_CALL
@@ -191,7 +191,7 @@ Sequence< OUString > SAL_CALL
IndexEntrySupplier::getSupportedServiceNames() throw( RuntimeException, std::exception )
{
Sequence< OUString > aRet(1);
- aRet[0] = OUString::createFromAscii( implementationName );
+ aRet[0] = implementationName;
return aRet;
}
diff --git a/i18npool/source/indexentry/indexentrysupplier_ja_phonetic.cxx b/i18npool/source/indexentry/indexentrysupplier_ja_phonetic.cxx
index 4e2b6ab3461f..a0120a89252e 100644
--- a/i18npool/source/indexentry/indexentrysupplier_ja_phonetic.cxx
+++ b/i18npool/source/indexentry/indexentrysupplier_ja_phonetic.cxx
@@ -68,13 +68,13 @@ sal_Bool SAL_CALL IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_syllable:
const com::sun::star::lang::Locale& rLocale, const OUString& /*SortAlgorithm*/,
sal_Int32 collatorOptions ) throw (com::sun::star::uno::RuntimeException, std::exception)
{
- return collator->loadCollatorAlgorithm(OUString::createFromAscii(first), rLocale, collatorOptions) == 0;
+ return collator->loadCollatorAlgorithm(first, rLocale, collatorOptions) == 0;
}
sal_Bool SAL_CALL IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_consonant::loadAlgorithm(
const com::sun::star::lang::Locale& rLocale, const OUString& /*SortAlgorithm*/,
sal_Int32 collatorOptions ) throw (com::sun::star::uno::RuntimeException, std::exception)
{
- return collator->loadCollatorAlgorithm(OUString::createFromAscii(first), rLocale, collatorOptions) == 0;
+ return collator->loadCollatorAlgorithm(first, rLocale, collatorOptions) == 0;
}
static const sal_Char last[] = "ja_phonetic (alphanumeric last)";
@@ -82,13 +82,13 @@ sal_Bool SAL_CALL IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_syllable::
const com::sun::star::lang::Locale& rLocale, const OUString& /*SortAlgorithm*/,
sal_Int32 collatorOptions ) throw (com::sun::star::uno::RuntimeException, std::exception)
{
- return collator->loadCollatorAlgorithm(OUString::createFromAscii(last), rLocale, collatorOptions) == 0;
+ return collator->loadCollatorAlgorithm(last, rLocale, collatorOptions) == 0;
}
sal_Bool SAL_CALL IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_consonant::loadAlgorithm(
const com::sun::star::lang::Locale& rLocale, const OUString& /*SortAlgorithm*/,
sal_Int32 collatorOptions ) throw (com::sun::star::uno::RuntimeException, std::exception)
{
- return collator->loadCollatorAlgorithm(OUString::createFromAscii(last), rLocale, collatorOptions) == 0;
+ return collator->loadCollatorAlgorithm(last, rLocale, collatorOptions) == 0;
}
} } } }
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx
index 16fb597f8c53..681bf479a6b4 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -770,7 +770,7 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
{
sal_Int32 nStart;
if (sTheCompatibleCurrency.isEmpty() &&
- ((nStart = n->getValue().indexOfAsciiL( "[$", 2)) >= 0))
+ ((nStart = n->getValue().indexOf("[$")) >= 0))
{
OUString aCode( n->getValue());
sal_Int32 nHyphen = aCode.indexOf( '-', nStart);
@@ -1294,7 +1294,7 @@ void LCCollationNode::generateCode (const OFileWriter &of) const
for ( j = 0; j < getNumberOfChildren(); j++ ) {
LocaleNode * currNode = getChildAt (j);
- if( currNode->getName().equalsAscii("Collator") )
+ if( currNode->getName() == "Collator" )
{
OUString str;
str = currNode->getAttr().getValueByName("unoid");
@@ -1307,7 +1307,7 @@ void LCCollationNode::generateCode (const OFileWriter &of) const
nbOfCollations++;
}
- if( currNode->getName().equalsAscii("CollationOptions") )
+ if( currNode->getName() == "CollationOptions" )
{
LocaleNode* pCollationOptions = currNode;
nbOfCollationOptions = sal::static_int_cast<sal_Int16>( pCollationOptions->getNumberOfChildren() );
@@ -1408,7 +1408,7 @@ void LCIndexNode::generateCode (const OFileWriter &of) const
sal_Int16 i;
for (i = 0; i< getNumberOfChildren();i++) {
LocaleNode * currNode = getChildAt (i);
- if( currNode->getName().equalsAscii("IndexKey") )
+ if( currNode->getName() == "IndexKey" )
{
OUString str;
str = currNode->getAttr().getValueByName("unoid");
@@ -1425,13 +1425,13 @@ void LCIndexNode::generateCode (const OFileWriter &of) const
nbOfIndexs++;
}
- if( currNode->getName().equalsAscii("UnicodeScript") )
+ if( currNode->getName() == "UnicodeScript" )
{
of.writeParameter("unicodeScript", currNode->getValue(), nbOfUnicodeScripts );
nbOfUnicodeScripts++;
}
- if( currNode->getName().equalsAscii("FollowPageWord") )
+ if( currNode->getName() == "FollowPageWord" )
{
of.writeParameter("followPageWord", currNode->getValue(), nbOfPageWords);
nbOfPageWords++;
diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx
index 8520a689cb0d..720644588ded 100644
--- a/i18npool/source/nativenumber/nativenumbersupplier.cxx
+++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx
@@ -503,15 +503,13 @@ static const sal_Int16 natnum2[] = {
};
static const sal_Int16 sizeof_natnum2 = SAL_N_ELEMENTS(natnum2);
-#define isLang(lang) rLocale.Language.equalsAsciiL(lang, 2)
-
static sal_Int16 SAL_CALL getLanguageNumber( const Locale& rLocale)
{
// return zh_TW for TW, HK and MO, return zh_CN for other zh locales.
- if (isLang("zh")) return MsLangId::isTraditionalChinese(rLocale) ? 1 : 0;
+ if (rLocale.Language == "zh") return MsLangId::isTraditionalChinese(rLocale) ? 1 : 0;
for (sal_Int16 i = 2; i < nbOfLocale; i++)
- if (isLang(natnum1Locales[i]))
+ if (rLocale.Language.equalsAsciiL(natnum1Locales[i], 2))
return i;
return -1;
diff --git a/i18npool/source/ordinalsuffix/ordinalsuffix.cxx b/i18npool/source/ordinalsuffix/ordinalsuffix.cxx
index 53cea5fd0a03..9649de30880f 100644
--- a/i18npool/source/ordinalsuffix/ordinalsuffix.cxx
+++ b/i18npool/source/ordinalsuffix/ordinalsuffix.cxx
@@ -137,7 +137,7 @@ const sal_Char cOrdinalSuffix[] = "com.sun.star.i18n.OrdinalSuffix";
OUString SAL_CALL OrdinalSuffixService::getImplementationName(void) throw( RuntimeException, std::exception )
{
- return OUString::createFromAscii(cOrdinalSuffix);
+ return OUString(cOrdinalSuffix);
}
sal_Bool SAL_CALL OrdinalSuffixService::supportsService( const OUString& rServiceName) throw( RuntimeException, std::exception )
@@ -148,7 +148,7 @@ sal_Bool SAL_CALL OrdinalSuffixService::supportsService( const OUString& rServic
Sequence< OUString > SAL_CALL OrdinalSuffixService::getSupportedServiceNames(void) throw( RuntimeException, std::exception )
{
Sequence< OUString > aRet(1);
- aRet[0] = OUString::createFromAscii(cOrdinalSuffix);
+ aRet[0] = cOrdinalSuffix;
return aRet;
}
diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx
index 98aa1b6cc3f2..1096599c1cea 100644
--- a/i18npool/source/search/textsearch.cxx
+++ b/i18npool/source/search/textsearch.cxx
@@ -1026,17 +1026,16 @@ SearchResult TextSearch::ApproxSrchBkwrd( const OUString& searchStr,
}
-static const sal_Char cSearchName[] = "com.sun.star.util.TextSearch";
static const sal_Char cSearchImpl[] = "com.sun.star.util.TextSearch_i18n";
static OUString getServiceName_Static()
{
- return OUString::createFromAscii( cSearchName );
+ return OUString( "com.sun.star.util.TextSearch" );
}
static OUString getImplementationName_Static()
{
- return OUString::createFromAscii( cSearchImpl );
+ return OUString( cSearchImpl );
}
OUString SAL_CALL