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

Unified Diff: Source/platform/text/TextBoundaries.cpp

Issue 23618052: TextBreakIterator should use the C++ icu API instead of the C one (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Downcast to icu::RuleBasedBreakIterator Created 7 years, 2 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 | « Source/core/rendering/break_lines.cpp ('k') | Source/platform/text/TextBreakIterator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/text/TextBoundaries.cpp
diff --git a/Source/platform/text/TextBoundaries.cpp b/Source/platform/text/TextBoundaries.cpp
index 4dd3f76fe1c0dc30369a6d001399262e624c3090..69a045ae6c3439e31fca8d1824786a42eb58f1f7 100644
--- a/Source/platform/text/TextBoundaries.cpp
+++ b/Source/platform/text/TextBoundaries.cpp
@@ -65,26 +65,26 @@ int findNextWordFromIndex(const UChar* chars, int len, int position, bool forwar
TextBreakIterator* it = wordBreakIterator(chars, len);
if (forward) {
- position = textBreakFollowing(it, position);
+ position = it->following(position);
while (position != TextBreakDone) {
// We stop searching when the character preceeding the break
// is alphanumeric.
if (position < len && isAlphanumeric(chars[position - 1]))
return position;
- position = textBreakFollowing(it, position);
+ position = it->following(position);
}
return len;
} else {
- position = textBreakPreceding(it, position);
+ position = it->preceding(position);
while (position != TextBreakDone) {
// We stop searching when the character following the break
// is alphanumeric.
if (position > 0 && isAlphanumeric(chars[position]))
return position;
- position = textBreakPreceding(it, position);
+ position = it->preceding(position);
}
return 0;
@@ -94,10 +94,10 @@ int findNextWordFromIndex(const UChar* chars, int len, int position, bool forwar
void findWordBoundary(const UChar* chars, int len, int position, int* start, int* end)
{
TextBreakIterator* it = wordBreakIterator(chars, len);
- *end = textBreakFollowing(it, position);
+ *end = it->following(position);
if (*end < 0)
- *end = textBreakLast(it);
- *start = textBreakPrevious(it);
+ *end = it->last();
+ *start = it->previous();
}
« no previous file with comments | « Source/core/rendering/break_lines.cpp ('k') | Source/platform/text/TextBreakIterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698