[Libreoffice-commits] core.git: i18npool/source

Andras Timar (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 23 11:47:05 UTC 2020


 i18npool/source/collator/collator_unicode.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 082a6eb7f26f684020e8e086fd4c2fea28c49b3a
Author:     Andras Timar <andras.timar at collabora.com>
AuthorDate: Fri Jun 19 11:05:36 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Jul 23 13:46:23 2020 +0200

    tdf#132082 Fix a crash in LOKit (Japanese-only)
    
    Change-Id: I09c8d3a129c0d1d2fab561add0447869156b193f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96693
    Tested-by: Andras Timar <andras.timar at collabora.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/i18npool/source/collator/collator_unicode.cxx b/i18npool/source/collator/collator_unicode.cxx
index b046546ad12f..39037cf2e77b 100644
--- a/i18npool/source/collator/collator_unicode.cxx
+++ b/i18npool/source/collator/collator_unicode.cxx
@@ -395,6 +395,11 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang::
             icu::Locale icuLocale( LanguageTagIcu::getIcuLocale( LanguageTag( rLocale),
                         "", rAlgorithm.isEmpty() ? OUString("") : "collation=" + rAlgorithm));
 
+            // FIXME: apparently we get here in LOKit case only. When the language is Japanese, we pass "ja at collation=phonetic (alphanumeric first)" to ICU
+            // and ICU does not like this (U_ILLEGAL_ARGUMENT_ERROR). Subsequently LOKit crashes, because collator is nullptr.
+            if (!strcmp(icuLocale.getLanguage(), "ja"))
+                icuLocale = icu::Locale::getJapanese();
+
             // load ICU collator
             collator.reset( static_cast<icu::RuleBasedCollator*>( icu::Collator::createInstance(icuLocale, status) ) );
             if (! U_SUCCESS(status)) {


More information about the Libreoffice-commits mailing list