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

Unified Diff: ui/gfx/render_text_win.cc

Issue 7841056: fix know issues in RenderText (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: aupdate RenderTextWin. update test for Win platform. upload RenderTextTest that was missed Created 9 years, 3 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: 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());

Powered by Google App Engine
This is Rietveld 408576698