| Index: source/common/listformatter.cpp
|
| diff --git a/source/common/listformatter.cpp b/source/common/listformatter.cpp
|
| index 4941fa2c0a2ed0f451f277f64dcddb95bc921e03..9225c22f163eb74e7fae3d1919bb97d6185966c3 100644
|
| --- a/source/common/listformatter.cpp
|
| +++ b/source/common/listformatter.cpp
|
| @@ -1,7 +1,9 @@
|
| +// Copyright (C) 2016 and later: Unicode, Inc. and others.
|
| +// License & terms of use: http://www.unicode.org/copyright.html
|
| /*
|
| *******************************************************************************
|
| *
|
| -* Copyright (C) 2013-2015, International Business Machines
|
| +* Copyright (C) 2013-2016, International Business Machines
|
| * Corporation and others. All Rights Reserved.
|
| *
|
| *******************************************************************************
|
| @@ -15,7 +17,7 @@
|
| */
|
|
|
| #include "unicode/listformatter.h"
|
| -#include "simplepatternformatter.h"
|
| +#include "unicode/simpleformatter.h"
|
| #include "mutex.h"
|
| #include "hash.h"
|
| #include "cstring.h"
|
| @@ -27,10 +29,10 @@
|
| U_NAMESPACE_BEGIN
|
|
|
| struct ListFormatInternal : public UMemory {
|
| - SimplePatternFormatter twoPattern;
|
| - SimplePatternFormatter startPattern;
|
| - SimplePatternFormatter middlePattern;
|
| - SimplePatternFormatter endPattern;
|
| + SimpleFormatter twoPattern;
|
| + SimpleFormatter startPattern;
|
| + SimpleFormatter middlePattern;
|
| + SimpleFormatter endPattern;
|
|
|
| ListFormatInternal(
|
| const UnicodeString& two,
|
| @@ -43,11 +45,11 @@ ListFormatInternal(
|
| middlePattern(middle, 2, 2, errorCode),
|
| endPattern(end, 2, 2, errorCode) {}
|
|
|
| -ListFormatInternal(const ListFormatData &data) :
|
| - twoPattern(data.twoPattern),
|
| - startPattern(data.startPattern),
|
| - middlePattern(data.middlePattern),
|
| - endPattern(data.endPattern) { }
|
| +ListFormatInternal(const ListFormatData &data, UErrorCode &errorCode) :
|
| + twoPattern(data.twoPattern, errorCode),
|
| + startPattern(data.startPattern, errorCode),
|
| + middlePattern(data.middlePattern, errorCode),
|
| + endPattern(data.endPattern, errorCode) { }
|
|
|
| ListFormatInternal(const ListFormatInternal &other) :
|
| twoPattern(other.twoPattern),
|
| @@ -236,8 +238,8 @@ ListFormatter* ListFormatter::createInstance(const Locale& locale, const char *s
|
| return p;
|
| }
|
|
|
| -ListFormatter::ListFormatter(const ListFormatData& listFormatData) {
|
| - owned = new ListFormatInternal(listFormatData);
|
| +ListFormatter::ListFormatter(const ListFormatData& listFormatData, UErrorCode &errorCode) {
|
| + owned = new ListFormatInternal(listFormatData, errorCode);
|
| data = owned;
|
| }
|
|
|
| @@ -257,7 +259,7 @@ ListFormatter::~ListFormatter() {
|
| * according to pat. Any previous value of result gets replaced.
|
| */
|
| static void joinStringsAndReplace(
|
| - const SimplePatternFormatter& pat,
|
| + const SimpleFormatter& pat,
|
| const UnicodeString& first,
|
| const UnicodeString& second,
|
| UnicodeString &result,
|
|
|