| Index: third_party/icu/source/i18n/msgfmt.cpp
|
| ===================================================================
|
| --- third_party/icu/source/i18n/msgfmt.cpp (revision 74230)
|
| +++ third_party/icu/source/i18n/msgfmt.cpp (working copy)
|
| @@ -729,7 +729,7 @@
|
| if (fmt == NULL) {
|
| // do nothing, string format
|
| }
|
| - else if ((decfmt = dynamic_cast<DecimalFormat*>(fmt)) != NULL) {
|
| + else if ((decfmt = CR_DYNAMIC_CAST<DecimalFormat*>(fmt)) != NULL) {
|
| UErrorCode ec = U_ZERO_ERROR;
|
| NumberFormat& formatAlias = *decfmt;
|
| NumberFormat *defaultTemplate = NumberFormat::createInstance(fLocale, ec);
|
| @@ -761,7 +761,7 @@
|
| delete percentTemplate;
|
| delete integerTemplate;
|
| }
|
| - else if ((sdtfmt = dynamic_cast<SimpleDateFormat*>(fmt)) != NULL) {
|
| + else if ((sdtfmt = CR_DYNAMIC_CAST<SimpleDateFormat*>(fmt)) != NULL) {
|
| DateFormat& formatAlias = *sdtfmt;
|
| DateFormat *defaultDateTemplate = DateFormat::createDateInstance(DateFormat::kDefault, fLocale);
|
| DateFormat *shortDateTemplate = DateFormat::createDateInstance(DateFormat::kShort, fLocale);
|
| @@ -837,18 +837,18 @@
|
| delete fullTimeTemplate;
|
| // {sfb} there should be a more efficient way to do this!
|
| }
|
| - else if ((chcfmt = dynamic_cast<ChoiceFormat*>(fmt)) != NULL) {
|
| + else if ((chcfmt = CR_DYNAMIC_CAST<ChoiceFormat*>(fmt)) != NULL) {
|
| UnicodeString buffer;
|
| appendTo += COMMA;
|
| appendTo += ID_CHOICE;
|
| appendTo += COMMA;
|
| appendTo += ((ChoiceFormat*)fmt)->toPattern(buffer);
|
| }
|
| - else if ((plfmt = dynamic_cast<PluralFormat*>(fmt)) != NULL) {
|
| + else if ((plfmt = CR_DYNAMIC_CAST<PluralFormat*>(fmt)) != NULL) {
|
| UnicodeString buffer;
|
| appendTo += plfmt->toPattern(buffer);
|
| }
|
| - else if ((selfmt = dynamic_cast<SelectFormat*>(fmt)) != NULL) {
|
| + else if ((selfmt = CR_DYNAMIC_CAST<SelectFormat*>(fmt)) != NULL) {
|
| UnicodeString buffer;
|
| appendTo += ((SelectFormat*)fmt)->toPattern(buffer);
|
| }
|
| @@ -1246,9 +1246,9 @@
|
|
|
| // Needs to reprocess the ChoiceFormat and PluralFormat and SelectFormat option by using the
|
| // MessageFormat pattern application.
|
| - if ((dynamic_cast<ChoiceFormat*>(fmt) != NULL ||
|
| - dynamic_cast<PluralFormat*>(fmt) != NULL ||
|
| - dynamic_cast<SelectFormat*>(fmt) != NULL) &&
|
| + if ((CR_DYNAMIC_CAST<ChoiceFormat*>(fmt) != NULL ||
|
| + CR_DYNAMIC_CAST<PluralFormat*>(fmt) != NULL ||
|
| + CR_DYNAMIC_CAST<SelectFormat*>(fmt) != NULL) &&
|
| argNum.indexOf(LEFT_CURLY_BRACE) >= 0
|
| ) {
|
| MessageFormat temp(argNum, fLocale, success);
|
| @@ -1564,7 +1564,7 @@
|
| default: // pattern
|
| fmt = NumberFormat::createInstance(fLocale, ec);
|
| if (fmt) {
|
| - DecimalFormat* decfmt = dynamic_cast<DecimalFormat*>(fmt);
|
| + DecimalFormat* decfmt = CR_DYNAMIC_CAST<DecimalFormat*>(fmt);
|
| if (decfmt != NULL) {
|
| decfmt->applyPattern(segments[3],parseError,ec);
|
| }
|
| @@ -1586,7 +1586,7 @@
|
| }
|
|
|
| if (styleID < 0 && fmt != NULL) {
|
| - SimpleDateFormat* sdtfmt = dynamic_cast<SimpleDateFormat*>(fmt);
|
| + SimpleDateFormat* sdtfmt = CR_DYNAMIC_CAST<SimpleDateFormat*>(fmt);
|
| if (sdtfmt != NULL) {
|
| sdtfmt->applyPattern(segments[3]);
|
| }
|
| @@ -1748,7 +1748,7 @@
|
| MessageFormat::createIntegerFormat(const Locale& locale, UErrorCode& status) const {
|
| NumberFormat *temp = NumberFormat::createInstance(locale, status);
|
| DecimalFormat *temp2;
|
| - if (temp != NULL && (temp2 = dynamic_cast<DecimalFormat*>(temp)) != NULL) {
|
| + if (temp != NULL && (temp2 = CR_DYNAMIC_CAST<DecimalFormat*>(temp)) != NULL) {
|
| temp2->setMaximumFractionDigits(0);
|
| temp2->setDecimalSeparatorAlwaysShown(FALSE);
|
| temp2->setParseIntegerOnly(TRUE);
|
|
|