X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/57a6839dcb3bba09e8228b822b290604668416fe..ef6cf650f4a75c3f97de06b51fa104f2069b9ea2:/icuSources/i18n/decimalformatpattern.cpp diff --git a/icuSources/i18n/decimalformatpattern.cpp b/icuSources/i18n/decimalformatpattern.cpp index 5d9988df..317f842f 100644 --- a/icuSources/i18n/decimalformatpattern.cpp +++ b/icuSources/i18n/decimalformatpattern.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. * ******************************************************************************* */ @@ -13,6 +13,8 @@ #include "unicode/dcfmtsym.h" #include "unicode/format.h" #include "unicode/utf16.h" +#include "decimalformatpatternimpl.h" + #ifdef FMT_DEBUG #define debug(x) printf("%s:%d: %s\n", __FILE__,__LINE__, x); @@ -20,23 +22,6 @@ #define debug(x) #endif -#define kPatternZeroDigit ((UChar)0x0030) /*'0'*/ -#define kPatternSignificantDigit ((UChar)0x0040) /*'@'*/ -#define kPatternGroupingSeparator ((UChar)0x002C) /*','*/ -#define kPatternDecimalSeparator ((UChar)0x002E) /*'.'*/ -#define kPatternPerMill ((UChar)0x2030) -#define kPatternPercent ((UChar)0x0025) /*'%'*/ -#define kPatternDigit ((UChar)0x0023) /*'#'*/ -#define kPatternSeparator ((UChar)0x003B) /*';'*/ -#define kPatternExponent ((UChar)0x0045) /*'E'*/ -#define kPatternPlus ((UChar)0x002B) /*'+'*/ -#define kPatternMinus ((UChar)0x002D) /*'-'*/ -#define kPatternPadEscape ((UChar)0x002A) /*'*'*/ -#define kQuote ((UChar)0x0027) /*'\''*/ - -#define kCurrencySign ((UChar)0x00A4) -#define kDefaultPad ((UChar)0x0020) /* */ - U_NAMESPACE_BEGIN // TODO: Travis Keep: Copied from numfmt.cpp @@ -91,7 +76,7 @@ DecimalFormatPattern::DecimalFormatPattern() fFormatWidth(0), fRoundingIncrementUsed(FALSE), fRoundingIncrement(), - fPad(kPatternPadEscape), + fPad(kDefaultPad), fNegPatternsBogus(TRUE), fPosPatternsBogus(TRUE), fNegPrefixPattern(), @@ -647,10 +632,19 @@ DecimalFormatPatternParser::applyPatternWithoutExpandAffix( && out.fNegSuffixPattern == out.fPosSuffixPattern)) { out.fNegPatternsBogus = FALSE; out.fNegSuffixPattern = out.fPosSuffixPattern; - out.fNegPrefixPattern.remove(); // restore this line + out.fNegPrefixPattern.remove(); out.fNegPrefixPattern.append(kQuote).append(kPatternMinus) .append(out.fPosPrefixPattern); } + // TODO: Deprecate/Remove out.fNegSuffixPattern and 3 other fields. + AffixPattern::parseAffixString( + out.fNegSuffixPattern, out.fNegSuffixAffix, status); + AffixPattern::parseAffixString( + out.fPosSuffixPattern, out.fPosSuffixAffix, status); + AffixPattern::parseAffixString( + out.fNegPrefixPattern, out.fNegPrefixAffix, status); + AffixPattern::parseAffixString( + out.fPosPrefixPattern, out.fPosPrefixAffix, status); } U_NAMESPACE_END