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

Unified Diff: source/i18n/ucal.cpp

Issue 2440913002: Update ICU to 58.1
Patch Set: Created 4 years, 2 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/tztrans.cpp ('k') | source/i18n/ucln_in.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/i18n/ucal.cpp
diff --git a/source/i18n/ucal.cpp b/source/i18n/ucal.cpp
index dbbd711a3e39252cb6d4b2010e76834e0525d7aa..ccca97bba86fb99e1d73bfdeb4bf78bc7a6ed7ac 100644
--- a/source/i18n/ucal.cpp
+++ b/source/i18n/ucal.cpp
@@ -1,6 +1,8 @@
+// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
-* Copyright (C) 1996-2015, International Business Machines
+* Copyright (C) 1996-2016, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
*/
@@ -25,6 +27,7 @@
#include "ustrenum.h"
#include "uenumimp.h"
#include "ulist.h"
+#include "ulocimp.h"
U_NAMESPACE_USE
@@ -669,15 +672,8 @@ static const char * const CAL_TYPES[] = {
U_CAPI UEnumeration* U_EXPORT2
ucal_getKeywordValuesForLocale(const char * /* key */, const char* locale, UBool commonlyUsed, UErrorCode *status) {
// Resolve region
- char prefRegion[ULOC_FULLNAME_CAPACITY] = "";
- int32_t prefRegionLength = 0;
- prefRegionLength = uloc_getCountry(locale, prefRegion, sizeof(prefRegion), status);
- if (prefRegionLength == 0) {
- char loc[ULOC_FULLNAME_CAPACITY] = "";
- uloc_addLikelySubtags(locale, loc, sizeof(loc), status);
-
- prefRegionLength = uloc_getCountry(loc, prefRegion, sizeof(prefRegion), status);
- }
+ char prefRegion[ULOC_COUNTRY_CAPACITY];
+ (void)ulocimp_getRegionForSupplementalData(locale, TRUE, prefRegion, sizeof(prefRegion), status);
// Read preferred calendar values from supplementalData calendarPreference
UResourceBundle *rb = ures_openDirect(NULL, "supplementalData", status);
« no previous file with comments | « source/i18n/tztrans.cpp ('k') | source/i18n/ucln_in.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698