summaryrefslogtreecommitdiffstats
path: root/views/view_text_utils.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-23 15:35:25 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-23 15:35:25 +0000
commite5366896e9ccb3dd17c590d115bd999e987a33af (patch)
tree52f4fc2f07b73aaca1199adb1384b123130c22ed /views/view_text_utils.cc
parentb133cc2db84fc83d5c4aa53020237788fa344c75 (diff)
downloadchromium_src-e5366896e9ccb3dd17c590d115bd999e987a33af.zip
chromium_src-e5366896e9ccb3dd17c590d115bd999e987a33af.tar.gz
chromium_src-e5366896e9ccb3dd17c590d115bd999e987a33af.tar.bz2
Replace wstring with string16 in history. The only time wstring is used now in history is for bookmark-related stuff (the bookmarks system is still wstring-based).
The substantial change here is in RTL to make a string16 variant of the functions and in changing the WordIterator to use string16 (this cleaned up some weird utf-32 code). TEST=none BUG=none Review URL: http://codereview.chromium.org/2808017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50597 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/view_text_utils.cc')
-rw-r--r--views/view_text_utils.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/views/view_text_utils.cc b/views/view_text_utils.cc
index 2995f26..1fb39d3 100644
--- a/views/view_text_utils.cc
+++ b/views/view_text_utils.cc
@@ -8,6 +8,7 @@
#include "base/i18n/rtl.h"
#include "base/i18n/word_iterator.h"
#include "base/logging.h"
+#include "base/utf_string_conversions.h"
#include "gfx/canvas.h"
#include "gfx/color_utils.h"
#include "gfx/size.h"
@@ -97,7 +98,8 @@ void DrawTextStartingFrom(gfx::Canvas* canvas,
// Iterate through line breaking opportunities (which in English would be
// spaces and such). This tells us where to wrap.
- WordIterator iter(text, WordIterator::BREAK_LINE);
+ string16 text16(WideToUTF16(text));
+ WordIterator iter(&text16, WordIterator::BREAK_LINE);
if (!iter.Init())
return;
@@ -111,7 +113,7 @@ void DrawTextStartingFrom(gfx::Canvas* canvas,
// Get the word and figure out the dimensions.
std::wstring word;
if (!ltr_within_rtl)
- word = iter.GetWord(); // Get the next word.
+ word = UTF16ToWide(iter.GetWord()); // Get the next word.
else
word = text; // Draw the whole text at once.