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

Unified Diff: base/i18n/rtl.cc

Issue 7741032: Upstream android i18n change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months 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 | « base/i18n/number_formatting_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/i18n/rtl.cc
diff --git a/base/i18n/rtl.cc b/base/i18n/rtl.cc
index 9684b1d94c586c340254296f3bc49b9358b6174f..0e9e073bbe5712d6f1459a59f48ecfb33299c7bd 100644
--- a/base/i18n/rtl.cc
+++ b/base/i18n/rtl.cc
@@ -215,15 +215,15 @@ bool AdjustStringForLocaleDirection(string16* text) {
bool has_rtl_chars = StringContainsStrongRTLChars(*text);
if (!ui_direction_is_rtl && has_rtl_chars) {
WrapStringWithRTLFormatting(text);
- text->insert(0, 1, kLeftToRightMark);
+ text->insert(0U, 1U, kLeftToRightMark);
text->push_back(kLeftToRightMark);
} else if (ui_direction_is_rtl && has_rtl_chars) {
WrapStringWithRTLFormatting(text);
- text->insert(0, 1, kRightToLeftMark);
+ text->insert(0U, 1U, kRightToLeftMark);
text->push_back(kRightToLeftMark);
} else if (ui_direction_is_rtl) {
WrapStringWithLTRFormatting(text);
- text->insert(0, 1, kRightToLeftMark);
+ text->insert(0U, 1U, kRightToLeftMark);
text->push_back(kRightToLeftMark);
}
@@ -258,7 +258,8 @@ void WrapStringWithLTRFormatting(string16* text) {
return;
// Inserting an LRE (Left-To-Right Embedding) mark as the first character.
- text->insert(0, 1, kLeftToRightEmbeddingMark);
+ text->insert(static_cast<std::wstring::size_type>(0), 1,
brettw 2011/08/26 19:28:52 Why use static_cast here and 0U above? I'd use 0u
michaelbai 2011/08/26 22:01:50 Right, Done
+ kLeftToRightEmbeddingMark);
// Inserting a PDF (Pop Directional Formatting) mark as the last character.
text->push_back(kPopDirectionalFormatting);
@@ -269,7 +270,8 @@ void WrapStringWithRTLFormatting(string16* text) {
return;
// Inserting an RLE (Right-To-Left Embedding) mark as the first character.
- text->insert(0, 1, kRightToLeftEmbeddingMark);
+ text->insert(static_cast<std::wstring::size_type>(0), 1,
+ kRightToLeftEmbeddingMark);
// Inserting a PDF (Pop Directional Formatting) mark as the last character.
text->push_back(kPopDirectionalFormatting);
« no previous file with comments | « base/i18n/number_formatting_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698