Index: gfx/canvas_skia_win.cc |
diff --git a/gfx/canvas_skia_win.cc b/gfx/canvas_skia_win.cc |
index 1a65da09acd83dfd485458926e77d389be8307f3..dd8c96a599586dc1ada3c20c9e4abed3d9fae166 100644 |
--- a/gfx/canvas_skia_win.cc |
+++ b/gfx/canvas_skia_win.cc |
@@ -19,17 +19,18 @@ void DoDrawText(HDC hdc, |
const std::wstring& text, |
RECT* text_bounds, |
int flags) { |
- std::wstring localized_text; |
- const wchar_t* string_ptr = text.c_str(); |
- int string_size = static_cast<int>(text.length()); |
// Only adjust string directionality if both of the following are true: |
// 1. The current locale is RTL. |
// 2. The string itself has RTL directionality. |
+ const wchar_t* string_ptr = text.c_str(); |
+ int string_size = static_cast<int>(text.length()); |
+ |
+ std::wstring localized_text; |
if (flags & DT_RTLREADING) { |
- if (base::i18n::AdjustStringForLocaleDirection(text, &localized_text)) { |
- string_ptr = localized_text.c_str(); |
- string_size = static_cast<int>(localized_text.length()); |
- } |
+ localized_text = text; |
+ base::i18n::AdjustStringForLocaleDirection(&localized_text); |
+ string_ptr = localized_text.c_str(); |
+ string_size = static_cast<int>(localized_text.length()); |
} |
DrawText(hdc, string_ptr, string_size, text_bounds, flags); |