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

Unified Diff: base/i18n/break_iterator.cc

Issue 1272683002: Creates BreakIterator::GetWordBreakStatus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Khmer tests and ASCII-fied comments. Created 5 years, 4 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
Index: base/i18n/break_iterator.cc
diff --git a/base/i18n/break_iterator.cc b/base/i18n/break_iterator.cc
index e2ed667572f52d8b033cb9899186d73852846755..bc20fff928a6c77d1360446cfc95251e4134bd78 100644
--- a/base/i18n/break_iterator.cc
+++ b/base/i18n/break_iterator.cc
@@ -138,10 +138,14 @@ bool BreakIterator::SetText(const base::char16* text, const size_t length) {
}
bool BreakIterator::IsWord() const {
+ return GetWordBreakStatus() == IS_WORD_BREAK;
+}
+
+BreakIterator::WordBreakStatus BreakIterator::GetWordBreakStatus() const {
int32_t status = ubrk_getRuleStatus(static_cast<UBreakIterator*>(iter_));
if (break_type_ != BREAK_WORD && break_type_ != RULE_BASED)
- return false;
- return status != UBRK_WORD_NONE;
+ return IS_LINE_OR_CHAR_BREAK;
+ return status == UBRK_WORD_NONE ? IS_SKIPPABLE_WORD : IS_WORD_BREAK;
}
bool BreakIterator::IsEndOfWord(size_t position) const {

Powered by Google App Engine
This is Rietveld 408576698