]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/i18n/decimfmt.cpp
ICU-66108.tar.gz
[apple/icu.git] / icuSources / i18n / decimfmt.cpp
index d428cddc5d77fae868e60c3daaff099de8f24087..2cd61ec9a89f45ef983ae523111b38f93aebd375 100644 (file)
@@ -15,6 +15,7 @@
 #include "unicode/errorcode.h"
 #include "unicode/decimfmt.h"
 #include "unicode/ucurr.h"
+#include "unicode/ustring.h"
 #include "number_decimalquantity.h"
 #include "number_types.h"
 #include "numparse_impl.h"
@@ -96,7 +97,7 @@ DecimalFormat::DecimalFormat(const UnicodeString& pattern, DecimalFormatSymbols*
                 new CurrencyPluralInfo(fields->symbols->getLocale(), status),
                 status);
         if (U_FAILURE(status)) { return; }
-        fields->properties->currencyPluralInfo.fPtr.adoptInstead(cpi.orphan());
+        fields->properties.currencyPluralInfo.fPtr.adoptInstead(cpi.orphan());
     }
     touch(status);
 }
@@ -112,21 +113,14 @@ DecimalFormat::DecimalFormat(const DecimalFormatSymbols* symbolsToAdopt, UErrorC
         status = U_MEMORY_ALLOCATION_ERROR;
         return;
     }
-    fields->formatter.adoptInsteadAndCheckErrorCode(new LocalizedNumberFormatter(), status);
-    fields->properties.adoptInsteadAndCheckErrorCode(new DecimalFormatProperties(), status);
-    fields->exportedProperties.adoptInsteadAndCheckErrorCode(new DecimalFormatProperties(), status);
     if (adoptedSymbols.isNull()) {
         fields->symbols.adoptInsteadAndCheckErrorCode(new DecimalFormatSymbols(status), status);
     } else {
         fields->symbols.adoptInsteadAndCheckErrorCode(adoptedSymbols.orphan(), status);
     }
-    // In order to simplify error handling logic in the various getters/setters/etc, we do not allow
-    // any partially populated DecimalFormatFields object. We must have a fully complete fields object
-    // or else we set it to nullptr.
-    if (fields->formatter.isNull() || fields->properties.isNull() || fields->exportedProperties.isNull() || fields->symbols.isNull()) {
+    if (U_FAILURE(status)) {
         delete fields;
         fields = nullptr;
-        status = U_MEMORY_ALLOCATION_ERROR;
     }
 }
 
