| OLD | NEW |
| 1 /* | 1 /* |
| 2 ******************************************************************************* | 2 ******************************************************************************* |
| 3 * Copyright (C) 1997-2010, International Business Machines Corporation | 3 * Copyright (C) 1997-2010, International Business Machines Corporation |
| 4 * and others. All Rights Reserved. | 4 * and others. All Rights Reserved. |
| 5 ******************************************************************************* | 5 ******************************************************************************* |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include <typeinfo> // for 'typeid' to work | |
| 9 | 8 |
| 10 #include "unicode/rbnf.h" | 9 #include "unicode/rbnf.h" |
| 11 | 10 |
| 12 #if U_HAVE_RBNF | 11 #if U_HAVE_RBNF |
| 13 | 12 |
| 14 #include "unicode/normlzr.h" | 13 #include "unicode/normlzr.h" |
| 15 #include "unicode/tblcoll.h" | 14 #include "unicode/tblcoll.h" |
| 16 #include "unicode/uchar.h" | 15 #include "unicode/uchar.h" |
| 17 #include "unicode/ucol.h" | 16 #include "unicode/ucol.h" |
| 18 #include "unicode/uloc.h" | 17 #include "unicode/uloc.h" |
| (...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 return result; | 866 return result; |
| 868 } | 867 } |
| 869 | 868 |
| 870 UBool | 869 UBool |
| 871 RuleBasedNumberFormat::operator==(const Format& other) const | 870 RuleBasedNumberFormat::operator==(const Format& other) const |
| 872 { | 871 { |
| 873 if (this == &other) { | 872 if (this == &other) { |
| 874 return TRUE; | 873 return TRUE; |
| 875 } | 874 } |
| 876 | 875 |
| 877 if (typeid(*this) == typeid(other)) { | 876 if (CR_TYPEID(*this) == CR_TYPEID(other)) { |
| 878 const RuleBasedNumberFormat& rhs = (const RuleBasedNumberFormat&)other; | 877 const RuleBasedNumberFormat& rhs = (const RuleBasedNumberFormat&)other; |
| 879 if (locale == rhs.locale && | 878 if (locale == rhs.locale && |
| 880 lenient == rhs.lenient && | 879 lenient == rhs.lenient && |
| 881 (localizations == NULL | 880 (localizations == NULL |
| 882 ? rhs.localizations == NULL | 881 ? rhs.localizations == NULL |
| 883 : (rhs.localizations == NULL | 882 : (rhs.localizations == NULL |
| 884 ? FALSE | 883 ? FALSE |
| 885 : *localizations == rhs.localizations))) { | 884 : *localizations == rhs.localizations))) { |
| 886 | 885 |
| 887 NFRuleSet** p = ruleSets; | 886 NFRuleSet** p = ruleSets; |
| (...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1546 if (collator == NULL && lenient) { | 1545 if (collator == NULL && lenient) { |
| 1547 // create a default collator based on the formatter's locale, | 1546 // create a default collator based on the formatter's locale, |
| 1548 // then pull out that collator's rules, append any additional | 1547 // then pull out that collator's rules, append any additional |
| 1549 // rules specified in the description, and create a _new_ | 1548 // rules specified in the description, and create a _new_ |
| 1550 // collator based on the combinaiton of those rules | 1549 // collator based on the combinaiton of those rules |
| 1551 | 1550 |
| 1552 UErrorCode status = U_ZERO_ERROR; | 1551 UErrorCode status = U_ZERO_ERROR; |
| 1553 | 1552 |
| 1554 Collator* temp = Collator::createInstance(locale, status); | 1553 Collator* temp = Collator::createInstance(locale, status); |
| 1555 RuleBasedCollator* newCollator; | 1554 RuleBasedCollator* newCollator; |
| 1556 if (U_SUCCESS(status) && (newCollator = dynamic_cast<RuleBasedCollator*>
(temp)) != NULL) { | 1555 if (U_SUCCESS(status) && (newCollator = CR_DYNAMIC_CAST<RuleBasedCollato
r*>(temp)) != NULL) { |
| 1557 if (lenientParseRules) { | 1556 if (lenientParseRules) { |
| 1558 UnicodeString rules(newCollator->getRules()); | 1557 UnicodeString rules(newCollator->getRules()); |
| 1559 rules.append(*lenientParseRules); | 1558 rules.append(*lenientParseRules); |
| 1560 | 1559 |
| 1561 newCollator = new RuleBasedCollator(rules, status); | 1560 newCollator = new RuleBasedCollator(rules, status); |
| 1562 // Exit if newCollator could not be created. | 1561 // Exit if newCollator could not be created. |
| 1563 if (newCollator == NULL) { | 1562 if (newCollator == NULL) { |
| 1564 return NULL; | 1563 return NULL; |
| 1565 } | 1564 } |
| 1566 } else { | 1565 } else { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1606 delete temp; | 1605 delete temp; |
| 1607 } | 1606 } |
| 1608 } | 1607 } |
| 1609 return decimalFormatSymbols; | 1608 return decimalFormatSymbols; |
| 1610 } | 1609 } |
| 1611 | 1610 |
| 1612 U_NAMESPACE_END | 1611 U_NAMESPACE_END |
| 1613 | 1612 |
| 1614 /* U_HAVE_RBNF */ | 1613 /* U_HAVE_RBNF */ |
| 1615 #endif | 1614 #endif |
| OLD | NEW |