summaryrefslogtreecommitdiffstats
path: root/views/view_text_utils.cc
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-12 15:16:04 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-12 15:16:04 +0000
commitb22558a183cefa554a1730188a51994504100351 (patch)
tree1761e4f23e2e9060ff7bfa5a9026a4937d73e312 /views/view_text_utils.cc
parent3f891cf79f72f4768a15bfae051e08b9211ed8c3 (diff)
downloadchromium_src-b22558a183cefa554a1730188a51994504100351.zip
chromium_src-b22558a183cefa554a1730188a51994504100351.tar.gz
chromium_src-b22558a183cefa554a1730188a51994504100351.tar.bz2
Revert 71167 - Remove wstring from gfx.
BUG=68882 TEST=no visible changes; all tests pass Review URL: http://codereview.chromium.org/6121004 TBR=avi@chromium.org Review URL: http://codereview.chromium.org/6134010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71169 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/view_text_utils.cc')
-rw-r--r--views/view_text_utils.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/views/view_text_utils.cc b/views/view_text_utils.cc
index 70cb8b9..8f13617 100644
--- a/views/view_text_utils.cc
+++ b/views/view_text_utils.cc
@@ -110,14 +110,14 @@ void DrawTextStartingFrom(gfx::Canvas* canvas,
// iterate to the next line breaking opportunity.
while (iter.Advance()) {
// Get the word and figure out the dimensions.
- string16 word;
+ std::wstring word;
if (!ltr_within_rtl)
- word = iter.GetString(); // Get the next word.
+ word = UTF16ToWide(iter.GetString()); // Get the next word.
else
- word = text16; // Draw the whole text at once.
+ word = text; // Draw the whole text at once.
- int w = font.GetStringWidth(word), h = font.GetHeight();
- gfx::CanvasSkia::SizeStringInt(word, font, &w, &h, flags);
+ int w = font.GetStringWidth(WideToUTF16Hack(word)), h = font.GetHeight();
+ gfx::CanvasSkia::SizeStringInt(WideToUTF16Hack(word), font, &w, &h, flags);
// If we exceed the boundaries, we need to wrap.
WrapIfWordDoesntFit(w, font.GetHeight(), position, bounds);
@@ -129,7 +129,7 @@ void DrawTextStartingFrom(gfx::Canvas* canvas,
// When drawing LTR strings inside RTL text we need to make sure we
// draw the trailing space (if one exists after the LTR text) to the
// left of the LTR string.
- if (ltr_within_rtl && word[word.size() - 1] == ' ') {
+ if (ltr_within_rtl && word[word.size() - 1] == L' ') {
int space_w = font.GetStringWidth(ASCIIToUTF16(" "));
int space_h = font.GetHeight();
gfx::CanvasSkia::SizeStringInt(ASCIIToUTF16(" "), font, &space_w,
@@ -143,7 +143,7 @@ void DrawTextStartingFrom(gfx::Canvas* canvas,
canvas->DrawStringInt(word, font, text_color, x, y, w, font.GetHeight(),
flags);
- if (word.size() > 0 && word[word.size() - 1] == '\x0a') {
+ if (word.size() > 0 && word[word.size() - 1] == L'\x0a') {
// When we come across '\n', we move to the beginning of the next line.
position->set_width(0);
position->Enlarge(0, font.GetHeight());