Commit c1541a5a authored by michaelbai@google.com's avatar michaelbai@google.com

Upstream android i18n change

BUG=
TEST=

Review URL: http://codereview.chromium.org/7741032

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98638 0039d316-1c4b-4281-b951-d872f2087c98
parent 8a97314d
...@@ -55,7 +55,10 @@ TEST(NumberFormattingTest, FormatDouble) { ...@@ -55,7 +55,10 @@ TEST(NumberFormattingTest, FormatDouble) {
const char* expected_german; const char* expected_german;
} cases[] = { } cases[] = {
{0.0, 0, "0", "0"}, {0.0, 0, "0", "0"},
#if !defined(OS_ANDROID)
// Bionic can't printf negative zero correctly.
{-0.0, 4, "-0.0000", "-0,0000"}, {-0.0, 4, "-0.0000", "-0,0000"},
#endif
{1024.2, 0, "1,024", "1.024"}, {1024.2, 0, "1,024", "1.024"},
{-1024.223, 2, "-1,024.22", "-1.024,22"}, {-1024.223, 2, "-1,024.22", "-1.024,22"},
{std::numeric_limits<double>::max(), 6, {std::numeric_limits<double>::max(), 6,
......
...@@ -215,15 +215,15 @@ bool AdjustStringForLocaleDirection(string16* text) { ...@@ -215,15 +215,15 @@ bool AdjustStringForLocaleDirection(string16* text) {
bool has_rtl_chars = StringContainsStrongRTLChars(*text); bool has_rtl_chars = StringContainsStrongRTLChars(*text);
if (!ui_direction_is_rtl && has_rtl_chars) { if (!ui_direction_is_rtl && has_rtl_chars) {
WrapStringWithRTLFormatting(text); WrapStringWithRTLFormatting(text);
text->insert(0, 1, kLeftToRightMark); text->insert(0U, 1U, kLeftToRightMark);
text->push_back(kLeftToRightMark); text->push_back(kLeftToRightMark);
} else if (ui_direction_is_rtl && has_rtl_chars) { } else if (ui_direction_is_rtl && has_rtl_chars) {
WrapStringWithRTLFormatting(text); WrapStringWithRTLFormatting(text);
text->insert(0, 1, kRightToLeftMark); text->insert(0U, 1U, kRightToLeftMark);
text->push_back(kRightToLeftMark); text->push_back(kRightToLeftMark);
} else if (ui_direction_is_rtl) { } else if (ui_direction_is_rtl) {
WrapStringWithLTRFormatting(text); WrapStringWithLTRFormatting(text);
text->insert(0, 1, kRightToLeftMark); text->insert(0U, 1U, kRightToLeftMark);
text->push_back(kRightToLeftMark); text->push_back(kRightToLeftMark);
} }
...@@ -258,7 +258,7 @@ void WrapStringWithLTRFormatting(string16* text) { ...@@ -258,7 +258,7 @@ void WrapStringWithLTRFormatting(string16* text) {
return; return;
// Inserting an LRE (Left-To-Right Embedding) mark as the first character. // Inserting an LRE (Left-To-Right Embedding) mark as the first character.
text->insert(0, 1, kLeftToRightEmbeddingMark); text->insert(0U, 1U, kLeftToRightEmbeddingMark);
// Inserting a PDF (Pop Directional Formatting) mark as the last character. // Inserting a PDF (Pop Directional Formatting) mark as the last character.
text->push_back(kPopDirectionalFormatting); text->push_back(kPopDirectionalFormatting);
...@@ -269,7 +269,7 @@ void WrapStringWithRTLFormatting(string16* text) { ...@@ -269,7 +269,7 @@ void WrapStringWithRTLFormatting(string16* text) {
return; return;
// Inserting an RLE (Right-To-Left Embedding) mark as the first character. // Inserting an RLE (Right-To-Left Embedding) mark as the first character.
text->insert(0, 1, kRightToLeftEmbeddingMark); text->insert(0U, 1U, kRightToLeftEmbeddingMark);
// Inserting a PDF (Pop Directional Formatting) mark as the last character. // Inserting a PDF (Pop Directional Formatting) mark as the last character.
text->push_back(kPopDirectionalFormatting); text->push_back(kPopDirectionalFormatting);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment