diff options
Diffstat (limited to 'i18npool/source/collator/collatorImpl.cxx')
-rw-r--r-- | i18npool/source/collator/collatorImpl.cxx | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/i18npool/source/collator/collatorImpl.cxx b/i18npool/source/collator/collatorImpl.cxx index bdd28a255d07..e14587cf19e0 100644 --- a/i18npool/source/collator/collatorImpl.cxx +++ b/i18npool/source/collator/collatorImpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,7 +36,9 @@ using namespace com::sun::star; using namespace com::sun::star::lang; using namespace com::sun::star::uno; -using namespace rtl; + +using ::rtl::OUString; +using ::rtl::OUStringBuffer; namespace com { namespace sun { namespace star { namespace i18n { @@ -43,7 +46,7 @@ CollatorImpl::CollatorImpl( const Reference < XMultiServiceFactory >& rxMSF ) : { if ( rxMSF.is()) { Reference < XInterface > xI = - xMSF->createInstance( OUString::createFromAscii("com.sun.star.i18n.LocaleData")); + xMSF->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.LocaleData"))); if ( xI.is() ) xI->queryInterface(::getCppuType((const Reference< XLocaleData>*)0)) >>= localedata; } @@ -147,9 +150,9 @@ CollatorImpl::listCollatorOptions( const OUString& /*collatorAlgorithmName*/ ) t for (sal_Int32 i = 0; i < option_str.getLength(); i++) option_int[i] = - option_str[i].equalsAscii("IGNORE_CASE") ? CollatorOptions::CollatorOptions_IGNORE_CASE : - option_str[i].equalsAscii("IGNORE_KANA") ? CollatorOptions::CollatorOptions_IGNORE_KANA : - option_str[i].equalsAscii("IGNORE_WIDTH") ? CollatorOptions::CollatorOptions_IGNORE_WIDTH : 0; + option_str[i].equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("IGNORE_CASE")) ? CollatorOptions::CollatorOptions_IGNORE_CASE : + option_str[i].equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("IGNORE_KANA")) ? CollatorOptions::CollatorOptions_IGNORE_KANA : + option_str[i].equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("IGNORE_WIDTH")) ? CollatorOptions::CollatorOptions_IGNORE_WIDTH : 0; return option_int; } @@ -167,7 +170,7 @@ CollatorImpl::createCollator(const lang::Locale& rLocale, const OUString& servic } if (xMSF.is()) { Reference < XInterface > xI = - xMSF->createInstance(OUString::createFromAscii("com.sun.star.i18n.Collator_") + serviceName); + xMSF->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.Collator_")) + serviceName); if (xI.is()) { Reference < XCollator > xC; @@ -194,8 +197,8 @@ CollatorImpl::loadCachedCollator(const lang::Locale& rLocale, const OUString& rS } static sal_Unicode under = (sal_Unicode) '_'; - static OUString tw(OUString::createFromAscii("TW")); - static OUString unicode(OUString::createFromAscii("Unicode")); + static OUString tw(RTL_CONSTASCII_USTRINGPARAM("TW")); + static OUString unicode(RTL_CONSTASCII_USTRINGPARAM("Unicode")); sal_Int32 l = rLocale.Language.getLength(); sal_Int32 c = rLocale.Country.getLength(); @@ -212,9 +215,9 @@ CollatorImpl::loadCachedCollator(const lang::Locale& rLocale, const OUString& rS // load service with name <base>_<lang>_<country>_<algorithm> createCollator(rLocale, aBuf.append(rLocale.Language).append(under).append(rLocale.Country).append( under).append(rSortAlgorithm).makeStringAndClear(), rSortAlgorithm)) || - (l > 0 && c > 0 && a > 0 && rLocale.Language.equalsAscii("zh") && - (rLocale.Country.equalsAscii("HK") || - rLocale.Country.equalsAscii("MO")) && + (l > 0 && c > 0 && a > 0 && rLocale.Language.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("zh")) && + (rLocale.Country.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HK")) || + rLocale.Country.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MO"))) && // if the country code is HK or MO, one more step to try TW. createCollator(rLocale, aBuf.append(rLocale.Language).append(under).append(tw).append(under).append( rSortAlgorithm).makeStringAndClear(), rSortAlgorithm)) || @@ -258,3 +261,5 @@ CollatorImpl::getSupportedServiceNames() throw( RuntimeException ) } } } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |