1 Index: README.chromium 2 diff --git a/README.chromium b/README.chromium 3 index 76acd4b06530827413286a72fed86771147c88d8..7e85c4949f1b52bbbda26e2d90b49852aaff7563 100644 4 --- a/README.chromium 5 +++ b/README.chromium 6 @@ -255,5 +255,5 @@ This directory contains the source code of ICU 4.6 for C/C++ 7 - patches/csetdet.patch 8 - upstream bug: http://bugs.icu-project.org/trac/ticket/10318 9 10 - 11 - 12 +26. Add BreakIterator::getRuleStatus 13 + - Copy and paste BreakIterator::getRuleStatus API from icu 52 14 Index: patches/breakiterator.patch 15 diff --git a/patches/breakiterator.patch b/patches/breakiterator.patch 16 new file mode 100644 17 index 0000000000000000000000000000000000000000..f1b36a34d0b408940a9c528fa0c796e2db6cb457 18 --- /dev/null 19 +++ b/patches/breakiterator.patch 20 @@ -0,0 +1,74 @@ 21 +From c795f7766bd4f650a2396c834bc2a07768781ae8 Mon Sep 17 00:00:00 2001 22 +From: Igor Oliveira <igor.o (a] sisa.samsung.com> 23 +Date: Tue, 17 Sep 2013 14:43:07 -0700 24 +Subject: [PATCH] The CL https://codereview.chromium.org/23618052/ depends of 25 + an API that will be added by libicu 5.2, 26 + BreakIterator::getRuleStatus. This patch is just a copy and 27 + paste of the libicu 5.2 API into chromium libicu. 28 + 29 +--- 30 + README.chromium | 3 +++ 31 + source/common/brkiter.cpp | 7 +++++++ 32 + source/common/unicode/brkiter.h | 15 +++++++++++++++ 33 + 3 files changed, 25 insertions(+) 34 + 35 +diff --git a/README.chromium b/README.chromium 36 +index 76acd4b..eaf2e81 100644 37 +--- a/README.chromium 38 ++++ b/README.chromium 39 +@@ -255,5 +255,8 @@ This directory contains the source code of ICU 4.6 for C/C++ 40 + - patches/csetdet.patch 41 + - upstream bug: http://bugs.icu-project.org/trac/ticket/10318 42 + 43 ++26. Add BreakIterator::getRuleStatus 44 ++ - Copy and paste BreakIterator::getRuleStatus API from icu 5.2 45 ++ 46 + 47 + 48 +diff --git a/source/common/brkiter.cpp b/source/common/brkiter.cpp 49 +index 26f7b6a..41da826 100644 50 +--- a/source/common/brkiter.cpp 51 ++++ b/source/common/brkiter.cpp 52 +@@ -436,6 +436,13 @@ BreakIterator::getLocaleID(ULocDataLocaleType type, UErrorCode& status) const { 53 + return locBased.getLocaleID(type, status); 54 + } 55 + 56 ++// This implementation of getRuleStatus is a do-nothing stub, here to 57 ++// provide a default implementation for any derived BreakIterator classes that 58 ++// do not implement it themselves. 59 ++int32_t BreakIterator::getRuleStatus() const { 60 ++ return 0; 61 ++} 62 ++ 63 + U_NAMESPACE_END 64 + 65 + #endif /* #if !UCONFIG_NO_BREAK_ITERATION */ 66 +diff --git a/source/common/unicode/brkiter.h b/source/common/unicode/brkiter.h 67 +index bdd3cc7..1800336 100644 68 +--- a/source/common/unicode/brkiter.h 69 ++++ b/source/common/unicode/brkiter.h 70 +@@ -284,6 +284,21 @@ public: 71 + virtual int32_t next(int32_t n) = 0; 72 + 73 + /** 74 ++ * For RuleBasedBreakIterators, return the status tag from the 75 ++ * break rule that determined the most recently 76 ++ * returned break position. 77 ++ * <p> 78 ++ * For break iterator types that do not support a rule status, 79 ++ * a default value of 0 is returned. 80 ++ * <p> 81 ++ * @return the status from the break rule that determined the most recently 82 ++ * returned break position. 83 ++ * @see RuleBaseBreakIterator::getRuleStatus() 84 ++ * @see UWordBreak 85 ++ */ 86 ++ virtual int32_t getRuleStatus() const; 87 ++ 88 ++ /** 89 + * Create BreakIterator for word-breaks using the given locale. 90 + * Returns an instance of a BreakIterator implementing word breaks. 91 + * WordBreak is useful for word selection (ex. double click) 92 +-- 93 +1.7.12.4 (Apple Git-37) 94 + 95 Index: source/common/brkiter.cpp 96 diff --git a/source/common/brkiter.cpp b/source/common/brkiter.cpp 97 index 26f7b6a82e8b8981dce42a08d8fca6a2a42e81cc..41da826748370ad5caff57191e8c0f2f0da12c3e 100644 98 --- a/source/common/brkiter.cpp 99 +++ b/source/common/brkiter.cpp 100 @@ -436,6 +436,13 @@ BreakIterator::getLocaleID(ULocDataLocaleType type, UErrorCode& status) const { 101 return locBased.getLocaleID(type, status); 102 } 103 104 +// This implementation of getRuleStatus is a do-nothing stub, here to 105 +// provide a default implementation for any derived BreakIterator classes that 106 +// do not implement it themselves. 107 +int32_t BreakIterator::getRuleStatus() const { 108 + return 0; 109 +} 110 + 111 U_NAMESPACE_END 112 113 #endif /* #if !UCONFIG_NO_BREAK_ITERATION */ 114 Index: source/common/unicode/brkiter.h 115 diff --git a/source/common/unicode/brkiter.h b/source/common/unicode/brkiter.h 116 index bdd3cc700f46e62e56f1fa84bfe0a6dcf18406da..180033661b12fa135782f23a6fa72ff8efb07878 100644 117 --- a/source/common/unicode/brkiter.h 118 +++ b/source/common/unicode/brkiter.h 119 @@ -284,6 +284,21 @@ public: 120 virtual int32_t next(int32_t n) = 0; 121 122 /** 123 + * For RuleBasedBreakIterators, return the status tag from the 124 + * break rule that determined the most recently 125 + * returned break position. 126 + * <p> 127 + * For break iterator types that do not support a rule status, 128 + * a default value of 0 is returned. 129 + * <p> 130 + * @return the status from the break rule that determined the most recently 131 + * returned break position. 132 + * @see RuleBaseBreakIterator::getRuleStatus() 133 + * @see UWordBreak 134 + */ 135 + virtual int32_t getRuleStatus() const; 136 + 137 + /** 138 * Create BreakIterator for word-breaks using the given locale. 139 * Returns an instance of a BreakIterator implementing word breaks. 140 * WordBreak is useful for word selection (ex. double click) 141