| Index: base/i18n/break_iterator.cc
|
| diff --git a/base/i18n/break_iterator.cc b/base/i18n/break_iterator.cc
|
| index 8788eb7f1ba757d4614d4a3ee3e47d2d7875be30..89b1d0f1b8071be2a2da7d63fc783ca6638cd305 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)
|
| + 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_);
|
|
|