diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-20 21:21:14 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-20 21:21:14 +0000 |
commit | aa351ca8d4ec607d94b1559bb78b46d8301daf1b (patch) | |
tree | fad1e2da20e07f483ff3a45ddc4c79a9fc8cccdb /base | |
parent | 9edeb71c75df9eed63d4e27e90c2ddfc287049b8 (diff) | |
download | chromium_src-aa351ca8d4ec607d94b1559bb78b46d8301daf1b.zip chromium_src-aa351ca8d4ec607d94b1559bb78b46d8301daf1b.tar.gz chromium_src-aa351ca8d4ec607d94b1559bb78b46d8301daf1b.tar.bz2 |
Revert 102006 - fix know issues in RenderText
1. add tests.
2. change SelectWord() to use BreakIterator, so it works for Chinese and Complex script.
3. DELETE/ReplaceChar delete/replace a whole grapheme. ReplaceTextInternal should only replace one grapheme when there is no selection.
4. pointing to position outside of text returns HOME/END position.
5. based on Chrome Linux omnibox and gedit, given
"abc| def", double click should select " " instead of "abc". Change test expectation.
BUG=90426
TEST=compile with touchui=1 test omnibox. run views_unittests.NativeTextfieldViewsTest/TextfieldViewsModelTest
Review URL: http://codereview.chromium.org/7841056
TBR=xji@google.com
Review URL: http://codereview.chromium.org/7982013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102020 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/i18n/break_iterator.cc | 21 | ||||
-rw-r--r-- | base/i18n/break_iterator.h | 6 |
2 files changed, 0 insertions, 27 deletions
diff --git a/base/i18n/break_iterator.cc b/base/i18n/break_iterator.cc index eae531c..afa1fd8 100644 --- a/base/i18n/break_iterator.cc +++ b/base/i18n/break_iterator.cc @@ -92,27 +92,6 @@ bool BreakIterator::IsWord() const { return (break_type_ == BREAK_WORD && status != UBRK_WORD_NONE); } -bool BreakIterator::IsEndOfWord(size_t position) const { - if (break_type_ != BREAK_WORD) - return false; - - UBreakIterator* iter = static_cast<UBreakIterator*>(iter_); - UBool boundary = ubrk_isBoundary(iter, static_cast<int32_t>(position)); - int32_t status = ubrk_getRuleStatus(iter); - return (!!boundary && status != UBRK_WORD_NONE); -} - -bool BreakIterator::IsStartOfWord(size_t position) const { - if (break_type_ != BREAK_WORD) - return false; - - UBreakIterator* iter = static_cast<UBreakIterator*>(iter_); - UBool boundary = ubrk_isBoundary(iter, static_cast<int32_t>(position)); - ubrk_next(iter); - int32_t next_status = ubrk_getRuleStatus(iter); - return (!!boundary && next_status != UBRK_WORD_NONE); -} - string16 BreakIterator::GetString() const { DCHECK(prev_ != npos && pos_ != npos); return string_.substr(prev_, pos_ - prev_); diff --git a/base/i18n/break_iterator.h b/base/i18n/break_iterator.h index 3207256..f375962 100644 --- a/base/i18n/break_iterator.h +++ b/base/i18n/break_iterator.h @@ -88,12 +88,6 @@ class BASE_I18N_EXPORT BreakIterator { // this distinction doesn't apply and it always retuns false. bool IsWord() const; - // Under BREAK_WORD mode, returns true if |position| is at the end of word or - // at the start of word. It always retuns false under BREAK_LINE and - // BREAK_NEWLINE modes. - bool IsEndOfWord(size_t position) const; - bool IsStartOfWord(size_t position) const; - // Returns the string between prev() and pos(). // Advance() must have been called successfully at least once for pos() to // have advanced to somewhere useful. |