Chromium Code Reviews| Index: ui/gfx/render_text_win.cc |
| =================================================================== |
| --- ui/gfx/render_text_win.cc (revision 100008) |
| +++ ui/gfx/render_text_win.cc (working copy) |
| @@ -191,6 +191,10 @@ |
| return rect; |
| } |
| +size_t RenderTextWin::GetIndexOfNextGrapheme(size_t position) { |
| + return IndexOfAdjacentGrapheme(position, true); |
| +} |
| + |
| SelectionModel RenderTextWin::GetLeftSelectionModel( |
| const SelectionModel& selection, |
| BreakType break_type) { |
| @@ -295,6 +299,19 @@ |
| return bounds; |
| } |
| +bool RenderTextLinux::IsCursorablePosition(size_t position) { |
|
msw
2011/09/14 02:43:48
RenderText*Win*
xji
2011/09/15 23:38:13
Done.
|
| + if (position == 0 || position == text().length()) |
| + return true; |
| + |
| + size_t run_index = GetRunContainingPosition(position); |
| + internal::TextRun* run = run_index < runs_.size() ? runs_[run_index] : NULL; |
| + if (!run) |
|
msw
2011/09/14 02:43:48
This could just be "if (run_index >= runs_.size())
xji
2011/09/15 23:38:13
Done.
|
| + return false; |
| + if (position == run->range.start()) |
| + return true; |
| + return run->logical_clusters[position] != run->logical_clusters[position -1]; |
|
msw
2011/09/14 02:43:48
The logical clusters array is indexed by offsets f
xji
2011/09/15 23:38:13
Done.
|
| +} |
| + |
| void RenderTextWin::ItemizeLogicalText() { |
| text_is_dirty_ = false; |
| STLDeleteContainerPointers(runs_.begin(), runs_.end()); |