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

Unified Diff: views/controls/label.cc

Issue 6930047: wstring: remove wstring version of SplitString (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 9 years, 8 months 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 | « base/string_split_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/label.cc
diff --git a/views/controls/label.cc b/views/controls/label.cc
index 80454c342d7bc46351b50743917ffd7ac2dcfa22..627dd98bab7b7be0f2300e4bc769e1b69cb95ab1 100644
--- a/views/controls/label.cc
+++ b/views/controls/label.cc
@@ -141,14 +141,13 @@ const Background* Label::GetMouseOverBackground() const {
void Label::SizeToFit(int max_width) {
DCHECK(is_multi_line_);
- std::vector<std::wstring> lines;
- base::SplitString(UTF16ToWideHack(text_), L'\n', &lines);
+ std::vector<string16> lines;
+ base::SplitString(text_, '\n', &lines);
int label_width = 0;
- for (std::vector<std::wstring>::const_iterator iter = lines.begin();
+ for (std::vector<string16>::const_iterator iter = lines.begin();
iter != lines.end(); ++iter) {
- label_width = std::max(label_width,
- font_.GetStringWidth(WideToUTF16Hack(*iter)));
+ label_width = std::max(label_width, font_.GetStringWidth(*iter));
}
label_width += GetInsets().width();
« no previous file with comments | « base/string_split_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698