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

Unified Diff: Source/core/rendering/RenderText.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/platform/graphics/mac/ComplexTextController.cpp ('k') | Source/core/rendering/break_lines.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderText.cpp
diff --git a/Source/core/rendering/RenderText.cpp b/Source/core/rendering/RenderText.cpp
index f58c8106a0358b232be6c0d0eff54e6017383f8f..169a10f99907cbb44eeb509c2a8cdae575578d4b 100644
--- a/Source/core/rendering/RenderText.cpp
+++ b/Source/core/rendering/RenderText.cpp
@@ -120,8 +120,8 @@ static void makeCapitalized(String* string, UChar previous)
result.reserveCapacity(length);
int32_t endOfWord;
- int32_t startOfWord = textBreakFirst(boundary);
- for (endOfWord = textBreakNext(boundary); endOfWord != TextBreakDone; startOfWord = endOfWord, endOfWord = textBreakNext(boundary)) {
+ int32_t startOfWord = boundary->first();
+ for (endOfWord = boundary->next(); endOfWord != TextBreakDone; startOfWord = endOfWord, endOfWord = boundary->next()) {
if (startOfWord) // Ignore first char of previous string
result.append(input[startOfWord - 1] == noBreakSpace ? noBreakSpace : toTitleCase(stringWithPrevious[startOfWord]));
for (int i = startOfWord + 1; i < endOfWord; i++)
@@ -1664,7 +1664,7 @@ int RenderText::previousOffset(int current) const
if (!iterator)
return current - 1;
- long result = textBreakPreceding(iterator, current);
+ long result = iterator->preceding(current);
if (result == TextBreakDone)
result = current - 1;
@@ -1820,7 +1820,7 @@ int RenderText::nextOffset(int current) const
if (!iterator)
return current + 1;
- long result = textBreakFollowing(iterator, current);
+ long result = iterator->following(current);
if (result == TextBreakDone)
result = current + 1;
« no previous file with comments | « Source/core/platform/graphics/mac/ComplexTextController.cpp ('k') | Source/core/rendering/break_lines.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698