diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-02-22 16:58:01 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-02-22 16:58:01 -0500 |
commit | 7f960a4c428452a78ee0256b71acc33e0962fc39 (patch) | |
tree | 2785aec841226eba465c5ed6532c1c40f22fd71e /i18npool | |
parent | 702dd17d17da78673c42b3a47022d24baec26cd3 (diff) |
Fixed indentation and bracket style.
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/source/localedata/localedata.cxx | 91 |
1 files changed, 46 insertions, 45 deletions
diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx index 2b8a60a1f31f..ca975bb2275e 100644 --- a/i18npool/source/localedata/localedata.cxx +++ b/i18npool/source/localedata/localedata.cxx @@ -1272,53 +1272,54 @@ LocaleData::getOutlineNumberingLevels( const lang::Locale& rLocale ) throw(Runti oslGenericFunction SAL_CALL LocaleData::getFunctionSymbol( const Locale& rLocale, const sal_Char* pFunction ) throw(RuntimeException) { - lcl_LookupTableHelper & rLookupTable = lcl_LookupTableStatic::get(); + lcl_LookupTableHelper & rLookupTable = lcl_LookupTableStatic::get(); - OUStringBuffer aBuf(1); - if (cachedItem.get() && cachedItem->equals(rLocale)) { - aBuf.ensureCapacity(strlen(pFunction) + 1 + strlen(cachedItem->localeName)); - return cachedItem->module->getFunctionSymbol(aBuf.appendAscii(pFunction).append(under). - appendAscii(cachedItem->localeName).makeStringAndClear()); - } + OUStringBuffer aBuf(1); + if (cachedItem.get() && cachedItem->equals(rLocale)) + { + aBuf.ensureCapacity(strlen(pFunction) + 1 + strlen(cachedItem->localeName)); + return cachedItem->module->getFunctionSymbol(aBuf.appendAscii(pFunction).append(under). + appendAscii(cachedItem->localeName).makeStringAndClear()); + } - oslGenericFunction pSymbol = 0; - static OUString tw(RTL_CONSTASCII_USTRINGPARAM("TW")); - static OUString en_US(RTL_CONSTASCII_USTRINGPARAM("en_US")); - - sal_Int32 l = rLocale.Language.getLength(); - sal_Int32 c = rLocale.Country.getLength(); - sal_Int32 v = rLocale.Variant.getLength(); - aBuf.ensureCapacity(l+c+v+3); - - LocaleDataLookupTableItem *pCachedItem = 0; - - if ((l > 0 && c > 0 && v > 0 && - // load function with name <func>_<lang>_<country>_<varian> - (pSymbol = rLookupTable.getFunctionSymbolByName(aBuf.append(rLocale.Language).append(under).append( - rLocale.Country).append(under).append(rLocale.Variant).makeStringAndClear(), pFunction, &pCachedItem)) != 0) || - (l > 0 && c > 0 && - // load function with name <ase>_<lang>_<country> - (pSymbol = rLookupTable.getFunctionSymbolByName(aBuf.append(rLocale.Language).append(under).append( - rLocale.Country).makeStringAndClear(), pFunction, &pCachedItem)) != 0) || - (l > 0 && c > 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. - (pSymbol = rLookupTable.getFunctionSymbolByName(aBuf.append(rLocale.Language).append(under).append(tw).makeStringAndClear(), - pFunction, &pCachedItem)) != 0) || - (l > 0 && - // load function with name <func>_<lang> - (pSymbol = rLookupTable.getFunctionSymbolByName(rLocale.Language, pFunction, &pCachedItem)) != 0) || - // load default function with name <func>_en_US - (pSymbol = rLookupTable.getFunctionSymbolByName(en_US, pFunction, &pCachedItem)) != 0) - { - if( pCachedItem ) - cachedItem.reset( pCachedItem ); - if( cachedItem.get()) - cachedItem->aLocale = rLocale; - return pSymbol; - } - throw RuntimeException(); + oslGenericFunction pSymbol = 0; + static OUString tw(RTL_CONSTASCII_USTRINGPARAM("TW")); + static OUString en_US(RTL_CONSTASCII_USTRINGPARAM("en_US")); + + sal_Int32 l = rLocale.Language.getLength(); + sal_Int32 c = rLocale.Country.getLength(); + sal_Int32 v = rLocale.Variant.getLength(); + aBuf.ensureCapacity(l+c+v+3); + + LocaleDataLookupTableItem *pCachedItem = 0; + + if ((l > 0 && c > 0 && v > 0 && + // load function with name <func>_<lang>_<country>_<varian> + (pSymbol = rLookupTable.getFunctionSymbolByName(aBuf.append(rLocale.Language).append(under).append( + rLocale.Country).append(under).append(rLocale.Variant).makeStringAndClear(), pFunction, &pCachedItem)) != 0) || + (l > 0 && c > 0 && + // load function with name <ase>_<lang>_<country> + (pSymbol = rLookupTable.getFunctionSymbolByName(aBuf.append(rLocale.Language).append(under).append( + rLocale.Country).makeStringAndClear(), pFunction, &pCachedItem)) != 0) || + (l > 0 && c > 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. + (pSymbol = rLookupTable.getFunctionSymbolByName(aBuf.append(rLocale.Language).append(under).append(tw).makeStringAndClear(), + pFunction, &pCachedItem)) != 0) || + (l > 0 && + // load function with name <func>_<lang> + (pSymbol = rLookupTable.getFunctionSymbolByName(rLocale.Language, pFunction, &pCachedItem)) != 0) || + // load default function with name <func>_en_US + (pSymbol = rLookupTable.getFunctionSymbolByName(en_US, pFunction, &pCachedItem)) != 0) + { + if( pCachedItem ) + cachedItem.reset( pCachedItem ); + if( cachedItem.get()) + cachedItem->aLocale = rLocale; + return pSymbol; + } + throw RuntimeException(); } Sequence< Locale > SAL_CALL |