Logo Search packages:      
Sourcecode: icu version File versions

void DecimalFormat::adoptDecimalFormatSymbols ( DecimalFormatSymbols symbolsToAdopt ) [virtual]

Sets the decimal format symbols, which is generally not changed by the programmer or user.

Parameters:
symbolsToAdoptDecimalFormatSymbols to be adopted. ICU 2.0

Definition at line 2630 of file decimfmt.cpp.

References expandAffixes(), FALSE, DecimalFormatSymbols::getConstSymbol(), getConstSymbol(), DecimalFormatSymbols::kCurrencySymbol, DecimalFormatSymbols::kIntlCurrencySymbol, NULL, and setCurrencyForSymbols().

Referenced by setDecimalFormatSymbols(), NumberFormatRegressionTest::Test4147706(), NumberFormatTest::TestAdoptDecimalFormatSymbols(), and IntlTestDecimalFormatAPI::testAPI().

{
    if (symbolsToAdopt == NULL) {
        return; // do not allow caller to set fSymbols to NULL
    }

    UBool sameSymbols = FALSE;
    if (fSymbols != NULL) {
        sameSymbols = (UBool)(getConstSymbol(DecimalFormatSymbols::kCurrencySymbol) ==
            symbolsToAdopt->getConstSymbol(DecimalFormatSymbols::kCurrencySymbol) &&
            getConstSymbol(DecimalFormatSymbols::kIntlCurrencySymbol) ==
            symbolsToAdopt->getConstSymbol(DecimalFormatSymbols::kIntlCurrencySymbol));
        delete fSymbols;
    }

    fSymbols = symbolsToAdopt;
    if (!sameSymbols) {
        // If the currency symbols are the same, there is no need to recalculate.
        setCurrencyForSymbols();
    }
    expandAffixes(NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index