View | Details | Raw Unified | Return to bug 214437
Collapse All | Expand All

(-)b/editors/libreoffice/files/patch-i18npool_source_breakiterator_breakiterator__unicode.cxx (+42 lines)
Added Link Here
1
Minimal exceprt from upstream fix only to unbreak build
2
3
https://cgit.freedesktop.org/libreoffice/core/commit/?id=3e42714c76b1347babfdea0564009d8d82a83af4
4
5
--- i18npool/source/breakiterator/breakiterator_unicode.cxx.orig	2016-05-04 21:28:24 UTC
6
+++ i18npool/source/breakiterator/breakiterator_unicode.cxx
7
@@ -64,10 +64,13 @@ BreakIterator_Unicode::~BreakIterator_Un
8
 class OOoRuleBasedBreakIterator : public RuleBasedBreakIterator
9
 {
10
     public:
11
+#if (U_ICU_VERSION_MAJOR_NUM < 58)
12
+    // RuleBasedBreakIterator::setBreakType() is private as of ICU 58.
13
     inline void publicSetBreakType(int32_t type)
14
         {
15
             setBreakType(type);
16
         };
17
+#endif
18
     OOoRuleBasedBreakIterator(UDataMemory* image,
19
                               UErrorCode &status)
20
         : RuleBasedBreakIterator(image, status)
21
@@ -143,12 +146,21 @@ void SAL_CALL BreakIterator_Unicode::loa
22
                 }
23
             }
24
             if (rbi) {
25
+#if (U_ICU_VERSION_MAJOR_NUM < 58)
26
+                // ICU 58 made RuleBasedBreakIterator::setBreakType() private
27
+                // instead of protected, so the old workaround of
28
+                // https://ssl.icu-project.org/trac/ticket/5498
29
+                // doesn't work anymore. However, they also claim to have fixed
30
+                // the cause that an initial fBreakType==-1 would lead to an
31
+                // endless loop under some circumstances.
32
+                // Let's see ...
33
                 switch (rBreakType) {
34
                     case LOAD_CHARACTER_BREAKITERATOR: rbi->publicSetBreakType(UBRK_CHARACTER); break;
35
                     case LOAD_WORD_BREAKITERATOR: rbi->publicSetBreakType(UBRK_WORD); break;
36
                     case LOAD_SENTENCE_BREAKITERATOR: rbi->publicSetBreakType(UBRK_SENTENCE); break;
37
                     case LOAD_LINE_BREAKITERATOR: rbi->publicSetBreakType(UBRK_LINE); break;
38
                 }
39
+#endif
40
                 icuBI->aBreakIterator = rbi;
41
             }
42
         }
(-)b/editors/libreoffice4/files/patch-i18npool_source_breakiterator_breakiterator__unicode.cxx (+42 lines)
Added Link Here
1
Minimal exceprt from upstream fix only to unbreak build
2
3
https://cgit.freedesktop.org/libreoffice/core/commit/?id=3e42714c76b1347babfdea0564009d8d82a83af4
4
5
--- i18npool/source/breakiterator/breakiterator_unicode.cxx.orig	2015-04-20 19:36:29 UTC
6
+++ i18npool/source/breakiterator/breakiterator_unicode.cxx
7
@@ -65,10 +65,13 @@ BreakIterator_Unicode::~BreakIterator_Un
8
 class OOoRuleBasedBreakIterator : public RuleBasedBreakIterator
9
 {
10
     public:
11
+#if (U_ICU_VERSION_MAJOR_NUM < 58)
12
+    // RuleBasedBreakIterator::setBreakType() is private as of ICU 58.
13
     inline void publicSetBreakType(int32_t type)
14
         {
15
             setBreakType(type);
16
         };
17
+#endif
18
     OOoRuleBasedBreakIterator(UDataMemory* image,
19
                               UErrorCode &status)
20
         : RuleBasedBreakIterator(image, status)
21
@@ -144,12 +147,21 @@ void SAL_CALL BreakIterator_Unicode::loa
22
                 }
23
             }
24
             if (rbi) {
25
+#if (U_ICU_VERSION_MAJOR_NUM < 58)
26
+                // ICU 58 made RuleBasedBreakIterator::setBreakType() private
27
+                // instead of protected, so the old workaround of
28
+                // https://ssl.icu-project.org/trac/ticket/5498
29
+                // doesn't work anymore. However, they also claim to have fixed
30
+                // the cause that an initial fBreakType==-1 would lead to an
31
+                // endless loop under some circumstances.
32
+                // Let's see ...
33
                 switch (rBreakType) {
34
                     case LOAD_CHARACTER_BREAKITERATOR: rbi->publicSetBreakType(UBRK_CHARACTER); break;
35
                     case LOAD_WORD_BREAKITERATOR: rbi->publicSetBreakType(UBRK_WORD); break;
36
                     case LOAD_SENTENCE_BREAKITERATOR: rbi->publicSetBreakType(UBRK_SENTENCE); break;
37
                     case LOAD_LINE_BREAKITERATOR: rbi->publicSetBreakType(UBRK_LINE); break;
38
                 }
39
+#endif
40
                 icuBI->aBreakIterator = rbi;
41
             }
42
         }

Return to bug 214437