| Index: source/i18n/compactdecimalformat.cpp
|
| diff --git a/source/i18n/compactdecimalformat.cpp b/source/i18n/compactdecimalformat.cpp
|
| index 74d9c04191c5360ecaad5066797a5117b8ab0e91..2e5054775c22e781351d5013b08f0f81fb4d374c 100644
|
| --- a/source/i18n/compactdecimalformat.cpp
|
| +++ b/source/i18n/compactdecimalformat.cpp
|
| @@ -1,6 +1,6 @@
|
| /*
|
| *******************************************************************************
|
| -* Copyright (C) 1997-2014, International Business Machines Corporation and *
|
| +* Copyright (C) 1997-2015, International Business Machines Corporation and *
|
| * others. All Rights Reserved. *
|
| *******************************************************************************
|
| *
|
| @@ -242,10 +242,22 @@ CompactDecimalFormat::format(
|
| double number,
|
| UnicodeString& appendTo,
|
| FieldPosition& pos) const {
|
| + UErrorCode status = U_ZERO_ERROR;
|
| + return format(number, appendTo, pos, status);
|
| +}
|
| +
|
| +UnicodeString&
|
| +CompactDecimalFormat::format(
|
| + double number,
|
| + UnicodeString& appendTo,
|
| + FieldPosition& pos,
|
| + UErrorCode &status) const {
|
| + if (U_FAILURE(status)) {
|
| + return appendTo;
|
| + }
|
| DigitList orig, rounded;
|
| orig.set(number);
|
| UBool isNegative;
|
| - UErrorCode status = U_ZERO_ERROR;
|
| _round(orig, rounded, isNegative, status);
|
| if (U_FAILURE(status)) {
|
| return appendTo;
|
| @@ -279,6 +291,33 @@ CompactDecimalFormat::format(
|
|
|
| UnicodeString&
|
| CompactDecimalFormat::format(
|
| + int32_t number,
|
| + UnicodeString& appendTo,
|
| + FieldPosition& pos) const {
|
| + return format((double) number, appendTo, pos);
|
| +}
|
| +
|
| +UnicodeString&
|
| +CompactDecimalFormat::format(
|
| + int32_t number,
|
| + UnicodeString& appendTo,
|
| + FieldPosition& pos,
|
| + UErrorCode &status) const {
|
| + return format((double) number, appendTo, pos, status);
|
| +}
|
| +
|
| +UnicodeString&
|
| +CompactDecimalFormat::format(
|
| + int32_t /* number */,
|
| + UnicodeString& appendTo,
|
| + FieldPositionIterator* /* posIter */,
|
| + UErrorCode& status) const {
|
| + status = U_UNSUPPORTED_ERROR;
|
| + return appendTo;
|
| +}
|
| +
|
| +UnicodeString&
|
| +CompactDecimalFormat::format(
|
| int64_t number,
|
| UnicodeString& appendTo,
|
| FieldPosition& pos) const {
|
| @@ -287,6 +326,15 @@ CompactDecimalFormat::format(
|
|
|
| UnicodeString&
|
| CompactDecimalFormat::format(
|
| + int64_t number,
|
| + UnicodeString& appendTo,
|
| + FieldPosition& pos,
|
| + UErrorCode &status) const {
|
| + return format((double) number, appendTo, pos, status);
|
| +}
|
| +
|
| +UnicodeString&
|
| +CompactDecimalFormat::format(
|
| int64_t /* number */,
|
| UnicodeString& appendTo,
|
| FieldPositionIterator* /* posIter */,
|
| @@ -868,7 +916,7 @@ static void fillInMissing(CDFLocaleStyleData* result) {
|
| }
|
| }
|
| // Iterate over each variant.
|
| - int32_t pos = -1;
|
| + int32_t pos = UHASH_FIRST;
|
| const UHashElement* element = uhash_nextElement(result->unitsByVariant, &pos);
|
| for (;element != NULL; element = uhash_nextElement(result->unitsByVariant, &pos)) {
|
| CDFUnit* units = (CDFUnit*) element->value.pointer;
|
|
|