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

Side by Side Diff: source/i18n/timezone.cpp

Issue 845603002: Update ICU to 54.1 step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: remove unusued directories Created 5 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 unified diff | Download patch
« no previous file with comments | « source/i18n/tblcoll.cpp ('k') | source/i18n/tmunit.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ******************************************************************************* 2 *******************************************************************************
3 * Copyright (C) 1997-2013, International Business Machines Corporation and 3 * Copyright (C) 1997-2014, International Business Machines Corporation and
4 * others. All Rights Reserved. 4 * others. All Rights Reserved.
5 ******************************************************************************* 5 *******************************************************************************
6 * 6 *
7 * File TIMEZONE.CPP 7 * File TIMEZONE.CPP
8 * 8 *
9 * Modification History: 9 * Modification History:
10 * 10 *
11 * Date Name Description 11 * Date Name Description
12 * 12/05/96 clhuang Creation. 12 * 12/05/96 clhuang Creation.
13 * 04/21/97 aliu General clean-up and bug fixing. 13 * 04/21/97 aliu General clean-up and bug fixing.
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after
1286 1286
1287 UnicodeString& 1287 UnicodeString&
1288 TimeZone::getCustomID(const UnicodeString& id, UnicodeString& normalized, UError Code& status) { 1288 TimeZone::getCustomID(const UnicodeString& id, UnicodeString& normalized, UError Code& status) {
1289 normalized.remove(); 1289 normalized.remove();
1290 if (U_FAILURE(status)) { 1290 if (U_FAILURE(status)) {
1291 return normalized; 1291 return normalized;
1292 } 1292 }
1293 int32_t sign, hour, min, sec; 1293 int32_t sign, hour, min, sec;
1294 if (parseCustomID(id, sign, hour, min, sec)) { 1294 if (parseCustomID(id, sign, hour, min, sec)) {
1295 formatCustomID(hour, min, sec, (sign < 0), normalized); 1295 formatCustomID(hour, min, sec, (sign < 0), normalized);
1296 } else {
1297 status = U_ILLEGAL_ARGUMENT_ERROR;
1296 } 1298 }
1297 return normalized; 1299 return normalized;
1298 } 1300 }
1299 1301
1300 UBool 1302 UBool
1301 TimeZone::parseCustomID(const UnicodeString& id, int32_t& sign, 1303 TimeZone::parseCustomID(const UnicodeString& id, int32_t& sign,
1302 int32_t& hour, int32_t& min, int32_t& sec) { 1304 int32_t& hour, int32_t& min, int32_t& sec) {
1303 static const int32_t kParseFailed = -99999; 1305 static const int32_t kParseFailed = -99999;
1304 1306
1305 NumberFormat* numberFormat = 0; 1307 NumberFormat* numberFormat = 0;
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 return winid; 1533 return winid;
1532 } 1534 }
1533 1535
1534 // canonicalize the input ID 1536 // canonicalize the input ID
1535 UnicodeString canonicalID; 1537 UnicodeString canonicalID;
1536 UBool isSystemID = FALSE; 1538 UBool isSystemID = FALSE;
1537 1539
1538 getCanonicalID(id, canonicalID, isSystemID, status); 1540 getCanonicalID(id, canonicalID, isSystemID, status);
1539 if (U_FAILURE(status) || !isSystemID) { 1541 if (U_FAILURE(status) || !isSystemID) {
1540 // mapping data is only applicable to tz database IDs 1542 // mapping data is only applicable to tz database IDs
1543 if (status == U_ILLEGAL_ARGUMENT_ERROR) {
1544 // getWindowsID() sets an empty string where
1545 // getCanonicalID() sets a U_ILLEGAL_ARGUMENT_ERROR.
1546 status = U_ZERO_ERROR;
1547 }
1541 return winid; 1548 return winid;
1542 } 1549 }
1543 1550
1544 UResourceBundle *mapTimezones = ures_openDirect(NULL, "windowsZones", &statu s); 1551 UResourceBundle *mapTimezones = ures_openDirect(NULL, "windowsZones", &statu s);
1545 ures_getByKey(mapTimezones, "mapTimezones", mapTimezones, &status); 1552 ures_getByKey(mapTimezones, "mapTimezones", mapTimezones, &status);
1546 1553
1547 if (U_FAILURE(status)) { 1554 if (U_FAILURE(status)) {
1548 return winid; 1555 return winid;
1549 } 1556 }
1550 1557
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1660 return id; 1667 return id;
1661 } 1668 }
1662 #endif /* U_HIDE_DRAFT_API */ 1669 #endif /* U_HIDE_DRAFT_API */
1663 1670
1664 1671
1665 U_NAMESPACE_END 1672 U_NAMESPACE_END
1666 1673
1667 #endif /* #if !UCONFIG_NO_FORMATTING */ 1674 #endif /* #if !UCONFIG_NO_FORMATTING */
1668 1675
1669 //eof 1676 //eof
OLDNEW
« no previous file with comments | « source/i18n/tblcoll.cpp ('k') | source/i18n/tmunit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698