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

Unified Diff: ui/gfx/render_text_win.cc

Issue 10807082: Add RenderText DirectionalityMode enum and support; etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Restore Label::SetURL; derive the direction from display text. Created 8 years, 5 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
diff --git a/ui/gfx/render_text_win.cc b/ui/gfx/render_text_win.cc
index fb5a96db09ee1f453aef2f913c74e2b91e650225..372c55aadf0545dc71a3ad0057776e7f0ef34a68 100644
--- a/ui/gfx/render_text_win.cc
+++ b/ui/gfx/render_text_win.cc
@@ -302,12 +302,6 @@ RenderTextWin::RenderTextWin()
RenderTextWin::~RenderTextWin() {
}
-base::i18n::TextDirection RenderTextWin::GetTextDirection() {
- EnsureLayout();
- return (script_state_.uBidiLevel == 0) ?
- base::i18n::LEFT_TO_RIGHT : base::i18n::RIGHT_TO_LEFT;
-}
-
Size RenderTextWin::GetStringSize() {
EnsureLayout();
return string_size_;
@@ -597,11 +591,9 @@ void RenderTextWin::ItemizeLogicalText() {
string_size_ = Size(0, GetFont().GetHeight());
common_baseline_ = 0;
- // Use the first strong character direction as the base text direction.
- // TODO(msw): Use the application text direction instead of LTR by default?
+ // Set the base text direction yeilded by the directionality mode.
script_state_.uBidiLevel =
- (base::i18n::GetFirstStrongCharacterDirection(text()) ==
- base::i18n::RIGHT_TO_LEFT) ? 1 : 0;
+ (GetTextDirection() == base::i18n::RIGHT_TO_LEFT) ? 1 : 0;
if (text().empty())
return;
« ui/gfx/render_text.h ('K') | « ui/gfx/render_text_win.h ('k') | ui/views/controls/label.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698