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

Unified Diff: app/win_util.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
« no previous file with comments | « no previous file | base/i18n/rtl.h » ('j') | base/i18n/rtl.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/win_util.cc
diff --git a/app/win_util.cc b/app/win_util.cc
index be267afbfbe42cbf45b2e8d12614eb28d7740ea2..b3a057169aa611827b2c0825760e948cd354648d 100644
--- a/app/win_util.cc
+++ b/app/win_util.cc
@@ -533,15 +533,13 @@ int MessageBox(HWND hwnd,
if (base::i18n::IsRTL())
actual_flags |= MB_RIGHT | MB_RTLREADING;
- std::wstring localized_text;
- const wchar_t* text_ptr = text.c_str();
- if (base::i18n::AdjustStringForLocaleDirection(text, &localized_text))
- text_ptr = localized_text.c_str();
-
- std::wstring localized_caption;
- const wchar_t* caption_ptr = caption.c_str();
- if (base::i18n::AdjustStringForLocaleDirection(caption, &localized_caption))
- caption_ptr = localized_caption.c_str();
+ std::wstring localized_text = text;
+ base::i18n::AdjustStringForLocaleDirection(&localized_text);
+ const wchar_t* text_ptr = localized_text.c_str();
+
+ std::wstring localized_caption = caption;
+ base::i18n::AdjustStringForLocaleDirection(&localized_caption);
+ const wchar_t* caption_ptr = localized_caption.c_str();
return ::MessageBox(hwnd, text_ptr, caption_ptr, actual_flags);
}
« no previous file with comments | « no previous file | base/i18n/rtl.h » ('j') | base/i18n/rtl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698