diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-07-20 20:22:55 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2020-07-21 13:17:47 +0200 |
commit | a916e2253df2bf1415c25fb7f974e0d16b615d03 (patch) | |
tree | 87b0a7574968de0238ab3c886fb5c72546a7d3a3 /i18npool/source | |
parent | 1994009b7d244a36314df56c6dafa6ce477c01ba (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>
Diffstat (limited to 'i18npool/source')
-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 2d2ac437b430..7c79b99ec028 100644 --- a/i18npool/source/breakiterator/breakiterator_unicode.cxx +++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx @@ -499,7 +499,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 |