Skip to content

Commit

Permalink
Bug 1706318 - Rename connector pattern override preference; r=zbraniecki
Browse files Browse the repository at this point in the history
  • Loading branch information
dminor committed Apr 26, 2021
1 parent fe1cf77 commit db62540
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion intl/locale/OSPreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ bool OSPreferences::GetDateTimeConnectorPattern(const nsACString& aLocale,
// Check for a valid override pref and use that if present.
nsAutoCString value;
nsresult nr = Preferences::GetCString(
"intl.date_time.pattern_override.date_time_short", value);
"intl.date_time.pattern_override.connector_short", value);
if (NS_SUCCEEDED(nr) && value.Find("{0}") != kNotFound &&
value.Find("{1}") != kNotFound) {
aRetVal = std::move(value);
Expand Down
6 changes: 3 additions & 3 deletions intl/locale/tests/gtest/TestOSPreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ TEST(Intl_Locale_OSPreferences, GetDateTimePatternPrefOverrides)
mozilla::Preferences::SetCString("intl.date_time.pattern_override.time_short",
"HH:mm:ss");
mozilla::Preferences::SetCString(
"intl.date_time.pattern_override.date_time_short", "{1} {0}");
"intl.date_time.pattern_override.connector_short", "{1} {0}");
nr = osprefs->GetDateTimePattern(mozIOSPreferences::dateTimeFormatStyleShort,
mozIOSPreferences::dateTimeFormatStyleShort,
nsDependentCString(""), pattern);
Expand All @@ -185,7 +185,7 @@ TEST(Intl_Locale_OSPreferences, GetDateTimePatternPrefOverrides)

// Invalid patterns are ignored
mozilla::Preferences::SetCString(
"intl.date_time.pattern_override.date_time_short", "hello, world!");
"intl.date_time.pattern_override.connector_short", "hello, world!");
nr = osprefs->GetDateTimePattern(mozIOSPreferences::dateTimeFormatStyleShort,
mozIOSPreferences::dateTimeFormatStyleShort,
nsDependentCString(""), pattern);
Expand All @@ -194,7 +194,7 @@ TEST(Intl_Locale_OSPreferences, GetDateTimePatternPrefOverrides)

// Clearing the override results in getting the default pattern back.
mozilla::Preferences::ClearUser(
"intl.date_time.pattern_override.date_time_short");
"intl.date_time.pattern_override.connector_short");
nr = osprefs->GetDateTimePattern(mozIOSPreferences::dateTimeFormatStyleShort,
mozIOSPreferences::dateTimeFormatStyleShort,
nsDependentCString(""), pattern);
Expand Down

0 comments on commit db62540

Please sign in to comment.