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

Unified Diff: views/controls/label.cc

Issue 5158006: Convert SizeStringInt from taking a wstring to a string16. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mac 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 | « views/controls/button/text_button.cc ('k') | views/view_text_utils.cc » ('j') | 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 32df88a7d5488f5ddbdc88df72e95551cfa6b467..b228c78b2bed6a28cb32551af0b73de2e5138a8d 100644
--- a/views/controls/label.cc
+++ b/views/controls/label.cc
@@ -68,7 +68,8 @@ int Label::GetHeightForWidth(int w) {
w = std::max(0, w - GetInsets().width());
int h = font_.GetHeight();
- gfx::CanvasSkia::SizeStringInt(text_, font_, &w, &h, ComputeMultiLineFlags());
+ gfx::CanvasSkia::SizeStringInt(WideToUTF16Hack(text_), font_, &w, &h,
+ ComputeMultiLineFlags());
return h + GetInsets().height();
}
@@ -294,7 +295,8 @@ gfx::Size Label::GetTextSize() const {
int flags = ComputeMultiLineFlags();
if (!is_multi_line_)
flags |= gfx::Canvas::NO_ELLIPSIS;
- gfx::CanvasSkia::SizeStringInt(text_, font_, &w, &h, flags);
+ gfx::CanvasSkia::SizeStringInt(WideToUTF16Hack(text_), font_, &w, &h,
+ flags);
text_size_.SetSize(w, h);
text_size_valid_ = true;
}
« no previous file with comments | « views/controls/button/text_button.cc ('k') | views/view_text_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698