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

Unified Diff: views/controls/textfield/native_textfield_win.cc

Issue 5154009: Cleanup AdjustStringForLocaleDirection() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: further fixes Created 10 years, 1 month 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: views/controls/textfield/native_textfield_win.cc
diff --git a/views/controls/textfield/native_textfield_win.cc b/views/controls/textfield/native_textfield_win.cc
index 2109cb9f5302fa471b9953f66e0618b2ad777833..3f4b0eb170d4869df178de19ff800b081a527e50 100644
--- a/views/controls/textfield/native_textfield_win.cc
+++ b/views/controls/textfield/native_textfield_win.cc
@@ -155,13 +155,11 @@ void NativeTextfieldWin::UpdateText() {
std::wstring text = textfield_->text();
// Adjusting the string direction before setting the text in order to make
// sure both RTL and LTR strings are displayed properly.
- std::wstring text_to_set;
- if (!base::i18n::AdjustStringForLocaleDirection(text, &text_to_set))
- text_to_set = text;
+ base::i18n::AdjustStringForLocaleDirection(&text);
if (textfield_->style() & Textfield::STYLE_LOWERCASE)
- text_to_set = l10n_util::ToLower(text_to_set);
- SetWindowText(text_to_set.c_str());
- UpdateAccessibleValue(text_to_set);
+ text = l10n_util::ToLower(text);
+ SetWindowText(text.c_str());
+ UpdateAccessibleValue(text);
}
void NativeTextfieldWin::AppendText(const string16& text) {

Powered by Google App Engine
This is Rietveld 408576698