Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Unified Diff: patches/breakiterator.patch

Issue 23532086: To use C++ API for BreakIterator in Blink, port getRuleStatus from ICU 52 (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/icu46/
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « README.chromium ('k') | source/common/brkiter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: patches/breakiterator.patch
===================================================================
--- patches/breakiterator.patch (revision 0)
+++ patches/breakiterator.patch (revision 0)
@@ -0,0 +1,140 @@
+Index: README.chromium
+diff --git a/README.chromium b/README.chromium
+index 76acd4b06530827413286a72fed86771147c88d8..7e85c4949f1b52bbbda26e2d90b49852aaff7563 100644
+--- a/README.chromium
++++ b/README.chromium
+@@ -255,5 +255,5 @@ This directory contains the source code of ICU 4.6 for C/C++
+ - patches/csetdet.patch
+ - upstream bug: http://bugs.icu-project.org/trac/ticket/10318
+
+-
+-
++26. Add BreakIterator::getRuleStatus
++ - Copy and paste BreakIterator::getRuleStatus API from icu 52
+Index: patches/breakiterator.patch
+diff --git a/patches/breakiterator.patch b/patches/breakiterator.patch
+new file mode 100644
+index 0000000000000000000000000000000000000000..f1b36a34d0b408940a9c528fa0c796e2db6cb457
+--- /dev/null
++++ b/patches/breakiterator.patch
+@@ -0,0 +1,74 @@
++From c795f7766bd4f650a2396c834bc2a07768781ae8 Mon Sep 17 00:00:00 2001
++From: Igor Oliveira <igor.o@sisa.samsung.com>
++Date: Tue, 17 Sep 2013 14:43:07 -0700
++Subject: [PATCH] The CL https://codereview.chromium.org/23618052/ depends of
++ an API that will be added by libicu 5.2,
++ BreakIterator::getRuleStatus. This patch is just a copy and
++ paste of the libicu 5.2 API into chromium libicu.
++
++---
++ README.chromium | 3 +++
++ source/common/brkiter.cpp | 7 +++++++
++ source/common/unicode/brkiter.h | 15 +++++++++++++++
++ 3 files changed, 25 insertions(+)
++
++diff --git a/README.chromium b/README.chromium
++index 76acd4b..eaf2e81 100644
++--- a/README.chromium
+++++ b/README.chromium
++@@ -255,5 +255,8 @@ This directory contains the source code of ICU 4.6 for C/C++
++ - patches/csetdet.patch
++ - upstream bug: http://bugs.icu-project.org/trac/ticket/10318
++
+++26. Add BreakIterator::getRuleStatus
+++ - Copy and paste BreakIterator::getRuleStatus API from icu 5.2
+++
++
++
++diff --git a/source/common/brkiter.cpp b/source/common/brkiter.cpp
++index 26f7b6a..41da826 100644
++--- a/source/common/brkiter.cpp
+++++ b/source/common/brkiter.cpp
++@@ -436,6 +436,13 @@ BreakIterator::getLocaleID(ULocDataLocaleType type, UErrorCode& status) const {
++ return locBased.getLocaleID(type, status);
++ }
++
+++// This implementation of getRuleStatus is a do-nothing stub, here to
+++// provide a default implementation for any derived BreakIterator classes that
+++// do not implement it themselves.
+++int32_t BreakIterator::getRuleStatus() const {
+++ return 0;
+++}
+++
++ U_NAMESPACE_END
++
++ #endif /* #if !UCONFIG_NO_BREAK_ITERATION */
++diff --git a/source/common/unicode/brkiter.h b/source/common/unicode/brkiter.h
++index bdd3cc7..1800336 100644
++--- a/source/common/unicode/brkiter.h
+++++ b/source/common/unicode/brkiter.h
++@@ -284,6 +284,21 @@ public:
++ virtual int32_t next(int32_t n) = 0;
++
++ /**
+++ * For RuleBasedBreakIterators, return the status tag from the
+++ * break rule that determined the most recently
+++ * returned break position.
+++ * <p>
+++ * For break iterator types that do not support a rule status,
+++ * a default value of 0 is returned.
+++ * <p>
+++ * @return the status from the break rule that determined the most recently
+++ * returned break position.
+++ * @see RuleBaseBreakIterator::getRuleStatus()
+++ * @see UWordBreak
+++ */
+++ virtual int32_t getRuleStatus() const;
+++
+++ /**
++ * Create BreakIterator for word-breaks using the given locale.
++ * Returns an instance of a BreakIterator implementing word breaks.
++ * WordBreak is useful for word selection (ex. double click)
++--
++1.7.12.4 (Apple Git-37)
++
+Index: source/common/brkiter.cpp
+diff --git a/source/common/brkiter.cpp b/source/common/brkiter.cpp
+index 26f7b6a82e8b8981dce42a08d8fca6a2a42e81cc..41da826748370ad5caff57191e8c0f2f0da12c3e 100644
+--- a/source/common/brkiter.cpp
++++ b/source/common/brkiter.cpp
+@@ -436,6 +436,13 @@ BreakIterator::getLocaleID(ULocDataLocaleType type, UErrorCode& status) const {
+ return locBased.getLocaleID(type, status);
+ }
+
++// This implementation of getRuleStatus is a do-nothing stub, here to
++// provide a default implementation for any derived BreakIterator classes that
++// do not implement it themselves.
++int32_t BreakIterator::getRuleStatus() const {
++ return 0;
++}
++
+ U_NAMESPACE_END
+
+ #endif /* #if !UCONFIG_NO_BREAK_ITERATION */
+Index: source/common/unicode/brkiter.h
+diff --git a/source/common/unicode/brkiter.h b/source/common/unicode/brkiter.h
+index bdd3cc700f46e62e56f1fa84bfe0a6dcf18406da..180033661b12fa135782f23a6fa72ff8efb07878 100644
+--- a/source/common/unicode/brkiter.h
++++ b/source/common/unicode/brkiter.h
+@@ -284,6 +284,21 @@ public:
+ virtual int32_t next(int32_t n) = 0;
+
+ /**
++ * For RuleBasedBreakIterators, return the status tag from the
++ * break rule that determined the most recently
++ * returned break position.
++ * <p>
++ * For break iterator types that do not support a rule status,
++ * a default value of 0 is returned.
++ * <p>
++ * @return the status from the break rule that determined the most recently
++ * returned break position.
++ * @see RuleBaseBreakIterator::getRuleStatus()
++ * @see UWordBreak
++ */
++ virtual int32_t getRuleStatus() const;
++
++ /**
+ * Create BreakIterator for word-breaks using the given locale.
+ * Returns an instance of a BreakIterator implementing word breaks.
+ * WordBreak is useful for word selection (ex. double click)
Property changes on: patches/breakiterator.patch
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « README.chromium ('k') | source/common/brkiter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698