Chromium Code Reviews| Index: base/i18n/break_iterator.cc |
| diff --git a/base/i18n/break_iterator.cc b/base/i18n/break_iterator.cc |
| index fe26a03a0b89fa85ba7501d4aaf9dd59464369f3..4d72a9f8e84665ee27c178beb3163dc06cba22ed 100644 |
| --- a/base/i18n/break_iterator.cc |
| +++ b/base/i18n/break_iterator.cc |
| @@ -138,13 +138,13 @@ bool BreakIterator::SetText(const base::char16* text, const size_t length) { |
| bool BreakIterator::IsWord() const { |
| int32_t status = ubrk_getRuleStatus(static_cast<UBreakIterator*>(iter_)); |
| if (break_type_ != BREAK_WORD && break_type_ != RULE_BASED) |
| - return false; |
| + return false; |
| return status != UBRK_WORD_NONE; |
| } |
| bool BreakIterator::IsEndOfWord(size_t position) const { |
| if (break_type_ != BREAK_WORD && break_type_ != RULE_BASED) |
| - return false; |
| + return false; |
| UBreakIterator* iter = static_cast<UBreakIterator*>(iter_); |
| UBool boundary = ubrk_isBoundary(iter, static_cast<int32_t>(position)); |
| @@ -154,7 +154,7 @@ bool BreakIterator::IsEndOfWord(size_t position) const { |
| bool BreakIterator::IsStartOfWord(size_t position) const { |
| if (break_type_ != BREAK_WORD && break_type_ != RULE_BASED) |
| - return false; |
| + return false; |
| UBreakIterator* iter = static_cast<UBreakIterator*>(iter_); |
| UBool boundary = ubrk_isBoundary(iter, static_cast<int32_t>(position)); |
| @@ -163,6 +163,14 @@ bool BreakIterator::IsStartOfWord(size_t position) const { |
| return (!!boundary && next_status != UBRK_WORD_NONE); |
| } |
| +bool BreakIterator::IsGraphemeBoundary(size_t position) const { |
| + if (break_type_ != BREAK_CHARACTER) |
|
msw
2014/06/29 22:29:09
q: Wouldn't any other break type work, except perh
ckocagil
2014/07/24 21:46:55
Makes sense, but I'm not sure. We can ask the Brea
msw
2014/07/25 00:36:59
+jshin for thoughts here and general BreakIterator
|
| + return false; |
| + |
| + UBreakIterator* iter = static_cast<UBreakIterator*>(iter_); |
| + return !!ubrk_isBoundary(iter, static_cast<int32_t>(position)); |
| +} |
| + |
| string16 BreakIterator::GetString() const { |
| DCHECK(prev_ != npos && pos_ != npos); |
| return string_.substr(prev_, pos_ - prev_); |