https://bugs.documentfoundation.org/show_bug.cgi?id=169590

--- Comment #3 from Saburo <[email protected]> ---
diff --git a/i18npool/source/breakiterator/breakiterator_cjk.cxx
b/i18npool/source/breakiterator/breakiterator_cjk.cxx
index f9b1b7e46199..a6b7fff28b0f 100644
--- a/i18npool/source/breakiterator/breakiterator_cjk.cxx
+++ b/i18npool/source/breakiterator/breakiterator_cjk.cxx
@@ -108,6 +108,13 @@ LineBreakResults SAL_CALL BreakIterator_CJK::getLineBreak(
         // tdf#130592: Fall back to the ICU breakiterator after applying
CJK-specific rules
         auto stBreak = BreakIterator_Unicode::getLineBreak(Text, nStartPos,
rLocale, nMinBreakPos,
                                                            hOptions,
bOptions);
+        if (!bOptions.applyForbiddenRules && stBreak.breakIndex < nStartPos)
+        {
+            stBreak.breakIndex = nStartPos;
+            stBreak.breakType = BreakType::WORDBOUNDARY;
+            return stBreak;
+        }
+        
         if (stBreak.breakIndex == nStartPos)
         {
             // Located break is valid under both iterators
@@ -116,7 +123,7 @@ LineBreakResults SAL_CALL BreakIterator_CJK::getLineBreak(

         // CJK break is not valid; restart search from the next candidate
         sal_Int32 nNextCandidate = stBreak.breakIndex;
-        while (bOptions.allowPunctuationOutsideMargin && nStartPos >
stBreak.breakIndex)
+        while (!bOptions.allowPunctuationOutsideMargin && nStartPos >
stBreak.breakIndex)
         {
             if (hangingCharacters.indexOf(Text[nStartPos]) != -1)
             {

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to