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

Unified Diff: Source/core/editing/VisibleUnits.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/editing/TextCheckingHelper.cpp ('k') | Source/core/page/TouchAdjustment.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/VisibleUnits.cpp
diff --git a/Source/core/editing/VisibleUnits.cpp b/Source/core/editing/VisibleUnits.cpp
index 70fb38362516cdb54c01310f349272f9392dbf75..657adfe433224be733604426b965d29c10972b64 100644
--- a/Source/core/editing/VisibleUnits.cpp
+++ b/Source/core/editing/VisibleUnits.cpp
@@ -326,18 +326,18 @@ static TextBreakIterator* wordBreakIteratorForMaxOffsetBoundary(const VisiblePos
static bool isLogicalStartOfWord(TextBreakIterator* iter, int position, bool hardLineBreak)
{
- bool boundary = hardLineBreak ? true : isTextBreak(iter, position);
+ bool boundary = hardLineBreak ? true : iter->isBoundary(position);
if (!boundary)
return false;
- textBreakFollowing(iter, position);
+ iter->following(position);
// isWordTextBreak returns true after moving across a word and false after moving across a punctuation/space.
return isWordTextBreak(iter);
}
static bool islogicalEndOfWord(TextBreakIterator* iter, int position, bool hardLineBreak)
{
- bool boundary = isTextBreak(iter, position);
+ bool boundary = iter->isBoundary(position);
return (hardLineBreak || boundary) && isWordTextBreak(iter);
}
@@ -391,7 +391,7 @@ static VisiblePosition visualWordPosition(const VisiblePosition& visiblePosition
if (!iter)
break;
- textBreakFirst(iter);
+ iter->first();
int offsetInIterator = offsetInBox - textBox->start() + previousBoxLength;
bool isWordBreak;
@@ -1043,7 +1043,7 @@ static unsigned startSentenceBoundary(const UChar* characters, unsigned length,
{
TextBreakIterator* iterator = sentenceBreakIterator(characters, length);
// FIXME: The following function can return -1; we don't handle that.
- return textBreakPreceding(iterator, length);
+ return iterator->preceding(length);
}
VisiblePosition startOfSentence(const VisiblePosition &c)
@@ -1054,7 +1054,7 @@ VisiblePosition startOfSentence(const VisiblePosition &c)
static unsigned endSentenceBoundary(const UChar* characters, unsigned length, unsigned, BoundarySearchContextAvailability, bool&)
{
TextBreakIterator* iterator = sentenceBreakIterator(characters, length);
- return textBreakNext(iterator);
+ return iterator->next();
}
// FIXME: This includes the space after the punctuation that marks the end of the sentence.
@@ -1068,7 +1068,7 @@ static unsigned previousSentencePositionBoundary(const UChar* characters, unsign
// FIXME: This is identical to startSentenceBoundary. I'm pretty sure that's not right.
TextBreakIterator* iterator = sentenceBreakIterator(characters, length);
// FIXME: The following function can return -1; we don't handle that.
- return textBreakPreceding(iterator, length);
+ return iterator->preceding(length);
}
VisiblePosition previousSentencePosition(const VisiblePosition &c)
@@ -1082,7 +1082,7 @@ static unsigned nextSentencePositionBoundary(const UChar* characters, unsigned l
// FIXME: This is identical to endSentenceBoundary. This isn't right, it needs to
// move to the equivlant position in the following sentence.
TextBreakIterator* iterator = sentenceBreakIterator(characters, length);
- return textBreakFollowing(iterator, 0);
+ return iterator->following(0);
}
VisiblePosition nextSentencePosition(const VisiblePosition &c)
« no previous file with comments | « Source/core/editing/TextCheckingHelper.cpp ('k') | Source/core/page/TouchAdjustment.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698