summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-11-17 11:03:45 +0100
committerEike Rathke <erack@redhat.com>2017-11-20 19:28:10 +0100
commit9206a08ada00e8762c4a634f242bd566028964bb (patch)
treeeaa317ce6717d44f75c077a6db147b0ebd4994b7 /i18npool
parenta8687041c46b3fe93a76faa0a4a65e7069ef5e9d (diff)
Upgrade to ICU 60.1
Change-Id: I6d90f51ee88c4e1005edbaa93d23cfb94cb2acfb Reviewed-on: https://gerrit.libreoffice.org/44871 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/source/breakiterator/breakiterator_unicode.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx b/i18npool/source/breakiterator/breakiterator_unicode.cxx
index bd9d09a34afc..b4ca111179c1 100644
--- a/i18npool/source/breakiterator/breakiterator_unicode.cxx
+++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx
@@ -544,6 +544,27 @@ LineBreakResults SAL_CALL BreakIterator_Unicode::getLineBreak(
} else { //word boundary break
lbr.breakIndex = pLineBI->preceding(nStartPos);
lbr.breakType = BreakType::WORDBOUNDARY;
+
+ // Special case for Slash U+002F SOLIDUS in URI and path names.
+ // TR14 defines that as SY: Symbols Allowing Break After (A).
+ // This is unwanted in paths, see also i#17155
+ if (lbr.breakIndex > 0 && Text[lbr.breakIndex-1] == '/')
+ {
+ // Look backward and take any whitespace before as a break
+ // opportunity. This also glues something like "w/o".
+ // Avoid an overly long path and break it as was indicated.
+ // Overly long here is arbitrarily defined.
+ const sal_Int32 nOverlyLong = 66;
+ sal_Int32 nPos = lbr.breakIndex - 1;
+ while (nPos > 0 && lbr.breakIndex - nPos < nOverlyLong)
+ {
+ if (u_isWhitespace(Text.iterateCodePoints( &nPos, -1)))
+ {
+ lbr.breakIndex = nPos + 1;
+ break;
+ }
+ }
+ }
}
#define WJ 0x2060 // Word Joiner