diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-07-20 20:22:55 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2020-07-23 10:24:36 +0200 |
commit | df20753e3bc9f65994f53fee57ee64ed091ae706 (patch) | |
tree | c3c74770721addd85f5b4fbafe778995539f0731 /i18npool | |
parent | fd36cfcbc73188c2ad98870d59847ba45bd95820 (diff) |
i18npool: don't break line at slash '/'
If sw text formatting gets the result of the special-case code added to
the "word boundary break" condition, it may call again the next time
with the preceding index, and fall into the "Line boundary break"
condition, which hence also needs to special case '/'.
(regression from ICU 60, 9206a08ada00e8762c4a634f242bd566028964bb)
Change-Id: I2aaefbc7b25af157e0a6ef15fabaa71bff1e8d9a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99104
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
(cherry picked from commit a916e2253df2bf1415c25fb7f974e0d16b615d03)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99132
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/source/breakiterator/breakiterator_unicode.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx b/i18npool/source/breakiterator/breakiterator_unicode.cxx index e1675ec6a41d..61a8b6473982 100644 --- a/i18npool/source/breakiterator/breakiterator_unicode.cxx +++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx @@ -495,7 +495,10 @@ LineBreakResults SAL_CALL BreakIterator_Unicode::getLineBreak( icu::BreakIterator* pLineBI = line.mpValue->mpBreakIterator.get(); bool GlueSpace=true; while (GlueSpace) { - if (pLineBI->preceding(nStartPos + 1) == nStartPos) { //Line boundary break + // don't break with Slash U+002F SOLIDUS at end of line; see "else" below! + if (pLineBI->preceding(nStartPos + 1) == nStartPos + && (nStartPos == 0 || Text[nStartPos - 1] != '/')) + { //Line boundary break lbr.breakIndex = nStartPos; lbr.breakType = BreakType::WORDBOUNDARY; } else if (hOptions.rHyphenator.is()) { //Hyphenation break |