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

Unified Diff: views/controls/combobox/native_combobox_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/combobox/native_combobox_win.cc
diff --git a/views/controls/combobox/native_combobox_win.cc b/views/controls/combobox/native_combobox_win.cc
index 720e51fff0931dce5a4bae291e020475cc26c3da..2134a75e3cabd690e7d341753a956633c36873dc 100644
--- a/views/controls/combobox/native_combobox_win.cc
+++ b/views/controls/combobox/native_combobox_win.cc
@@ -47,14 +47,12 @@ void NativeComboboxWin::UpdateFromModel() {
int max_width = 0;
int num_items = combobox_->model()->GetItemCount();
for (int i = 0; i < num_items; ++i) {
- const std::wstring& text = UTF16ToWide(combobox_->model()->GetItemAt(i));
+ std::wstring text = UTF16ToWide(combobox_->model()->GetItemAt(i));
// Inserting the Unicode formatting characters if necessary so that the
// text is displayed correctly in right-to-left UIs.
- std::wstring localized_text;
+ base::i18n::AdjustStringForLocaleDirection(&text);
const wchar_t* text_ptr = text.c_str();
- if (base::i18n::AdjustStringForLocaleDirection(text, &localized_text))
- text_ptr = localized_text.c_str();
SendMessage(native_view(), CB_ADDSTRING, 0,
reinterpret_cast<LPARAM>(text_ptr));

Powered by Google App Engine
This is Rietveld 408576698