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

Unified Diff: views/view_text_utils.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/label.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/view_text_utils.cc
diff --git a/views/view_text_utils.cc b/views/view_text_utils.cc
index 9b4442d170705834f9826b56ba6cbfba0d9c5820..73bef4523385950f75ed9e82d5855fc616e69f2f 100644
--- a/views/view_text_utils.cc
+++ b/views/view_text_utils.cc
@@ -117,7 +117,7 @@ void DrawTextStartingFrom(gfx::Canvas* canvas,
word = text; // Draw the whole text at once.
int w = font.GetStringWidth(word), h = font.GetHeight();
- gfx::CanvasSkia::SizeStringInt(word, font, &w, &h, flags);
+ gfx::CanvasSkia::SizeStringInt(WideToUTF16Hack(word), font, &w, &h, flags);
// If we exceed the boundaries, we need to wrap.
WrapIfWordDoesntFit(w, font.GetHeight(), position, bounds);
@@ -131,7 +131,8 @@ void DrawTextStartingFrom(gfx::Canvas* canvas,
// left of the LTR string.
if (ltr_within_rtl && word[word.size() - 1] == L' ') {
int space_w = font.GetStringWidth(L" "), space_h = font.GetHeight();
- gfx::CanvasSkia::SizeStringInt(L" ", font, &space_w, &space_h, flags);
+ gfx::CanvasSkia::SizeStringInt(UTF8ToUTF16(" "), font, &space_w,
+ &space_h, flags);
x += space_w;
}
}
« no previous file with comments | « views/controls/label.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698