Chromium Code Reviews| Index: ui/gfx/render_text_linux.cc | 
| diff --git a/ui/gfx/render_text_linux.cc b/ui/gfx/render_text_linux.cc | 
| index 4c100626d79b26659fda01412213e6820f02362a..2f02c24f3235549a7bf9d7a09f4269f7374b9ef6 100644 | 
| --- a/ui/gfx/render_text_linux.cc | 
| +++ b/ui/gfx/render_text_linux.cc | 
| @@ -80,15 +80,6 @@ RenderTextLinux::~RenderTextLinux() { | 
| ResetLayout(); | 
| } | 
| -base::i18n::TextDirection RenderTextLinux::GetTextDirection() { | 
| - EnsureLayout(); | 
| - | 
| - PangoDirection base_dir = pango_find_base_dir(layout_text_, -1); | 
| - if (base_dir == PANGO_DIRECTION_RTL || base_dir == PANGO_DIRECTION_WEAK_RTL) | 
| - return base::i18n::RIGHT_TO_LEFT; | 
| - return base::i18n::LEFT_TO_RIGHT; | 
| -} | 
| - | 
| Size RenderTextLinux::GetStringSize() { | 
| EnsureLayout(); | 
| int width = 0, height = 0; | 
| @@ -288,13 +279,18 @@ void RenderTextLinux::EnsureLayout() { | 
| layout_ = pango_cairo_create_layout(cr); | 
| cairo_destroy(cr); | 
| cairo_surface_destroy(surface); | 
| - SetupPangoLayoutWithFontDescription( | 
| - layout_, | 
| - GetDisplayText(), | 
| - font_list().GetFontDescriptionString(), | 
| - display_rect().width(), | 
| - base::i18n::GetFirstStrongCharacterDirection(text()), | 
| - Canvas::DefaultCanvasTextAlignment()); | 
| + | 
| + SetupPangoLayoutWithFontDescription(layout_, | 
| + GetDisplayText(), | 
| + font_list().GetFontDescriptionString(), | 
| + display_rect().width(), | 
| + GetTextDirection(), | 
| + Canvas::DefaultCanvasTextAlignment()); | 
| + | 
| + // Set the base text direction yeilded by the directionality mode. | 
| + pango_context_set_base_dir(pango_layout_get_context(layout_), | 
| + ((GetTextDirection() == base::i18n::RIGHT_TO_LEFT) ? | 
| 
 
Alexei Svitkine (slow)
2012/07/30 22:29:16
Nit: Too many parentheses. Suggest omitting the in
 
msw
2012/07/31 03:03:06
Done.
 
 | 
| + PANGO_DIRECTION_RTL : PANGO_DIRECTION_LTR)); | 
| // No width set so that the x-axis position is relative to the start of the | 
| // text. ToViewPoint and ToTextPoint take care of the position conversion |