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

Unified Diff: ui/gfx/render_text_linux.cc

Issue 10807082: Add RenderText DirectionalityMode enum and support; etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove errant blank line. 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
« no previous file with comments | « ui/gfx/render_text_linux.h ('k') | ui/gfx/render_text_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9619dc19e5e239a46a5be1e627738404b896f1ea 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,13 @@ 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());
// 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
« no previous file with comments | « ui/gfx/render_text_linux.h ('k') | ui/gfx/render_text_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698