Index: localedata.cxx =================================================================== RCS file: /cvs/l10n/i18npool/source/localedata/localedata.cxx,v retrieving revision 1.54.14.3 diff -p -u -r1.54.14.3 localedata.cxx --- localedata.cxx 18 Jan 2008 14:55:42 -0000 1.54.14.3 +++ localedata.cxx 8 Feb 2008 12:28:33 -0000 @@ -706,6 +706,11 @@ LocaleData::getAllFormats( const Locale& return seq; } +#define COLLATOR_OFFSET_ALGO 0 +#define COLLATOR_OFFSET_DEFAULT 1 +#define COLLATOR_OFFSET_RULE 2 +#define COLLATOR_ELEMENTS 3 + OUString SAL_CALL LocaleData::getCollatorRuleByAlgorithm( const Locale& rLocale, const OUString& algorithm ) throw(RuntimeException) { @@ -714,8 +719,8 @@ LocaleData::getCollatorRuleByAlgorithm( sal_Int16 collatorCount = 0; sal_Unicode **collatorArray = func(collatorCount); for(sal_Int16 i = 0; i < collatorCount; i++) - if (algorithm.equals(collatorArray[i*3])) - return OUString(collatorArray[i*3 + 2]); + if (algorithm.equals(collatorArray[i * COLLATOR_ELEMENTS + COLLATOR_OFFSET_ALGO])) + return OUString(collatorArray[i * COLLATOR_ELEMENTS + COLLATOR_OFFSET_RULE]); } return OUString(); } @@ -733,8 +738,9 @@ LocaleData::getCollatorImplementations( collatorArray = func(collatorCount); Sequence< Implementation > seq(collatorCount); for(sal_Int16 i = 0; i < collatorCount; i++) { - Implementation impl(collatorArray[i*2], - sal::static_int_cast(collatorArray[i*2 + 1][0])); + Implementation impl(collatorArray[i * COLLATOR_ELEMENTS + COLLATOR_OFFSET_ALGO], + sal::static_int_cast( + collatorArray[i * COLLATOR_ELEMENTS + COLLATOR_OFFSET_DEFAULT][0])); seq[i] = impl; } return seq;