From a916e2253df2bf1415c25fb7f974e0d16b615d03 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 20 Jul 2020 20:22:55 +0200 Subject: 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 --- i18npool/source/breakiterator/breakiterator_unicode.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'i18npool/source') 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 -- cgit