diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-24 07:27:42 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-24 07:27:42 +0000 |
commit | c32d31eab915dcff1f128bf744ced2ad8fa221ef (patch) | |
tree | 69a8fbf3b9360c6401bb4658893cafc4b2f209ed /views/controls/combobox/native_combobox_win.cc | |
parent | 6ee50a8d443f48e70921a8eed76f26a6e9844228 (diff) | |
download | chromium_src-c32d31eab915dcff1f128bf744ced2ad8fa221ef.zip chromium_src-c32d31eab915dcff1f128bf744ced2ad8fa221ef.tar.gz chromium_src-c32d31eab915dcff1f128bf744ced2ad8fa221ef.tar.bz2 |
Cleanup AdjustStringForLocaleDirection() to modify input parameter in place.
As described in the bug, the current behavior is confusing and bug-prone.
BUG=47194
TEST=Check that there are no visible regressions in RTL and LTR language UIs on Linux & Windows.
Review URL: http://codereview.chromium.org/5154009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67237 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/combobox/native_combobox_win.cc')
-rw-r--r-- | views/controls/combobox/native_combobox_win.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/views/controls/combobox/native_combobox_win.cc b/views/controls/combobox/native_combobox_win.cc index 720e51f..2134a75e 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)); |