OLD | NEW |
1 /* | 1 /* |
2 ******************************************************************************* | 2 ******************************************************************************* |
3 * Copyright (C) 2007-2010, International Business Machines Corporation and | 3 * Copyright (C) 2007-2010, International Business Machines Corporation and |
4 * others. All Rights Reserved. | 4 * others. All Rights Reserved. |
5 ******************************************************************************* | 5 ******************************************************************************* |
6 * | 6 * |
7 * File DTPTNGEN.CPP | 7 * File DTPTNGEN.CPP |
8 * | 8 * |
9 ******************************************************************************* | 9 ******************************************************************************* |
10 */ | 10 */ |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 | 407 |
408 if (U_FAILURE(status)) { | 408 if (U_FAILURE(status)) { |
409 return; | 409 return; |
410 } | 410 } |
411 | 411 |
412 // Load with ICU patterns | 412 // Load with ICU patterns |
413 for (int32_t i=DateFormat::kFull; i<=DateFormat::kShort; i++) { | 413 for (int32_t i=DateFormat::kFull; i<=DateFormat::kShort; i++) { |
414 DateFormat::EStyle style = (DateFormat::EStyle)i; | 414 DateFormat::EStyle style = (DateFormat::EStyle)i; |
415 df = DateFormat::createDateInstance(style, locale); | 415 df = DateFormat::createDateInstance(style, locale); |
416 SimpleDateFormat* sdf; | 416 SimpleDateFormat* sdf; |
417 if (df != NULL && (sdf = dynamic_cast<SimpleDateFormat*>(df)) != NULL) { | 417 if (df != NULL && (sdf = CR_DYNAMIC_CAST<SimpleDateFormat*>(df)) != NULL
) { |
418 conflictingStatus = addPattern(sdf->toPattern(dfPattern), FALSE, con
flictingString, status); | 418 conflictingStatus = addPattern(sdf->toPattern(dfPattern), FALSE, con
flictingString, status); |
419 } | 419 } |
420 // TODO Maybe we should return an error when the date format isn't simpl
e. | 420 // TODO Maybe we should return an error when the date format isn't simpl
e. |
421 delete df; | 421 delete df; |
422 if (U_FAILURE(status)) { | 422 if (U_FAILURE(status)) { |
423 return; | 423 return; |
424 } | 424 } |
425 | 425 |
426 df = DateFormat::createTimeInstance(style, locale); | 426 df = DateFormat::createTimeInstance(style, locale); |
427 if (df != NULL && (sdf = dynamic_cast<SimpleDateFormat*>(df)) != NULL) { | 427 if (df != NULL && (sdf = CR_DYNAMIC_CAST<SimpleDateFormat*>(df)) != NULL
) { |
428 conflictingStatus = addPattern(sdf->toPattern(dfPattern), FALSE, con
flictingString, status); | 428 conflictingStatus = addPattern(sdf->toPattern(dfPattern), FALSE, con
flictingString, status); |
429 // HACK for hh:ss | 429 // HACK for hh:ss |
430 if ( i==DateFormat::kMedium ) { | 430 if ( i==DateFormat::kMedium ) { |
431 hackPattern = dfPattern; | 431 hackPattern = dfPattern; |
432 } | 432 } |
433 } | 433 } |
434 // TODO Maybe we should return an error when the date format isn't simpl
e. | 434 // TODO Maybe we should return an error when the date format isn't simpl
e. |
435 delete df; | 435 delete df; |
436 if (U_FAILURE(status)) { | 436 if (U_FAILURE(status)) { |
437 return; | 437 return; |
(...skipping 1712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2150 } | 2150 } |
2151 delete fPatterns; | 2151 delete fPatterns; |
2152 } | 2152 } |
2153 | 2153 |
2154 U_NAMESPACE_END | 2154 U_NAMESPACE_END |
2155 | 2155 |
2156 | 2156 |
2157 #endif /* #if !UCONFIG_NO_FORMATTING */ | 2157 #endif /* #if !UCONFIG_NO_FORMATTING */ |
2158 | 2158 |
2159 //eof | 2159 //eof |
OLD | NEW |