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

Unified Diff: source/common/listformatter.cpp

Issue 1621943002: ICU 56 step 4: Apply post-56 fixes for measure/date format (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@56goog
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/common/common.vcxproj.filters ('k') | source/common/putil.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/common/listformatter.cpp
diff --git a/source/common/listformatter.cpp b/source/common/listformatter.cpp
index 6dbf6c567716c07ebc0f43846dc6fb098927e586..4941fa2c0a2ed0f451f277f64dcddb95bc921e03 100644
--- a/source/common/listformatter.cpp
+++ b/source/common/listformatter.cpp
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2013-2014, International Business Machines
+* Copyright (C) 2013-2015, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -36,11 +36,12 @@ ListFormatInternal(
const UnicodeString& two,
const UnicodeString& start,
const UnicodeString& middle,
- const UnicodeString& end) :
- twoPattern(two),
- startPattern(start),
- middlePattern(middle),
- endPattern(end) {}
+ const UnicodeString& end,
+ UErrorCode &errorCode) :
+ twoPattern(two, 2, 2, errorCode),
+ startPattern(start, 2, 2, errorCode),
+ middlePattern(middle, 2, 2, errorCode),
+ endPattern(end, 2, 2, errorCode) {}
ListFormatInternal(const ListFormatData &data) :
twoPattern(data.twoPattern),
@@ -191,11 +192,15 @@ static ListFormatInternal* loadListFormatInternal(
if (U_FAILURE(errorCode)) {
return NULL;
}
- ListFormatInternal* result = new ListFormatInternal(two, start, middle, end);
+ ListFormatInternal* result = new ListFormatInternal(two, start, middle, end, errorCode);
if (result == NULL) {
errorCode = U_MEMORY_ALLOCATION_ERROR;
return NULL;
}
+ if (U_FAILURE(errorCode)) {
+ delete result;
+ return NULL;
+ }
return result;
}
« no previous file with comments | « source/common/common.vcxproj.filters ('k') | source/common/putil.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698