@@ -134,8 +128,8 @@ DecimalFormat::DecimalFormat(const DecimalFormatSymbols* symbolsToAdopt, UErrorC
 
 void DecimalFormat::setParseAllInput(UNumberFormatAttributeValue value) {
     if (fields == nullptr) { return; }
-    if (value == fields->properties->parseAllInput) { return; }
-    fields->properties->parseAllInput = value;
+    if (value == fields->properties.parseAllInput) { return; }
+    fields->properties.parseAllInput = value;
 }
 
 #endif
@@ -271,8 +265,8 @@ DecimalFormat::setAttribute(UNumberFormatAttribute attr, int32_t newValue, UErro
         case UNUM_FORMAT_WITH_FULL_PRECISION: // Apple addition for <rdar://problem/39240173>
             {
                 bool boolVal = UBOOL_TO_BOOL(static_cast<UBool>(newValue));
-                if (boolVal != fields->properties->formatFullPrecision) {
-                    fields->properties->formatFullPrecision = boolVal;
+                if (boolVal != fields->properties.formatFullPrecision) {
+                    fields->properties.formatFullPrecision = boolVal;
                     touchNoError();
                 }
             }
@@ -379,7 +373,7 @@ int32_t DecimalFormat::getAttribute(UNumberFormatAttribute attr, UErrorCode& sta
             return isFormatFailIfMoreThanMaxDigits();
 
         case UNUM_FORMAT_WITH_FULL_PRECISION: // Apple addition for <rdar://problem/39240173>
-            return (UBool)fields->properties->formatFullPrecision;
+            return (UBool)fields->properties.formatFullPrecision;
 
         default:
             status = U_UNSUPPORTED_ERROR;
@@ -393,9 +387,9 @@ void DecimalFormat::setGroupingUsed(UBool enabled) {
     if (fields == nullptr) {
         return;
     }
-    if (UBOOL_TO_BOOL(enabled) == fields->properties->groupingUsed) { return; }
+    if (UBOOL_TO_BOOL(enabled) == fields->properties.groupingUsed) { return; }
     NumberFormat::setGroupingUsed(enabled); // to set field for compatibility
-    fields->properties->groupingUsed = enabled;
+    fields->properties.groupingUsed = enabled;
     touchNoError();
 }
 
@@ -403,9 +397,9 @@ void DecimalFormat::setParseIntegerOnly(UBool value) {
     if (fields == nullptr) {
         return;
     }
-    if (UBOOL_TO_BOOL(value) == fields->properties->parseIntegerOnly) { return; }
+    if (UBOOL_TO_BOOL(value) == fields->properties.parseIntegerOnly) { return; }
     NumberFormat::setParseIntegerOnly(value); // to set field for compatibility
-    fields->properties->parseIntegerOnly = value;
+    fields->properties.parseIntegerOnly = value;
     touchNoError();
 }
 
@@ -414,9 +408,9 @@ void DecimalFormat::setLenient(UBool enable) {
         return;
     }
     ParseMode mode = enable ? PARSE_MODE_LENIENT : PARSE_MODE_STRICT;
-    if (!fields->properties->parseMode.isNull() && mode == fields->properties->parseMode.getNoError()) { return; }
+    if (!fields->properties.parseMode.isNull() && mode == fields->properties.parseMode.getNoError()) { return; }
     NumberFormat::setLenient(enable); // to set field for compatibility
-    fields->properties->parseMode = mode;
+    fields->properties.parseMode = mode;
     touchNoError();
 }
 
@@ -455,19 +449,16 @@ DecimalFormat::DecimalFormat(const DecimalFormat& source) : NumberFormat(source)
     // Note: it is not safe to copy fields->formatter or fWarehouse directly because fields->formatter might have
     // dangling pointers to fields inside fWarehouse. The safe thing is to re-construct fields->formatter from
     // the property bag, despite being somewhat slower.
-    fields = new DecimalFormatFields();
+    fields = new DecimalFormatFields(source.fields->properties);
     if (fields == nullptr) {
         return; // no way to report an error.
     }
     UErrorCode status = U_ZERO_ERROR;
-    fields->formatter.adoptInsteadAndCheckErrorCode(new LocalizedNumberFormatter(), status);
-    fields->properties.adoptInsteadAndCheckErrorCode(new DecimalFormatProperties(*source.fields->properties), status);
     fields->symbols.adoptInsteadAndCheckErrorCode(new DecimalFormatSymbols(*source.fields->symbols), status);
-    fields->exportedProperties.adoptInsteadAndCheckErrorCode(new DecimalFormatProperties(), status);
     // In order to simplify error handling logic in the various getters/setters/etc, we do not allow
     // any partially populated DecimalFormatFields object. We must have a fully complete fields object
     // or else we set it to nullptr.
-    if (fields->formatter.isNull() || fields->properties.isNull() || fields->exportedProperties.isNull() || fields->symbols.isNull()) {
+    if (U_FAILURE(status)) {
         delete fields;
         fields = nullptr;
         return;
@@ -484,8 +475,8 @@ DecimalFormat& DecimalFormat::operator=(const DecimalFormat& rhs) {
     if (fields == nullptr || rhs.fields == nullptr) {
         return *this; // unfortunately, no way to report an error.
     }
-    *fields->properties = *rhs.fields->properties;
-    fields->exportedProperties->clear();
+    fields->properties = rhs.fields->properties;
+    fields->exportedProperties.clear();
     UErrorCode status = U_ZERO_ERROR;
     LocalPointer<DecimalFormatSymbols> dfs(new DecimalFormatSymbols(*rhs.fields->symbols), status);
     if (U_FAILURE(status)) {
@@ -509,7 +500,7 @@ DecimalFormat::~DecimalFormat() {
     delete fields;
 }
 
-Format* DecimalFormat::clone() const {
+DecimalFormat* DecimalFormat::clone() const {
     // can only clone valid objects.
     if (fields == nullptr) {
         return nullptr;
@@ -531,7 +522,7 @@ UBool DecimalFormat::operator==(const Format& other) const {
     if (fields == nullptr || otherDF->fields == nullptr) {
         return false;
     }
-    return *fields->properties == *otherDF->fields->properties && *fields->symbols == *otherDF->fields->symbols;
+    return fields->properties == otherDF->fields->properties && *fields->symbols == *otherDF->fields->symbols;
 }
 
 UnicodeString& DecimalFormat::format(double number, UnicodeString& appendTo, FieldPosition& pos) const {
@@ -543,7 +534,7 @@ UnicodeString& DecimalFormat::format(double number, UnicodeString& appendTo, Fie
         return appendTo;
     }
     UErrorCode localStatus = U_ZERO_ERROR;
-    FormattedNumber output = fields->formatter->formatDouble(number, localStatus);
+    FormattedNumber output = fields->formatter.formatDouble(number, localStatus);
     fieldPositionHelper(output, pos, appendTo.length(), localStatus);
     auto appendable = UnicodeStringAppendable(appendTo);
     output.appendTo(appendable, localStatus);
@@ -564,7 +555,7 @@ UnicodeString& DecimalFormat::format(double number, UnicodeString& appendTo, Fie
     if (pos.getField() == FieldPosition::DONT_CARE && fastFormatDouble(number, appendTo)) {
         return appendTo;
     }
-    FormattedNumber output = fields->formatter->formatDouble(number, status);
+    FormattedNumber output = fields->formatter.formatDouble(number, status);
     fieldPositionHelper(output, pos, appendTo.length(), status);
     auto appendable = UnicodeStringAppendable(appendTo);
     output.appendTo(appendable, status);
@@ -586,7 +577,7 @@ DecimalFormat::format(double number, UnicodeString& appendTo, FieldPositionItera
     if (posIter == nullptr && fastFormatDouble(number, appendTo)) {
         return appendTo;
     }
-    FormattedNumber output = fields->formatter->formatDouble(number, status);
+    FormattedNumber output = fields->formatter.formatDouble(number, status);
     fieldPositionIteratorHelper(output, posIter, appendTo.length(), status);
     auto appendable = UnicodeStringAppendable(appendTo);
     output.appendTo(appendable, status);
@@ -617,7 +608,7 @@ UnicodeString& DecimalFormat::format(int64_t number, UnicodeString& appendTo, Fi
         return appendTo;
     }
     UErrorCode localStatus = U_ZERO_ERROR;
-    FormattedNumber output = fields->formatter->formatInt(number, localStatus);
+    FormattedNumber output = fields->formatter.formatInt(number, localStatus);
     fieldPositionHelper(output, pos, appendTo.length(), localStatus);
     auto appendable = UnicodeStringAppendable(appendTo);
     output.appendTo(appendable, localStatus);
@@ -638,7 +629,7 @@ UnicodeString& DecimalFormat::format(int64_t number, UnicodeString& appendTo, Fi
     if (pos.getField() == FieldPosition::DONT_CARE && fastFormatInt64(number, appendTo)) {
         return appendTo;
     }
-    FormattedNumber output = fields->formatter->formatInt(number, status);
+    FormattedNumber output = fields->formatter.formatInt(number, status);
     fieldPositionHelper(output, pos, appendTo.length(), status);
     auto appendable = UnicodeStringAppendable(appendTo);
     output.appendTo(appendable, status);
@@ -660,7 +651,7 @@ DecimalFormat::format(int64_t number, UnicodeString& appendTo, FieldPositionIter
     if (posIter == nullptr && fastFormatInt64(number, appendTo)) {
         return appendTo;
     }
-    FormattedNumber output = fields->formatter->formatInt(number, status);
+    FormattedNumber output = fields->formatter.formatInt(number, status);
     fieldPositionIteratorHelper(output, posIter, appendTo.length(), status);
     auto appendable = UnicodeStringAppendable(appendTo);
     output.appendTo(appendable, status);
@@ -679,7 +670,7 @@ DecimalFormat::format(StringPiece number, UnicodeString& appendTo, FieldPosition
         appendTo.setToBogus();
         return appendTo;
     }
-    FormattedNumber output = fields->formatter->formatDecimal(number, status);
+    FormattedNumber output = fields->formatter.formatDecimal(number, status);
     fieldPositionIteratorHelper(output, posIter, appendTo.length(), status);
     auto appendable = UnicodeStringAppendable(appendTo);
     output.appendTo(appendable, status);
@@ -697,7 +688,7 @@ UnicodeString& DecimalFormat::format(const DecimalQuantity& number, UnicodeStrin
         appendTo.setToBogus();
         return appendTo;
     }
-    FormattedNumber output = fields->formatter->formatDecimalQuantity(number, status);
+    FormattedNumber output = fields->formatter.formatDecimalQuantity(number, status);
     fieldPositionIteratorHelper(output, posIter, appendTo.length(), status);
     auto appendable = UnicodeStringAppendable(appendTo);
     output.appendTo(appendable, status);
@@ -716,7 +707,7 @@ DecimalFormat::format(const DecimalQuantity& number, UnicodeString& appendTo, Fi
         appendTo.setToBogus();
         return appendTo;
     }
-    FormattedNumber output = fields->formatter->formatDecimalQuantity(number, status);
+    FormattedNumber output = fields->formatter.formatDecimalQuantity(number, status);
     fieldPositionHelper(output, pos, appendTo.length(), status);
     auto appendable = UnicodeStringAppendable(appendTo);
     output.appendTo(appendable, status);
@@ -837,7 +828,7 @@ const CurrencyPluralInfo* DecimalFormat::getCurrencyPluralInfo(void) const {
     if (fields == nullptr) {
         return nullptr;
     }
-    return fields->properties->currencyPluralInfo.fPtr.getAlias();
+    return fields->properties.currencyPluralInfo.fPtr.getAlias();
 }
 
 void DecimalFormat::adoptCurrencyPluralInfo(CurrencyPluralInfo* toAdopt) {
@@ -847,7 +838,7 @@ void DecimalFormat::adoptCurrencyPluralInfo(CurrencyPluralInfo* toAdopt) {
     if (fields == nullptr) {
         return;
     }
-    fields->properties->currencyPluralInfo.fPtr.adoptInstead(cpi.orphan());
+    fields->properties.currencyPluralInfo.fPtr.adoptInstead(cpi.orphan());
     touchNoError();
 }
 
@@ -855,11 +846,11 @@ void DecimalFormat::setCurrencyPluralInfo(const CurrencyPluralInfo& info) {
     if (fields == nullptr) {
         return;
     }
-    if (fields->properties->currencyPluralInfo.fPtr.isNull()) {
+    if (fields->properties.currencyPluralInfo.fPtr.isNull()) {
         // Note: clone() can fail with OOM error, but we have no way to report it. :(
-        fields->properties->currencyPluralInfo.fPtr.adoptInstead(info.clone());
+        fields->properties.currencyPluralInfo.fPtr.adoptInstead(info.clone());
     } else {
-        *fields->properties->currencyPluralInfo.fPtr = info; // copy-assignment operator
+        *fields->properties.currencyPluralInfo.fPtr = info; // copy-assignment operator
     }
     touchNoError();
 }
@@ -870,7 +861,7 @@ UnicodeString& DecimalFormat::getPositivePrefix(UnicodeString& result) const {
         return result;
     }
     UErrorCode status = U_ZERO_ERROR;
-    fields->formatter->getAffixImpl(true, false, result, status);
+    fields->formatter.getAffixImpl(true, false, result, status);
     if (U_FAILURE(status)) { result.setToBogus(); }
     return result;
 }
@@ -879,8 +870,8 @@ void DecimalFormat::setPositivePrefix(const UnicodeString& newValue) {
     if (fields == nullptr) {
         return;
     }
-    if (newValue == fields->properties->positivePrefix) { return; }
-    fields->properties->positivePrefix = newValue;
+    if (newValue == fields->properties.positivePrefix) { return; }
+    fields->properties.positivePrefix = newValue;
     touchNoError();
 }
 
@@ -890,7 +881,7 @@ UnicodeString& DecimalFormat::getNegativePrefix(UnicodeString& result) const {
         return result;
     }
     UErrorCode status = U_ZERO_ERROR;
-    fields->formatter->getAffixImpl(true, true, result, status);
+    fields->formatter.getAffixImpl(true, true, result, status);
     if (U_FAILURE(status)) { result.setToBogus(); }
     return result;
 }
@@ -899,8 +890,8 @@ void DecimalFormat::setNegativePrefix(const UnicodeString& newValue) {
     if (fields == nullptr) {
         return;
     }
-    if (newValue == fields->properties->negativePrefix) { return; }
-    fields->properties->negativePrefix = newValue;
+    if (newValue == fields->properties.negativePrefix) { return; }
+    fields->properties.negativePrefix = newValue;
     touchNoError();
 }
 
@@ -910,7 +901,7 @@ UnicodeString& DecimalFormat::getPositiveSuffix(UnicodeString& result) const {
         return result;
     }
     UErrorCode status = U_ZERO_ERROR;
-    fields->formatter->getAffixImpl(false, false, result, status);
+    fields->formatter.getAffixImpl(false, false, result, status);
     if (U_FAILURE(status)) { result.setToBogus(); }
     return result;
 }
@@ -919,8 +910,8 @@ void DecimalFormat::setPositiveSuffix(const UnicodeString& newValue) {
     if (fields == nullptr) {
         return;
     }
-    if (newValue == fields->properties->positiveSuffix) { return; }
-    fields->properties->positiveSuffix = newValue;
+    if (newValue == fields->properties.positiveSuffix) { return; }
+    fields->properties.positiveSuffix = newValue;
     touchNoError();
 }
 
@@ -930,7 +921,7 @@ UnicodeString& DecimalFormat::getNegativeSuffix(UnicodeString& result) const {
         return result;
     }
     UErrorCode status = U_ZERO_ERROR;
-    fields->formatter->getAffixImpl(false, true, result, status);
+    fields->formatter.getAffixImpl(false, true, result, status);
     if (U_FAILURE(status)) { result.setToBogus(); }
     return result;
 }
@@ -939,8 +930,8 @@ void DecimalFormat::setNegativeSuffix(const UnicodeString& newValue) {
     if (fields == nullptr) {
         return;
     }
-    if (newValue == fields->properties->negativeSuffix) { return; }
-    fields->properties->negativeSuffix = newValue;
+    if (newValue == fields->properties.negativeSuffix) { return; }
+    fields->properties.negativeSuffix = newValue;
     touchNoError();
 }
 
@@ -949,13 +940,13 @@ UBool DecimalFormat::isSignAlwaysShown() const {
     if (fields == nullptr) {
         return DecimalFormatProperties::getDefault().signAlwaysShown;
     }
-    return fields->properties->signAlwaysShown;
+    return fields->properties.signAlwaysShown;
 }
 
 void DecimalFormat::setSignAlwaysShown(UBool value) {
     if (fields == nullptr) { return; }
-    if (UBOOL_TO_BOOL(value) == fields->properties->signAlwaysShown) { return; }
-    fields->properties->signAlwaysShown = value;
+    if (UBOOL_TO_BOOL(value) == fields->properties.signAlwaysShown) { return; }
+    fields->properties.signAlwaysShown = value;
     touchNoError();
 }
 
@@ -966,7 +957,7 @@ int32_t DecimalFormat::getMultiplier(void) const {
         // Fallback to using the default instance of DecimalFormatProperties.
         dfp = &(DecimalFormatProperties::getDefault());
     } else {
-        dfp = fields->properties.getAlias();
+        dfp = &fields->properties;
     }
     if (dfp->multiplier != 1) {
         return dfp->multiplier;
@@ -998,11 +989,11 @@ void DecimalFormat::setMultiplier(int32_t multiplier) {
         value = temp;
     }
     if (delta != -1) {
-        fields->properties->magnitudeMultiplier = delta;
-        fields->properties->multiplier = 1;
+        fields->properties.magnitudeMultiplier = delta;
+        fields->properties.multiplier = 1;
     } else {
-        fields->properties->magnitudeMultiplier = 0;
-        fields->properties->multiplier = multiplier;
+        fields->properties.magnitudeMultiplier = 0;
+        fields->properties.multiplier = multiplier;
     }
     touchNoError();
 }
@@ -1013,13 +1004,13 @@ int32_t DecimalFormat::getMultiplierScale() const {
         // Fallback to using the default instance of DecimalFormatProperties.
         return DecimalFormatProperties::getDefault().multiplierScale;
     }
-    return fields->properties->multiplierScale;
+    return fields->properties.multiplierScale;
 }
 
 void DecimalFormat::setMultiplierScale(int32_t newValue) {
     if (fields == nullptr) { return; }
-    if (newValue == fields->properties->multiplierScale) { return; }
-    fields->properties->multiplierScale = newValue;
+    if (newValue == fields->properties.multiplierScale) { return; }
+    fields->properties.multiplierScale = newValue;
     touchNoError();
 }
 
@@ -1029,13 +1020,13 @@ double DecimalFormat::getRoundingIncrement(void) const {
         // Fallback to using the default instance of DecimalFormatProperties.
         return DecimalFormatProperties::getDefault().roundingIncrement;
     }
-    return fields->exportedProperties->roundingIncrement;
+    return fields->exportedProperties.roundingIncrement;
 }
 
 void DecimalFormat::setRoundingIncrement(double newValue) {
     if (fields == nullptr) { return; }
-    if (newValue == fields->properties->roundingIncrement) { return; }
-    fields->properties->roundingIncrement = newValue;
+    if (newValue == fields->properties.roundingIncrement) { return; }
+    fields->properties.roundingIncrement = newValue;
     touchNoError();
 }
 
@@ -1046,17 +1037,17 @@ ERoundingMode DecimalFormat::getRoundingMode(void) const {
         return static_cast<ERoundingMode>(DecimalFormatProperties::getDefault().roundingMode.getNoError());
     }
     // UNumberFormatRoundingMode and ERoundingMode have the same values.
-    return static_cast<ERoundingMode>(fields->exportedProperties->roundingMode.getNoError());
+    return static_cast<ERoundingMode>(fields->exportedProperties.roundingMode.getNoError());
 }
 
 void DecimalFormat::setRoundingMode(ERoundingMode roundingMode) {
     if (fields == nullptr) { return; }
     auto uRoundingMode = static_cast<UNumberFormatRoundingMode>(roundingMode);
-    if (!fields->properties->roundingMode.isNull() && uRoundingMode == fields->properties->roundingMode.getNoError()) {
+    if (!fields->properties.roundingMode.isNull() && uRoundingMode == fields->properties.roundingMode.getNoError()) {
         return;
     }
     NumberFormat::setMaximumIntegerDigits(roundingMode); // to set field for compatibility
-    fields->properties->roundingMode = uRoundingMode;
+    fields->properties.roundingMode = uRoundingMode;
     touchNoError();
 }
 
@@ -1066,52 +1057,52 @@ int32_t DecimalFormat::getFormatWidth(void) const {
         // Fallback to using the default instance of DecimalFormatProperties.
         return DecimalFormatProperties::getDefault().formatWidth;
     }
-    return fields->properties->formatWidth;
+    return fields->properties.formatWidth;
 }
 
 void DecimalFormat::setFormatWidth(int32_t width) {
     if (fields == nullptr) { return; }
-    if (width == fields->properties->formatWidth) { return; }
-    fields->properties->formatWidth = width;
+    if (width == fields->properties.formatWidth) { return; }
+    fields->properties.formatWidth = width;
     touchNoError();
 }
 
 UnicodeString DecimalFormat::getPadCharacterString() const {
-    if (fields == nullptr || fields->properties->padString.isBogus()) {
+    if (fields == nullptr || fields->properties.padString.isBogus()) {
         // Readonly-alias the static string kFallbackPaddingString
         return {TRUE, kFallbackPaddingString, -1};
     } else {
-        return fields->properties->padString;
+        return fields->properties.padString;
     }
 }
 
 void DecimalFormat::setPadCharacter(const UnicodeString& padChar) {
     if (fields == nullptr) { return; }
-    if (padChar == fields->properties->padString) { return; }
+    if (padChar == fields->properties.padString) { return; }
     if (padChar.length() > 0) {
-        fields->properties->padString = UnicodeString(padChar.char32At(0));
+        fields->properties.padString = UnicodeString(padChar.char32At(0));
     } else {
-        fields->properties->padString.setToBogus();
+        fields->properties.padString.setToBogus();
     }
     touchNoError();
 }
 
 EPadPosition DecimalFormat::getPadPosition(void) const {
-    if (fields == nullptr || fields->properties->padPosition.isNull()) {
+    if (fields == nullptr || fields->properties.padPosition.isNull()) {
         return EPadPosition::kPadBeforePrefix;
     } else {
         // UNumberFormatPadPosition and EPadPosition have the same values.
-        return static_cast<EPadPosition>(fields->properties->padPosition.getNoError());
+        return static_cast<EPadPosition>(fields->properties.padPosition.getNoError());
     }
 }
 
 void DecimalFormat::setPadPosition(EPadPosition padPos) {
     if (fields == nullptr) { return; }
     auto uPadPos = static_cast<UNumberFormatPadPosition>(padPos);
-    if (!fields->properties->padPosition.isNull() && uPadPos == fields->properties->padPosition.getNoError()) {
+    if (!fields->properties.padPosition.isNull() && uPadPos == fields->properties.padPosition.getNoError()) {
         return;
     }
-    fields->properties->padPosition = uPadPos;
+    fields->properties.padPosition = uPadPos;
     touchNoError();
 }
 
@@ -1121,17 +1112,17 @@ UBool DecimalFormat::isScientificNotation(void) const {
         // Fallback to using the default instance of DecimalFormatProperties.
         return (DecimalFormatProperties::getDefault().minimumExponentDigits != -1);
     }
-    return (fields->properties->minimumExponentDigits != -1);
+    return (fields->properties.minimumExponentDigits != -1);
 }
 
 void DecimalFormat::setScientificNotation(UBool useScientific) {
     if (fields == nullptr) { return; }
     int32_t minExp = useScientific ? 1 : -1;
-    if (fields->properties->minimumExponentDigits == minExp) { return; }
+    if (fields->properties.minimumExponentDigits == minExp) { return; }
     if (useScientific) {
-        fields->properties->minimumExponentDigits = 1;
+        fields->properties.minimumExponentDigits = 1;
     } else {
-        fields->properties->minimumExponentDigits = -1;
+        fields->properties.minimumExponentDigits = -1;
     }
     touchNoError();
 }
@@ -1142,13 +1133,13 @@ int8_t DecimalFormat::getMinimumExponentDigits(void) const {
         // Fallback to using the default instance of DecimalFormatProperties.
         return static_cast<int8_t>(DecimalFormatProperties::getDefault().minimumExponentDigits);
     }
-    return static_cast<int8_t>(fields->properties->minimumExponentDigits);
+    return static_cast<int8_t>(fields->properties.minimumExponentDigits);
 }
 
 void DecimalFormat::setMinimumExponentDigits(int8_t minExpDig) {
     if (fields == nullptr) { return; }
-    if (minExpDig == fields->properties->minimumExponentDigits) { return; }
-    fields->properties->minimumExponentDigits = minExpDig;
+    if (minExpDig == fields->properties.minimumExponentDigits) { return; }
+    fields->properties.minimumExponentDigits = minExpDig;
     touchNoError();
 }
 
@@ -1158,13 +1149,13 @@ UBool DecimalFormat::isExponentSignAlwaysShown(void) const {
         // Fallback to using the default instance of DecimalFormatProperties.
         return DecimalFormatProperties::getDefault().exponentSignAlwaysShown;
     }
-    return fields->properties->exponentSignAlwaysShown;
+    return fields->properties.exponentSignAlwaysShown;
 }
 
 void DecimalFormat::setExponentSignAlwaysShown(UBool expSignAlways) {
     if (fields == nullptr) { return; }
-    if (UBOOL_TO_BOOL(expSignAlways) == fields->properties->exponentSignAlwaysShown) { return; }
-    fields->properties->exponentSignAlwaysShown = expSignAlways;
+    if (UBOOL_TO_BOOL(expSignAlways) == fields->properties.exponentSignAlwaysShown) { return; }
+    fields->properties.exponentSignAlwaysShown = expSignAlways;
     touchNoError();
 }
 
@@ -1175,7 +1166,7 @@ int32_t DecimalFormat::getGroupingSize(void) const {
         // Fallback to using the default instance of DecimalFormatProperties.
         groupingSize = DecimalFormatProperties::getDefault().groupingSize;
     } else {
-        groupingSize = fields->properties->groupingSize;
+        groupingSize = fields->properties.groupingSize;
     }
     if (groupingSize < 0) {
         return 0;
@@ -1185,8 +1176,8 @@ int32_t DecimalFormat::getGroupingSize(void) const {
 
 void DecimalFormat::setGroupingSize(int32_t newValue) {
     if (fields == nullptr) { return; }
-    if (newValue == fields->properties->groupingSize) { return; }
-    fields->properties->groupingSize = newValue;
+    if (newValue == fields->properties.groupingSize) { return; }
+    fields->properties.groupingSize = newValue;
     touchNoError();
 }
 
@@ -1197,7 +1188,7 @@ int32_t DecimalFormat::getSecondaryGroupingSize(void) const {
         // Fallback to using the default instance of DecimalFormatProperties.
         grouping2 = DecimalFormatProperties::getDefault().secondaryGroupingSize;
     } else {
-        grouping2 = fields->properties->secondaryGroupingSize;
+        grouping2 = fields->properties.secondaryGroupingSize;
     }
     if (grouping2 < 0) {
         return 0;
@@ -1207,8 +1198,8 @@ int32_t DecimalFormat::getSecondaryGroupingSize(void) const {
 
 void DecimalFormat::setSecondaryGroupingSize(int32_t newValue) {
     if (fields == nullptr) { return; }
-    if (newValue == fields->properties->secondaryGroupingSize) { return; }
-    fields->properties->secondaryGroupingSize = newValue;
+    if (newValue == fields->properties.secondaryGroupingSize) { return; }
+    fields->properties.secondaryGroupingSize = newValue;
     touchNoError();
 }
 
@@ -1218,13 +1209,13 @@ int32_t DecimalFormat::getMinimumGroupingDigits() const {
         // Fallback to using the default instance of DecimalFormatProperties.
         return DecimalFormatProperties::getDefault().minimumGroupingDigits;
     }
-    return fields->properties->minimumGroupingDigits;
+    return fields->properties.minimumGroupingDigits;
 }
 
 void DecimalFormat::setMinimumGroupingDigits(int32_t newValue) {
     if (fields == nullptr) { return; }
-    if (newValue == fields->properties->minimumGroupingDigits) { return; }
-    fields->properties->minimumGroupingDigits = newValue;
+    if (newValue == fields->properties.minimumGroupingDigits) { return; }
+    fields->properties.minimumGroupingDigits = newValue;
     touchNoError();
 }
 
@@ -1234,13 +1225,13 @@ UBool DecimalFormat::isDecimalSeparatorAlwaysShown(void) const {
         // Fallback to using the default instance of DecimalFormatProperties.
         return DecimalFormatProperties::getDefault().decimalSeparatorAlwaysShown;
     }
-    return fields->properties->decimalSeparatorAlwaysShown;
+    return fields->properties.decimalSeparatorAlwaysShown;
 }
 
 void DecimalFormat::setDecimalSeparatorAlwaysShown(UBool newValue) {
     if (fields == nullptr) { return; }
-    if (UBOOL_TO_BOOL(newValue) == fields->properties->decimalSeparatorAlwaysShown) { return; }
-    fields->properties->decimalSeparatorAlwaysShown = newValue;
+    if (UBOOL_TO_BOOL(newValue) == fields->properties.decimalSeparatorAlwaysShown) { return; }
+    fields->properties.decimalSeparatorAlwaysShown = newValue;
     touchNoError();
 }
 
@@ -1250,13 +1241,13 @@ UBool DecimalFormat::isDecimalPatternMatchRequired(void) const {
         // Fallback to using the default instance of DecimalFormatProperties.
         return DecimalFormatProperties::getDefault().decimalPatternMatchRequired;
     }
-    return fields->properties->decimalPatternMatchRequired;
+    return fields->properties.decimalPatternMatchRequired;
 }
 
 void DecimalFormat::setDecimalPatternMatchRequired(UBool newValue) {
     if (fields == nullptr) { return; }
-    if (UBOOL_TO_BOOL(newValue) == fields->properties->decimalPatternMatchRequired) { return; }
-    fields->properties->decimalPatternMatchRequired = newValue;
+    if (UBOOL_TO_BOOL(newValue) == fields->properties.decimalPatternMatchRequired) { return; }
+    fields->properties.decimalPatternMatchRequired = newValue;
     touchNoError();
 }
 
@@ -1266,13 +1257,13 @@ UBool DecimalFormat::isParseNoExponent() const {
         // Fallback to using the default instance of DecimalFormatProperties.
         return DecimalFormatProperties::getDefault().parseNoExponent;
     }
-    return fields->properties->parseNoExponent;
+    return fields->properties.parseNoExponent;
 }
 
 void DecimalFormat::setParseNoExponent(UBool value) {
     if (fields == nullptr) { return; }
-    if (UBOOL_TO_BOOL(value) == fields->properties->parseNoExponent) { return; }
-    fields->properties->parseNoExponent = value;
+    if (UBOOL_TO_BOOL(value) == fields->properties.parseNoExponent) { return; }
+    fields->properties.parseNoExponent = value;
     touchNoError();
 }
 
@@ -1282,13 +1273,13 @@ UBool DecimalFormat::isParseCaseSensitive() const {
         // Fallback to using the default instance of DecimalFormatProperties.
         return DecimalFormatProperties::getDefault().parseCaseSensitive;
     }
-    return fields->properties->parseCaseSensitive;
+    return fields->properties.parseCaseSensitive;
 }
 
 void DecimalFormat::setParseCaseSensitive(UBool value) {
     if (fields == nullptr) { return; }
-    if (UBOOL_TO_BOOL(value) == fields->properties->parseCaseSensitive) { return; }
-    fields->properties->parseCaseSensitive = value;
+    if (UBOOL_TO_BOOL(value) == fields->properties.parseCaseSensitive) { return; }
+    fields->properties.parseCaseSensitive = value;
     touchNoError();
 }
 
@@ -1298,13 +1289,13 @@ UBool DecimalFormat::isFormatFailIfMoreThanMaxDigits() const {
         // Fallback to using the default instance of DecimalFormatProperties.
         return DecimalFormatProperties::getDefault().formatFailIfMoreThanMaxDigits;
     }
-    return fields->properties->formatFailIfMoreThanMaxDigits;
+    return fields->properties.formatFailIfMoreThanMaxDigits;
 }
 
 void DecimalFormat::setFormatFailIfMoreThanMaxDigits(UBool value) {
     if (fields == nullptr) { return; }
-    if (UBOOL_TO_BOOL(value) == fields->properties->formatFailIfMoreThanMaxDigits) { return; }
-    fields->properties->formatFailIfMoreThanMaxDigits = value;
+    if (UBOOL_TO_BOOL(value) == fields->properties.formatFailIfMoreThanMaxDigits) { return; }
+    fields->properties.formatFailIfMoreThanMaxDigits = value;
     touchNoError();
 }
 
@@ -1319,7 +1310,7 @@ UnicodeString& DecimalFormat::toPattern(UnicodeString& result) const {
     // so that CurrencyUsage is reflected properly.
     // TODO: Consider putting this logic in number_patternstring.cpp instead.
     ErrorCode localStatus;
-    DecimalFormatProperties tprops(*fields->properties);
+    DecimalFormatProperties tprops(fields->properties);
     bool useCurrency = (
         !tprops.currency.isNull() ||
         !tprops.currencyPluralInfo.fPtr.isNull() ||
@@ -1329,9 +1320,9 @@ UnicodeString& DecimalFormat::toPattern(UnicodeString& result) const {
         AffixUtils::hasCurrencySymbols(tprops.negativePrefixPattern, localStatus) ||
         AffixUtils::hasCurrencySymbols(tprops.negativeSuffixPattern, localStatus));
     if (useCurrency) {
-        tprops.minimumFractionDigits = fields->exportedProperties->minimumFractionDigits;
-        tprops.maximumFractionDigits = fields->exportedProperties->maximumFractionDigits;
-        tprops.roundingIncrement = fields->exportedProperties->roundingIncrement;
+        tprops.minimumFractionDigits = fields->exportedProperties.minimumFractionDigits;
+        tprops.maximumFractionDigits = fields->exportedProperties.maximumFractionDigits;
+        tprops.roundingIncrement = fields->exportedProperties.roundingIncrement;
     }
     result = PatternStringUtils::propertiesToPatternString(tprops, localStatus);
     return result;
@@ -1387,53 +1378,53 @@ void DecimalFormat::applyLocalizedPattern(const UnicodeString& localizedPattern,
 
 void DecimalFormat::setMaximumIntegerDigits(int32_t newValue) {
     if (fields == nullptr) { return; }
-    if (newValue == fields->properties->maximumIntegerDigits) { return; }
+    if (newValue == fields->properties.maximumIntegerDigits) { return; }
     // For backwards compatibility, conflicting min/max need to keep the most recent setting.
-    int32_t min = fields->properties->minimumIntegerDigits;
+    int32_t min = fields->properties.minimumIntegerDigits;
     if (min >= 0 && min > newValue) {
-        fields->properties->minimumIntegerDigits = newValue;
+        fields->properties.minimumIntegerDigits = newValue;
     }
-    fields->properties->maximumIntegerDigits = newValue;
+    fields->properties.maximumIntegerDigits = newValue;
     touchNoError();
 }
 
 void DecimalFormat::setMinimumIntegerDigits(int32_t newValue) {
     if (fields == nullptr) { return; }
-    if (newValue == fields->properties->minimumIntegerDigits) { return; }
+    if (newValue == fields->properties.minimumIntegerDigits) { return; }
     // For backwards compatibility, conflicting min/max need to keep the most recent setting.
-    int32_t max = fields->properties->maximumIntegerDigits;
+    int32_t max = fields->properties.maximumIntegerDigits;
     if (max >= 0 && max < newValue) {
-        fields->properties->maximumIntegerDigits = newValue;
+        fields->properties.maximumIntegerDigits = newValue;
     }
-    fields->properties->minimumIntegerDigits = newValue;
+    fields->properties.minimumIntegerDigits = newValue;
     touchNoError();
 }
 
 void DecimalFormat::setMaximumFractionDigits(int32_t newValue) {
     if (fields == nullptr) { return; }
-    if (newValue == fields->properties->maximumFractionDigits) { return; }
-    // backward compatibility, limit to 340 <rdar://problem/50113359>
+    if (newValue == fields->properties.maximumFractionDigits) { return; }
+    // cap for backward compatibility, limit to 340 <rdar://problem/50113359>
     if (newValue > 340) {
         newValue = 340;
     }
     // For backwards compatibility, conflicting min/max need to keep the most recent setting.
-    int32_t min = fields->properties->minimumFractionDigits;
+    int32_t min = fields->properties.minimumFractionDigits;
     if (min >= 0 && min > newValue) {
-        fields->properties->minimumFractionDigits = newValue;
+        fields->properties.minimumFractionDigits = newValue;
     }
-    fields->properties->maximumFractionDigits = newValue;
+    fields->properties.maximumFractionDigits = newValue;
     touchNoError();
 }
 
 void DecimalFormat::setMinimumFractionDigits(int32_t newValue) {
     if (fields == nullptr) { return; }
-    if (newValue == fields->properties->minimumFractionDigits) { return; }
+    if (newValue == fields->properties.minimumFractionDigits) { return; }
     // For backwards compatibility, conflicting min/max need to keep the most recent setting.
-    int32_t max = fields->properties->maximumFractionDigits;
+    int32_t max = fields->properties.maximumFractionDigits;
     if (max >= 0 && max < newValue) {
-        fields->properties->maximumFractionDigits = newValue;
+        fields->properties.maximumFractionDigits = newValue;
     }
-    fields->properties->minimumFractionDigits = newValue;
+    fields->properties.minimumFractionDigits = newValue;
     touchNoError();
 }
 
@@ -1443,7 +1434,7 @@ int32_t DecimalFormat::getMinimumSignificantDigits() const {
         // Fallback to using the default instance of DecimalFormatProperties.
         return DecimalFormatProperties::getDefault().minimumSignificantDigits;
     }
-    return fields->exportedProperties->minimumSignificantDigits;
+    return fields->exportedProperties.minimumSignificantDigits;
 }
 
 int32_t DecimalFormat::getMaximumSignificantDigits() const {
@@ -1452,28 +1443,28 @@ int32_t DecimalFormat::getMaximumSignificantDigits() const {
         // Fallback to using the default instance of DecimalFormatProperties.
         return DecimalFormatProperties::getDefault().maximumSignificantDigits;
     }
-    return fields->exportedProperties->maximumSignificantDigits;
+    return fields->exportedProperties.maximumSignificantDigits;
 }
 
 void DecimalFormat::setMinimumSignificantDigits(int32_t value) {
     if (fields == nullptr) { return; }
-    if (value == fields->properties->minimumSignificantDigits) { return; }
-    int32_t max = fields->properties->maximumSignificantDigits;
+    if (value == fields->properties.minimumSignificantDigits) { return; }
+    int32_t max = fields->properties.maximumSignificantDigits;
     if (max >= 0 && max < value) {
-        fields->properties->maximumSignificantDigits = value;
+        fields->properties.maximumSignificantDigits = value;
     }
-    fields->properties->minimumSignificantDigits = value;
+    fields->properties.minimumSignificantDigits = value;
     touchNoError();
 }
 
 void DecimalFormat::setMaximumSignificantDigits(int32_t value) {
     if (fields == nullptr) { return; }
-    if (value == fields->properties->maximumSignificantDigits) { return; }
-    int32_t min = fields->properties->minimumSignificantDigits;
+    if (value == fields->properties.maximumSignificantDigits) { return; }
+    int32_t min = fields->properties.minimumSignificantDigits;
     if (min >= 0 && min > value) {
-        fields->properties->minimumSignificantDigits = value;
+        fields->properties.minimumSignificantDigits = value;
     }
-    fields->properties->maximumSignificantDigits = value;
+    fields->properties.maximumSignificantDigits = value;
     touchNoError();
 }
 
@@ -1484,7 +1475,7 @@ UBool DecimalFormat::areSignificantDigitsUsed() const {
         // Fallback to using the default instance of DecimalFormatProperties.
         dfp = &(DecimalFormatProperties::getDefault());
     } else {
-        dfp = fields->properties.getAlias();
+        dfp = &fields->properties;
     }
     return dfp->minimumSignificantDigits != -1 || dfp->maximumSignificantDigits != -1;    
 }
@@ -1494,20 +1485,20 @@ void DecimalFormat::setSignificantDigitsUsed(UBool useSignificantDigits) {
     
     // These are the default values from the old implementation.
     if (useSignificantDigits) {
-        if (fields->properties->minimumSignificantDigits != -1 ||
-            fields->properties->maximumSignificantDigits != -1) {
+        if (fields->properties.minimumSignificantDigits != -1 ||
+            fields->properties.maximumSignificantDigits != -1) {
             return;
         }
     } else {
-        if (fields->properties->minimumSignificantDigits == -1 &&
-            fields->properties->maximumSignificantDigits == -1) {
+        if (fields->properties.minimumSignificantDigits == -1 &&
+            fields->properties.maximumSignificantDigits == -1) {
             return;
         }
     }
     int32_t minSig = useSignificantDigits ? 1 : -1;
     int32_t maxSig = useSignificantDigits ? 6 : -1;
-    fields->properties->minimumSignificantDigits = minSig;
-    fields->properties->maximumSignificantDigits = maxSig;
+    fields->properties.minimumSignificantDigits = minSig;
+    fields->properties.maximumSignificantDigits = maxSig;
     touchNoError();
 }
 
@@ -1523,25 +1514,25 @@ void DecimalFormat::setDateSettings(void) {
     }
     UBool didChange = FALSE;
 
-    if (fields->properties->groupingUsed) {
+    if (fields->properties.groupingUsed) {
         NumberFormat::setGroupingUsed(FALSE); // to set field for compatibility
-        fields->properties->groupingUsed = false;
+        fields->properties.groupingUsed = false;
         didChange = TRUE;
     }
 
-    if (fields->properties->decimalSeparatorAlwaysShown) {
-        fields->properties->decimalSeparatorAlwaysShown = false;
+    if (fields->properties.decimalSeparatorAlwaysShown) {
+        fields->properties.decimalSeparatorAlwaysShown = false;
         didChange = TRUE;
     }
 
-    if (!fields->properties->parseIntegerOnly) {
+    if (!fields->properties.parseIntegerOnly) {
         NumberFormat::setParseIntegerOnly(TRUE); // to set field for compatibility
-        fields->properties->parseIntegerOnly = true;
+        fields->properties.parseIntegerOnly = true;
         didChange = TRUE;
     }
 
-    if (fields->properties->minimumFractionDigits != 0) {
-        fields->properties->minimumFractionDigits = 0;
+    if (fields->properties.minimumFractionDigits != 0) {
+        fields->properties.minimumFractionDigits = 0;
         didChange = TRUE;
     }
 
@@ -1571,11 +1562,11 @@ void DecimalFormat::setCurrency(const char16_t* theCurrency, UErrorCode& ec) {
     //
     CurrencyUnit currencyUnit(theCurrency, ec);
     if (U_FAILURE(ec)) { return; }
-    if (!fields->properties->currency.isNull() && fields->properties->currency.getNoError() == currencyUnit) {
+    if (!fields->properties.currency.isNull() && fields->properties.currency.getNoError() == currencyUnit) {
         return;
     }
     NumberFormat::setCurrency(theCurrency, ec); // to set field for compatibility
-    fields->properties->currency = currencyUnit;
+    fields->properties.currency = currencyUnit;
     // TODO: Set values in fields->symbols, too?
     touchNoError();
 }
@@ -1593,20 +1584,20 @@ void DecimalFormat::setCurrencyUsage(UCurrencyUsage newUsage, UErrorCode* ec) {
         *ec = U_MEMORY_ALLOCATION_ERROR;
         return;
     }
-    if (!fields->properties->currencyUsage.isNull() && newUsage == fields->properties->currencyUsage.getNoError()) {
+    if (!fields->properties.currencyUsage.isNull() && newUsage == fields->properties.currencyUsage.getNoError()) {
         return;
     }
-    fields->properties->currencyUsage = newUsage;
+    fields->properties.currencyUsage = newUsage;
     touch(*ec);
 }
 
 UCurrencyUsage DecimalFormat::getCurrencyUsage() const {
     // CurrencyUsage is not exported, so we have to get it from the input property bag.
     // TODO: Should we export CurrencyUsage instead?
-    if (fields == nullptr || fields->properties->currencyUsage.isNull()) {
+    if (fields == nullptr || fields->properties.currencyUsage.isNull()) {
         return UCURR_USAGE_STANDARD;
     }
-    return fields->properties->currencyUsage.getNoError();
+    return fields->properties.currencyUsage.getNoError();
 }
 
 void
@@ -1618,7 +1609,7 @@ DecimalFormat::formatToDecimalQuantity(double number, DecimalQuantity& output, U
         status = U_MEMORY_ALLOCATION_ERROR;
         return;
     }
-    fields->formatter->formatDouble(number, status).getDecimalQuantity(output, status);
+    fields->formatter.formatDouble(number, status).getDecimalQuantity(output, status);
 }
 
 void DecimalFormat::formatToDecimalQuantity(const Formattable& number, DecimalQuantity& output,
@@ -1632,7 +1623,7 @@ void DecimalFormat::formatToDecimalQuantity(const Formattable& number, DecimalQu
     }
     UFormattedNumberData obj;
     number.populateDecimalQuantity(obj.quantity, status);
-    fields->formatter->formatImpl(&obj, status);
+    fields->formatter.formatImpl(&obj, status);
     output = std::move(obj.quantity);
 }
 
@@ -1644,18 +1635,13 @@ const number::LocalizedNumberFormatter* DecimalFormat::toNumberFormatter(UErrorC
         status = U_MEMORY_ALLOCATION_ERROR;
         return nullptr;
     }
-    return &*fields->formatter;
-}
-
-const number::LocalizedNumberFormatter& DecimalFormat::toNumberFormatter() const {
-    UErrorCode localStatus = U_ZERO_ERROR;
-    return *toNumberFormatter(localStatus);
+    return &fields->formatter;
 }
 
 // Apple <rdar://problem/49955427>
 void DecimalFormat::setDFSShallowCopy(UBool shallow) {
-    if (fields != nullptr && fields->formatter != nullptr) {
-        fields->formatter->setDFSShallowCopy(shallow);
+    if (fields != nullptr) {
+        fields->formatter.setDFSShallowCopy(shallow);
     }
 }
 
@@ -1683,9 +1669,9 @@ void DecimalFormat::touch(UErrorCode& status) {
  
     // Since memory has already been allocated for the formatter, we can move assign a stack-allocated object
     // and don't need to call new. (Which is slower and could possibly fail).
-    *fields->formatter = NumberPropertyMapper::create(
-        *fields->properties, *fields->symbols, fields->warehouse, *fields->exportedProperties, status).locale(
-            locale);
+    fields->formatter = NumberPropertyMapper::create(
+        fields->properties, *fields->symbols, fields->warehouse, fields->exportedProperties, status
+    ).locale(locale);
 
     // Do this after fields->exportedProperties are set up
     setupFastFormat();
@@ -1696,7 +1682,7 @@ void DecimalFormat::touch(UErrorCode& status) {
 
     // In order for the getters to work, we need to populate some fields in NumberFormat.
     const UChar* newCurr = u"";
-    CurrencyUnit currency = fields->exportedProperties->currency.get(status);
+    CurrencyUnit currency = fields->exportedProperties.currency.get(status);
     if (U_SUCCESS(status)) {
         // currency.getISOCurrency() is an inline that just returns a pointer to currency's
         // internal field char16_t isoCode[4], cannot be NULL if currency is valid:
@@ -1710,12 +1696,12 @@ void DecimalFormat::touch(UErrorCode& status) {
         }
     }
     NumberFormat::setCurrency(newCurr, status);
-    NumberFormat::setMaximumIntegerDigits(fields->exportedProperties->maximumIntegerDigits);
-    NumberFormat::setMinimumIntegerDigits(fields->exportedProperties->minimumIntegerDigits);
-    NumberFormat::setMaximumFractionDigits(fields->exportedProperties->maximumFractionDigits);
-    NumberFormat::setMinimumFractionDigits(fields->exportedProperties->minimumFractionDigits);
+    NumberFormat::setMaximumIntegerDigits(fields->exportedProperties.maximumIntegerDigits);
+    NumberFormat::setMinimumIntegerDigits(fields->exportedProperties.minimumIntegerDigits);
+    NumberFormat::setMaximumFractionDigits(fields->exportedProperties.maximumFractionDigits);
+    NumberFormat::setMinimumFractionDigits(fields->exportedProperties.minimumFractionDigits);
     // fImpl->properties, not fields->exportedProperties, since this information comes from the pattern:
-    NumberFormat::setGroupingUsed(fields->properties->groupingUsed);
+    NumberFormat::setGroupingUsed(fields->properties.groupingUsed);
 }
 
 void DecimalFormat::touchNoError() {
@@ -1728,7 +1714,7 @@ void DecimalFormat::setPropertiesFromPattern(const UnicodeString& pattern, int32
     if (U_SUCCESS(status)) {
         // Cast workaround to get around putting the enum in the public header file
         auto actualIgnoreRounding = static_cast<IgnoreRounding>(ignoreRounding);
-        PatternParser::parseToExistingProperties(pattern, *fields->properties,  actualIgnoreRounding, status);
+        PatternParser::parseToExistingProperties(pattern, fields->properties,  actualIgnoreRounding, status);
     }
 }
 
@@ -1747,7 +1733,7 @@ const numparse::impl::NumberParserImpl* DecimalFormat::getParser(UErrorCode& sta
     }
 
     // Try computing the parser on our own
-    auto* temp = NumberParserImpl::createParserFromProperties(*fields->properties, *fields->symbols, false, status);
+    auto* temp = NumberParserImpl::createParserFromProperties(fields->properties, *fields->symbols, false, status);
     if (U_FAILURE(status)) {
         return nullptr;
     }
@@ -1780,7 +1766,7 @@ const numparse::impl::NumberParserImpl* DecimalFormat::getCurrencyParser(UErrorC
     }
 
     // Try computing the parser on our own
-    auto* temp = NumberParserImpl::createParserFromProperties(*fields->properties, *fields->symbols, true, status);
+    auto* temp = NumberParserImpl::createParserFromProperties(fields->properties, *fields->symbols, true, status);
     if (temp == nullptr) {
         status = U_MEMORY_ALLOCATION_ERROR;
         // although we may still dereference, call sites should be guarded
@@ -1828,7 +1814,7 @@ DecimalFormat::fieldPositionIteratorHelper(const number::FormattedNumber& format
 
 void DecimalFormat::setupFastFormat() {
     // Check the majority of properties:
-    if (!fields->properties->equalsDefaultExceptFastFormat()) {
+    if (!fields->properties.equalsDefaultExceptFastFormat()) {
         trace("no fast format: equality\n");
         fields->canUseFastFormat = false;
         return;
@@ -1836,12 +1822,12 @@ void DecimalFormat::setupFastFormat() {
 
     // Now check the remaining properties.
     // Nontrivial affixes:
-    UBool trivialPP = fields->properties->positivePrefixPattern.isEmpty();
-    UBool trivialPS = fields->properties->positiveSuffixPattern.isEmpty();
-    UBool trivialNP = fields->properties->negativePrefixPattern.isBogus() || (
-            fields->properties->negativePrefixPattern.length() == 1 &&
-            fields->properties->negativePrefixPattern.charAt(0) == u'-');
-    UBool trivialNS = fields->properties->negativeSuffixPattern.isEmpty();
+    UBool trivialPP = fields->properties.positivePrefixPattern.isEmpty();
+    UBool trivialPS = fields->properties.positiveSuffixPattern.isEmpty();
+    UBool trivialNP = fields->properties.negativePrefixPattern.isBogus() || (
+            fields->properties.negativePrefixPattern.length() == 1 &&
+            fields->properties.negativePrefixPattern.charAt(0) == u'-');
+    UBool trivialNS = fields->properties.negativeSuffixPattern.isEmpty();
     if (!trivialPP || !trivialPS || !trivialNP || !trivialNS) {
         trace("no fast format: affixes\n");
         fields->canUseFastFormat = false;
@@ -1849,8 +1835,8 @@ void DecimalFormat::setupFastFormat() {
     }
 
     // Grouping (secondary grouping is forbidden in equalsDefaultExceptFastFormat):
-    bool groupingUsed = fields->properties->groupingUsed;
-    int32_t groupingSize = fields->properties->groupingSize;
+    bool groupingUsed = fields->properties.groupingUsed;
+    int32_t groupingSize = fields->properties.groupingSize;
     bool unusualGroupingSize = groupingSize > 0 && groupingSize != 3;
     const UnicodeString& groupingString = fields->symbols->getConstSymbol(DecimalFormatSymbols::kGroupingSeparatorSymbol);
     if (groupingUsed && (unusualGroupingSize || groupingString.length() != 1)) {
@@ -1860,8 +1846,8 @@ void DecimalFormat::setupFastFormat() {
     }
 
     // Integer length:
-    int32_t minInt = fields->exportedProperties->minimumIntegerDigits;
-    int32_t maxInt = fields->exportedProperties->maximumIntegerDigits;
+    int32_t minInt = fields->exportedProperties.minimumIntegerDigits;
+    int32_t maxInt = fields->exportedProperties.maximumIntegerDigits;
     // Fastpath supports up to only 10 digits (length of INT32_MIN)
     if (minInt > 10) {
         trace("no fast format: integer\n");
@@ -1870,7 +1856,7 @@ void DecimalFormat::setupFastFormat() {
     }
 
     // Fraction length (no fraction part allowed in fast path):
-    int32_t minFrac = fields->exportedProperties->minimumFractionDigits;
+    int32_t minFrac = fields->exportedProperties.minimumFractionDigits;
     if (minFrac > 0) {
         trace("no fast format: fraction\n");
         fields->canUseFastFormat = false;