diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-18 16:23:18 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-18 16:23:18 +0000 |
commit | 70edb8606702fd26565cc46fd3075bfe75f68d97 (patch) | |
tree | c2647cc5cd843c5abbc9c90bd6855bd8b0b7c674 /app/text_elider.cc | |
parent | 05672cafff847dc3beb0e29e1506bee6a5a7447e (diff) | |
download | chromium_src-70edb8606702fd26565cc46fd3075bfe75f68d97.zip chromium_src-70edb8606702fd26565cc46fd3075bfe75f68d97.tar.gz chromium_src-70edb8606702fd26565cc46fd3075bfe75f68d97.tar.bz2 |
Convert GetDisplayStringInLTRDirectionality from wstring to string16.
BUG=23581
Review URL: http://codereview.chromium.org/3108027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56535 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/text_elider.cc')
-rw-r--r-- | app/text_elider.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/app/text_elider.cc b/app/text_elider.cc index 1ee1d1c..995ac95 100644 --- a/app/text_elider.cc +++ b/app/text_elider.cc @@ -38,6 +38,12 @@ std::wstring CutString(const std::wstring& text, text.substr(text.length() - half_length, half_length); } +// TODO(tony): Get rid of wstrings. +std::wstring GetDisplayStringInLTRDirectionality(const std::wstring& text) { + return UTF16ToWide(base::i18n::GetDisplayStringInLTRDirectionality( + WideToUTF16(text))); +} + } // namespace namespace gfx { @@ -285,7 +291,7 @@ std::wstring ElideFilename(const FilePath& filename, int full_width = font.GetStringWidth(filename.ToWStringHack()); if (full_width <= available_pixel_width) { std::wstring elided_name = filename.ToWStringHack(); - return base::i18n::GetDisplayStringInLTRDirectionality(&elided_name); + return GetDisplayStringInLTRDirectionality(elided_name); } #if defined(OS_WIN) @@ -299,7 +305,7 @@ std::wstring ElideFilename(const FilePath& filename, if (rootname.empty() || extension.empty()) { std::wstring elided_name = ElideText(filename.ToWStringHack(), font, available_pixel_width, false); - return base::i18n::GetDisplayStringInLTRDirectionality(&elided_name); + return GetDisplayStringInLTRDirectionality(elided_name); } int ext_width = font.GetStringWidth(extension); @@ -308,14 +314,14 @@ std::wstring ElideFilename(const FilePath& filename, // We may have trimmed the path. if (root_width + ext_width <= available_pixel_width) { std::wstring elided_name = rootname + extension; - return base::i18n::GetDisplayStringInLTRDirectionality(&elided_name); + return GetDisplayStringInLTRDirectionality(elided_name); } int available_root_width = available_pixel_width - ext_width; std::wstring elided_name = ElideText(rootname, font, available_root_width, false); elided_name += extension; - return base::i18n::GetDisplayStringInLTRDirectionality(&elided_name); + return GetDisplayStringInLTRDirectionality(elided_name); } // This function adds an ellipsis at the end of the text if the text |