summaryrefslogtreecommitdiff
path: root/i18npool/source
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2011-02-22 16:58:01 -0500
committerKohei Yoshida <kyoshida@novell.com>2011-02-22 16:58:01 -0500
commit7f960a4c428452a78ee0256b71acc33e0962fc39 (patch)
tree2785aec841226eba465c5ed6532c1c40f22fd71e /i18npool/source
parent702dd17d17da78673c42b3a47022d24baec26cd3 (diff)
Fixed indentation and bracket style.
Diffstat (limited to 'i18npool/source')
-rw-r--r--i18npool/source/localedata/localedata.cxx91
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