fUseSignificantDigits = rhs.fUseSignificantDigits;
fFormatPattern = rhs.fFormatPattern;
fStyle = rhs.fStyle;
- fCurrencySignCount = rhs.fCurrencySignCount;
+ //fCurrencySignCount = rhs.fCurrencySignCount; // duplicates line above
_clone_ptr(&fCurrencyPluralInfo, rhs.fCurrencyPluralInfo);
deleteHashForAffixPattern();
if (rhs.fAffixPatternsForCurrency) {
if (first) { printf("[ "); first = FALSE; } else { printf(", "); }
debug("Rounding Increment !=");
}
+ if (fRoundingMode != other->fRoundingMode) {
+ if (first) { printf("[ "); first = FALSE; } else { printf(", "); }
+ printf("Rounding Mode %d != %d", (int)fRoundingMode, (int)other->fRoundingMode);
+ }
if (getMultiplier() != other->getMultiplier()) {
if (first) { printf("[ "); first = FALSE; }
printf("Multiplier %ld != %ld", getMultiplier(), other->getMultiplier());
}
if (fDecimalSeparatorAlwaysShown != other->fDecimalSeparatorAlwaysShown) {
if (first) { printf("[ "); first = FALSE; } else { printf(", "); }
- printf("Dec Sep Always %d != %d", fDecimalSeparatorAlwaysShown, other->fDecimalSeparatorAlwaysShown);
+ printf("fDecimalSeparatorAlwaysShown %d != %d", fDecimalSeparatorAlwaysShown, other->fDecimalSeparatorAlwaysShown);
}
if (fUseExponentialNotation != other->fUseExponentialNotation) {
if (first) { printf("[ "); first = FALSE; } else { printf(", "); }
- debug("Use Exp !=");
+ debug("fUseExponentialNotation !=");
+ }
+ if (fUseExponentialNotation &&
+ fMinExponentDigits != other->fMinExponentDigits) {
+ if (first) { printf("[ "); first = FALSE; } else { printf(", "); }
+ debug("fMinExponentDigits !=");
+ }
+ if (fUseExponentialNotation &&
+ fExponentSignAlwaysShown != other->fExponentSignAlwaysShown) {
+ if (first) { printf("[ "); first = FALSE; } else { printf(", "); }
+ debug("fExponentSignAlwaysShown !=");
}
- if (!(!fUseExponentialNotation ||
- fMinExponentDigits != other->fMinExponentDigits)) {
+ if (fBoolFlags.getAll() != other->fBoolFlags.getAll()) {
if (first) { printf("[ "); first = FALSE; } else { printf(", "); }
- debug("Exp Digits !=");
+ debug("fBoolFlags !=");
}
if (*fSymbols != *(other->fSymbols)) {
if (first) { printf("[ "); first = FALSE; } else { printf(", "); }
}
// TODO Add debug stuff for significant digits here
if (fUseSignificantDigits != other->fUseSignificantDigits) {
+ if (first) { printf("[ "); first = FALSE; } else { printf(", "); }
debug("fUseSignificantDigits !=");
}
if (fUseSignificantDigits &&
fMinSignificantDigits != other->fMinSignificantDigits) {
+ if (first) { printf("[ "); first = FALSE; } else { printf(", "); }
debug("fMinSignificantDigits !=");
}
if (fUseSignificantDigits &&
fMaxSignificantDigits != other->fMaxSignificantDigits) {
+ if (first) { printf("[ "); first = FALSE; } else { printf(", "); }
debug("fMaxSignificantDigits !=");
}
+ if (fFormatWidth != other->fFormatWidth) {
+ if (first) { printf("[ "); first = FALSE; } else { printf(", "); }
+ debug("fFormatWidth !=");
+ }
+ if (fPad != other->fPad) {
+ if (first) { printf("[ "); first = FALSE; } else { printf(", "); }
+ debug("fPad !=");
+ }
+ if (fPadPosition != other->fPadPosition) {
+ if (first) { printf("[ "); first = FALSE; } else { printf(", "); }
+ debug("fPadPosition !=");
+ }
+ if (fStyle == UNUM_CURRENCY_PLURAL &&
+ fStyle != other->fStyle)
+ if (first) { printf("[ "); first = FALSE; } else { printf(", "); }
+ debug("fStyle !=");
+ }
+ if (fStyle == UNUM_CURRENCY_PLURAL &&
+ fFormatPattern != other->fFormatPattern) {
+ if (first) { printf("[ "); first = FALSE; } else { printf(", "); }
+ debug("fFormatPattern !=");
+ }
if (!first) { printf(" ]"); }
if (fCurrencySignCount != other->fCurrencySignCount) {
|| (fRoundingIncrement != NULL &&
other->fRoundingIncrement != NULL &&
*fRoundingIncrement == *other->fRoundingIncrement)) &&
+ fRoundingMode == other->fRoundingMode &&
getMultiplier() == other->getMultiplier() &&
fGroupingSize == other->fGroupingSize &&
fGroupingSize2 == other->fGroupingSize2 &&
fDecimalSeparatorAlwaysShown == other->fDecimalSeparatorAlwaysShown &&
fUseExponentialNotation == other->fUseExponentialNotation &&
(!fUseExponentialNotation ||
- fMinExponentDigits == other->fMinExponentDigits) &&
+ (fMinExponentDigits == other->fMinExponentDigits && fExponentSignAlwaysShown == other->fExponentSignAlwaysShown)) &&
+ fBoolFlags.getAll() == other->fBoolFlags.getAll() &&
*fSymbols == *(other->fSymbols) &&
fUseSignificantDigits == other->fUseSignificantDigits &&
(!fUseSignificantDigits ||
- (fMinSignificantDigits == other->fMinSignificantDigits &&
- fMaxSignificantDigits == other->fMaxSignificantDigits)) &&
+ (fMinSignificantDigits == other->fMinSignificantDigits && fMaxSignificantDigits == other->fMaxSignificantDigits)) &&
+ fFormatWidth == other->fFormatWidth &&
+ fPad == other->fPad &&
+ fPadPosition == other->fPadPosition &&
+ (fStyle != UNUM_CURRENCY_PLURAL ||
+ (fStyle == other->fStyle && fFormatPattern == other->fFormatPattern)) &&
fCurrencySignCount == other->fCurrencySignCount &&
((fCurrencyPluralInfo == other->fCurrencyPluralInfo &&
fCurrencyPluralInfo == NULL) ||
(fCurrencyPluralInfo != NULL && other->fCurrencyPluralInfo != NULL &&
*fCurrencyPluralInfo == *(other->fCurrencyPluralInfo))));
+ // depending on other settings we may also need to compare
+ // fCurrencyChoice (mostly deprecated?),
+ // fAffixesForCurrency & fPluralAffixesForCurrency (only relevant in some cases)
}
//------------------------------------------------------------------------------
for (affixPos = 0; affixPos < affixLen; affixPos++) {
UChar c = affix.charAt(affixPos);
if (!IS_BIDI_MARK(c)) {
- if (trimLen < TRIM_BUFLEN) {
- trimBuf[trimLen++] = c;
- } else {
- trimLen = 0;
- break;
- }
+ if (trimLen < TRIM_BUFLEN) {
+ trimBuf[trimLen++] = c;
+ } else {
+ trimLen = 0;
+ break;
+ }
}
}
return (trimLen > 0)? trimmedAffix.setTo(trimBuf, trimLen): trimmedAffix.setTo(affix);
UChar effectiveCurr[4];
getEffectiveCurrency(effectiveCurr, ec);
if ( U_FAILURE(ec) || u_strncmp(curr,effectiveCurr,4) != 0 ) {
- pos = -1;
- continue;
+ pos = -1;
+ continue;
}
}
pos = ppos.getIndex();