summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Hong <khong@openoffice.org>2002-09-27 05:34:07 +0000
committerKarl Hong <khong@openoffice.org>2002-09-27 05:34:07 +0000
commitd34f3c67ab785dbea22e89a2d9cef3fd9340dd41 (patch)
tree8948cb76eceda0172b669f81415cdaf334f2810b
parent2399ec7b6f5aa1d264e356001fd63240c50b4546 (diff)
#99877# fix problem in loading collator and merging same phonetic entry
-rw-r--r--i18npool/source/indexentry/indexentrysupplier_default.cxx13
-rw-r--r--i18npool/source/indexentry/indexentrysupplier_ja_phonetic.cxx14
2 files changed, 19 insertions, 8 deletions
diff --git a/i18npool/source/indexentry/indexentrysupplier_default.cxx b/i18npool/source/indexentry/indexentrysupplier_default.cxx
index 29c7e99afd1f..01dde532167f 100644
--- a/i18npool/source/indexentry/indexentrysupplier_default.cxx
+++ b/i18npool/source/indexentry/indexentrysupplier_default.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: indexentrysupplier_default.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: fme $ $Date: 2002-06-26 08:22:03 $
+ * last change: $Author: khong $ $Date: 2002-09-27 06:34:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -128,8 +128,15 @@ sal_Int16 SAL_CALL IndexEntrySupplier_Unicode::compareIndexEntry(
sal_Int16 result = compareIndexKey( IndexEntry1, PhoneticEntry1, rLocale1,
IndexEntry2, PhoneticEntry2, rLocale2);
if (result == 0)
- return collator->compareString( getEntry(IndexEntry1, PhoneticEntry1, rLocale1),
+ result = collator->compareString( getEntry(IndexEntry1, PhoneticEntry1, rLocale1),
getEntry(IndexEntry2, PhoneticEntry2, rLocale2));
+
+ // equivalent of phonetic entries does not mean equivalent of index entries.
+ // we have to continue comparing index entry here.
+ if (result == 0 && usePhonetic && rLocale1 == rLocale2 &&
+ (PhoneticEntry1.getLength() > 0 || PhoneticEntry2.getLength() > 0))
+ return collator->compareString(IndexEntry1, IndexEntry2);
+
return result;
}
diff --git a/i18npool/source/indexentry/indexentrysupplier_ja_phonetic.cxx b/i18npool/source/indexentry/indexentrysupplier_ja_phonetic.cxx
index 31fa0fdba0e6..d56357cc5268 100644
--- a/i18npool/source/indexentry/indexentrysupplier_ja_phonetic.cxx
+++ b/i18npool/source/indexentry/indexentrysupplier_ja_phonetic.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: indexentrysupplier_ja_phonetic.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: vg $Date: 2002/07/25 04:38:11 $
+ * last change: $Author: khong $Date: 2002/07/25 11:19:59 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -93,14 +93,17 @@ sal_Int16 SAL_CALL IndexEntrySupplier_ja_phonetic::compareIndexEntry(
IndexEntrySupplier_ja_phonetic::getIndexKey(IndexEntry2, PhoneticEntry2, rLocale2));
if (result == 0)
- return collator->compareString(
+ result = collator->compareString(
PhoneticEntry1.getLength() > 0 ? PhoneticEntry1 : IndexEntry1,
PhoneticEntry2.getLength() > 0 ? PhoneticEntry2 : IndexEntry2);
+
+ if (result == 0 && (PhoneticEntry1.getLength() > 0 || PhoneticEntry2.getLength()))
+ return collator->compareString(IndexEntry1, IndexEntry2);
else
return result;
}
-static sal_Char first[] = "ja_phonetic_alphanumeric_first";
+static sal_Char first[] = "ja_phonetic (alphanumeric first)";
sal_Bool SAL_CALL IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_syllable::loadAlgorithm(
const com::sun::star::lang::Locale& rLocale, const rtl::OUString& SortAlgorithm,
sal_Int32 collatorOptions ) throw (com::sun::star::uno::RuntimeException)
@@ -117,7 +120,8 @@ sal_Bool SAL_CALL IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_consonant
aLocale = rLocale;
return collator->loadCollatorAlgorithm(rtl::OUString::createFromAscii(first), rLocale, collatorOptions) == 0;
}
-static sal_Char last[] = "ja_phonetic_alphanumeric_last";
+
+static sal_Char last[] = "ja_phonetic (alphanumeric last)";
sal_Bool SAL_CALL IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_syllable::loadAlgorithm(
const com::sun::star::lang::Locale& rLocale, const rtl::OUString& SortAlgorithm,
sal_Int32 collatorOptions ) throw (com::sun::star::uno::RuntimeException)