| OLD | NEW |
| 1 /* | 1 /* |
| 2 ******************************************************************************* | 2 ******************************************************************************* |
| 3 * Copyright (C) 1997-2010, International Business Machines Corporation and * | 3 * Copyright (C) 1997-2010, International Business Machines Corporation and * |
| 4 * others. All Rights Reserved. * | 4 * others. All Rights Reserved. * |
| 5 ******************************************************************************* | 5 ******************************************************************************* |
| 6 * | 6 * |
| 7 * File NUMFMT.CPP | 7 * File NUMFMT.CPP |
| 8 * | 8 * |
| 9 * Modification History: | 9 * Modification History: |
| 10 * | 10 * |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 inline const Formattable* | 380 inline const Formattable* |
| 381 ArgExtractor::number(void) const { | 381 ArgExtractor::number(void) const { |
| 382 return num; | 382 return num; |
| 383 } | 383 } |
| 384 | 384 |
| 385 ArgExtractor::ArgExtractor(const NumberFormat& nf, const Formattable& obj, UErro
rCode& status) | 385 ArgExtractor::ArgExtractor(const NumberFormat& nf, const Formattable& obj, UErro
rCode& status) |
| 386 : ncnf((NumberFormat*) &nf), num(&obj), setCurr(FALSE) { | 386 : ncnf((NumberFormat*) &nf), num(&obj), setCurr(FALSE) { |
| 387 | 387 |
| 388 const UObject* o = obj.getObject(); // most commonly o==NULL | 388 const UObject* o = obj.getObject(); // most commonly o==NULL |
| 389 const CurrencyAmount* amt; | 389 const CurrencyAmount* amt; |
| 390 if (o != NULL && (amt = dynamic_cast<const CurrencyAmount*>(o)) != NULL) { | 390 if (o != NULL && (amt = CR_DYNAMIC_CAST<const CurrencyAmount*>(o)) != NULL)
{ |
| 391 // getISOCurrency() returns a pointer to internal storage, so we | 391 // getISOCurrency() returns a pointer to internal storage, so we |
| 392 // copy it to retain it across the call to setCurrency(). | 392 // copy it to retain it across the call to setCurrency(). |
| 393 const UChar* curr = amt->getISOCurrency(); | 393 const UChar* curr = amt->getISOCurrency(); |
| 394 u_strcpy(save, nf.getCurrency()); | 394 u_strcpy(save, nf.getCurrency()); |
| 395 setCurr = (u_strcmp(curr, save) != 0); | 395 setCurr = (u_strcmp(curr, save) != 0); |
| 396 if (setCurr) { | 396 if (setCurr) { |
| 397 ncnf->setCurrency(curr, status); | 397 ncnf->setCurrency(curr, status); |
| 398 } | 398 } |
| 399 num = &amt->getNumber(); | 399 num = &amt->getNumber(); |
| 400 } | 400 } |
| (...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1290 delete symbolsToAdopt; | 1290 delete symbolsToAdopt; |
| 1291 } | 1291 } |
| 1292 return f; | 1292 return f; |
| 1293 } | 1293 } |
| 1294 | 1294 |
| 1295 U_NAMESPACE_END | 1295 U_NAMESPACE_END |
| 1296 | 1296 |
| 1297 #endif /* #if !UCONFIG_NO_FORMATTING */ | 1297 #endif /* #if !UCONFIG_NO_FORMATTING */ |
| 1298 | 1298 |
| 1299 //eof | 1299 //eof |
| OLD | NEW |