Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable ICU Breakiterator for Khmer #4

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions i18npool/qa/cppunit/test_breakiterator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class TestBreakIterator : public test::BootstrapFixtureBase
#ifdef TODO
void testNorthernThai();
#endif
void testKhmer();
void testJapanese();
void testChinese();

Expand All @@ -60,9 +59,6 @@ class TestBreakIterator : public test::BootstrapFixtureBase
#endif
#ifdef TODO
CPPUNIT_TEST(testNorthernThai);
#endif
#if (U_ICU_VERSION_MAJOR_NUM > 4)
CPPUNIT_TEST(testKhmer);
#endif
CPPUNIT_TEST(testJapanese);
CPPUNIT_TEST(testChinese);
Expand Down Expand Up @@ -891,33 +887,6 @@ void TestBreakIterator::testNorthernThai()
}
#endif

#if (U_ICU_VERSION_MAJOR_NUM > 4)
// Not sure if any version earlier than 49 did have Khmer word boundary
// dictionaries, 4.6 does not.

//A test to ensure that our khmer word boundary detection is useful
//https://bugs.libreoffice.org/show_bug.cgi?id=52020
void TestBreakIterator::testKhmer()
{
lang::Locale aLocale;
aLocale.Language = "km";
aLocale.Country = "KH";

const sal_Unicode KHMER[] = { 0x17B2, 0x17D2, 0x1799, 0x1782, 0x17C1 };

OUString aTest(KHMER, SAL_N_ELEMENTS(KHMER));
i18n::Boundary aBounds = m_xBreak->getWordBoundary(aTest, 0, aLocale,
i18n::WordType::DICTIONARY_WORD, true);

CPPUNIT_ASSERT(aBounds.startPos == 0 && aBounds.endPos == 3);

aBounds = m_xBreak->getWordBoundary(aTest, aBounds.endPos, aLocale,
i18n::WordType::DICTIONARY_WORD, true);

CPPUNIT_ASSERT(aBounds.startPos == 3 && aBounds.endPos == 5);
}
#endif

void TestBreakIterator::doTestJapanese(uno::Reference< i18n::XBreakIterator > &xBreak)
{
lang::Locale aLocale;
Expand Down
4 changes: 2 additions & 2 deletions i18npool/source/breakiterator/breakiterator_unicode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ void SAL_CALL BreakIterator_Unicode::loadICUBreakIterator(const com::sun::star::
rbi = new OOoRuleBasedBreakIterator(udata_open("OpenOffice", "brk",
OUStringToOString(breakRules[breakType], RTL_TEXTENCODING_ASCII_US).getStr(), &status), status);
}
//use icu's breakiterator for Thai, Khmer, Tibetan and Dzongkha
else if (rLocale.Language != "th" && rLocale.Language != "lo" && rLocale.Language != "km" && rLocale.Language != "bo" && rLocale.Language != "dz")
//use icu's breakiterator for Thai, Tibetan and Dzongkha
else if (rLocale.Language != "th" && rLocale.Language != "lo" && rLocale.Language != "bo" && rLocale.Language != "dz")
{
status = U_ZERO_ERROR;
OStringBuffer aUDName(64);
Expand Down