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

Unified Diff: source/i18n/timezone.cpp

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 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 | « source/i18n/smpdtfmt.cpp ('k') | source/i18n/tmutfmt.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/i18n/timezone.cpp
diff --git a/source/i18n/timezone.cpp b/source/i18n/timezone.cpp
index a80fdda927a447fb64e64c92bf8c1f68219e9225..59c38915672dc57c52ad40dca82380ae55288fbb 100644
--- a/source/i18n/timezone.cpp
+++ b/source/i18n/timezone.cpp
@@ -427,13 +427,18 @@ TimeZone::createTimeZone(const UnicodeString& ID)
*/
TimeZone* result = createSystemTimeZone(ID);
- if (result == 0) {
+ if (result == NULL) {
U_DEBUG_TZ_MSG(("failed to load system time zone with id - falling to custom"));
result = createCustomTimeZone(ID);
}
- if (result == 0) {
+ if (result == NULL) {
U_DEBUG_TZ_MSG(("failed to load time zone with id - falling to Etc/Unknown(GMT)"));
- result = getUnknown().clone();
+ const TimeZone& unknown = getUnknown();
+ if (_UNKNOWN_ZONE == NULL) { // Cannot test (&unknown == NULL) because the
+ U_DEBUG_TZ_MSG(("failed to getUnknown()")); // behavior of NULL references is undefined.
+ } else {
+ result = unknown.clone();
+ }
}
return result;
}
@@ -453,8 +458,6 @@ TimeZone::detectHostTimeZone()
uprv_tzset(); // Initialize tz... system data
- uprv_tzname_clear_cache();
-
// Get the timezone ID from the host. This function should do
// any required host-specific remapping; e.g., on Windows this
// function maps the Date and Time control panel setting to an
@@ -1544,7 +1547,6 @@ TimeZone::getCanonicalID(const UnicodeString& id, UnicodeString& canonicalID, UB
return canonicalID;
}
-#ifndef U_HIDE_DRAFT_API
UnicodeString&
TimeZone::getWindowsID(const UnicodeString& id, UnicodeString& winid, UErrorCode& status) {
winid.remove();
@@ -1685,7 +1687,6 @@ TimeZone::getIDForWindowsID(const UnicodeString& winid, const char* region, Unic
ures_close(zones);
return id;
}
-#endif /* U_HIDE_DRAFT_API */
U_NAMESPACE_END
« no previous file with comments | « source/i18n/smpdtfmt.cpp ('k') | source/i18n/tmutfmt.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698