summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-07-20 20:22:55 +0200
committerThorsten Behrens <thorsten.behrens@allotropia.de>2021-04-09 23:22:02 +0200
commit96e2b551146c65a7225ad04a4c36710d72a8d99a (patch)
tree6c854e985ac8ae431c99521cc18abd3888f18414 /i18npool
parentfead20b42ae98decca0bab0d7132d0f402415cc2 (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) 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) Change-Id: I2aaefbc7b25af157e0a6ef15fabaa71bff1e8d9a
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 398bdd7326c0..ff889e87e72d 100644
--- a/i18npool/source/breakiterator/breakiterator_unicode.cxx
+++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx
@@ -498,7 +498,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