diff options
author | Mark Hung <marklh9@gmail.com> | 2017-10-01 14:53:51 +0800 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-10-04 12:54:16 +0200 |
commit | 441fded7f7fc8a2564075406933226a6eea73dd1 (patch) | |
tree | 6e4b824aeda198665d36a5804f7c3f5bbc91aca7 /i18npool/qa | |
parent | 4791e6061518c49dcce937d7fafa57f5b9bef77f (diff) |
tdf#96197 do not break Korean words in the middle.
Korean words are composed of Hangul and are separated
by space or newline. This patch improves line breaking
function in CJK break iterator so that it does not
break Korean words in the middle. It now breaks at the
first character of the last Korean word.
Change-Id: I91b20733c0c5ec4755bf68eb0d7c14c42c1f3556
Reviewed-on: https://gerrit.libreoffice.org/42987
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'i18npool/qa')
-rw-r--r-- | i18npool/qa/cppunit/test_breakiterator.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx index 98a0bca96a77..552274864035 100644 --- a/i18npool/qa/cppunit/test_breakiterator.cxx +++ b/i18npool/qa/cppunit/test_breakiterator.cxx @@ -158,6 +158,22 @@ void TestBreakIterator::testLineBreaking() (void)m_xBreak->getLineBreak(aTest, 0, aLocale, 0, aHyphOptions, aUserOptions); } } + + //See https://bugs.documentfoundation.org/show_bug.cgi?id=96197 + { + const sal_Unicode HANGUL[] = { 0xc560, 0xad6D, 0xac00, 0xc758, 0x0020, 0xac00, + 0xc0ac, 0xb294}; + OUString aTest(HANGUL, SAL_N_ELEMENTS(HANGUL)); + + aLocale.Language = "ko"; + aLocale.Country = "KR"; + + { + i18n::LineBreakResults aResult = m_xBreak->getLineBreak(aTest, aTest.getLength()-2, aLocale, 0, + aHyphOptions, aUserOptions); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Expected a break don't split the Korean word!", static_cast<sal_Int32>(5), aResult.breakIndex); + } + } } //See https://bugs.libreoffice.org/show_bug.cgi?id=49629 |