summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-07-20 20:22:55 +0200
committerEike Rathke <erack@redhat.com>2020-07-22 14:37:30 +0200
commit005ec5a368f4c6d4081efee483f9585a4db306d3 (patch)
tree9eed6b0ce711e7c48c218c7a9e654df2fca01150 /i18npool
parent30bab6ff42297c9d7759d31e11e814bcb5d38cee (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.cxx5
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