| OLD | NEW |
| 1 /* | 1 /* |
| 2 ****************************************************************************** | 2 ****************************************************************************** |
| 3 * Copyright (C) 2014, International Business Machines Corporation and | 3 * Copyright (C) 2014-2015, International Business Machines Corporation and |
| 4 * others. All Rights Reserved. | 4 * others. All Rights Reserved. |
| 5 ****************************************************************************** | 5 ****************************************************************************** |
| 6 * | 6 * |
| 7 * File RELDATEFMT.CPP
| 7 * File reldatefmt.cpp |
| 8 ****************************************************************************** | 8 ****************************************************************************** |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include "unicode/reldatefmt.h" | 11 #include "unicode/reldatefmt.h" |
| 12 | 12 |
| 13 #if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION | 13 #if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION |
| 14 | 14 |
| 15 #include "unicode/localpointer.h" | 15 #include "unicode/localpointer.h" |
| 16 #include "quantityformatter.h" | 16 #include "quantityformatter.h" |
| 17 #include "unicode/plurrule.h" | 17 #include "unicode/plurrule.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 for (int32_t i = 0; i < size; ++i) { | 179 for (int32_t i = 0; i < size; ++i) { |
| 180 LocalUResourceBundlePointer pluralBundle( | 180 LocalUResourceBundlePointer pluralBundle( |
| 181 ures_getByIndex(resource, i, NULL, &status)); | 181 ures_getByIndex(resource, i, NULL, &status)); |
| 182 if (U_FAILURE(status)) { | 182 if (U_FAILURE(status)) { |
| 183 return; | 183 return; |
| 184 } | 184 } |
| 185 UnicodeString rawPattern; | 185 UnicodeString rawPattern; |
| 186 if (!getString(pluralBundle.getAlias(), rawPattern, status)) { | 186 if (!getString(pluralBundle.getAlias(), rawPattern, status)) { |
| 187 return; | 187 return; |
| 188 } | 188 } |
| 189 if (!formatter.add( | 189 if (!formatter.addIfAbsent( |
| 190 ures_getKey(pluralBundle.getAlias()), | 190 ures_getKey(pluralBundle.getAlias()), |
| 191 rawPattern, | 191 rawPattern, |
| 192 status)) { | 192 status)) { |
| 193 return; | 193 return; |
| 194 } | 194 } |
| 195 } | 195 } |
| 196 } | 196 } |
| 197 | 197 |
| 198 static void initRelativeUnit( | 198 static void initRelativeUnit( |
| 199 const UResourceBundle *resource, | 199 const UResourceBundle *resource, |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 bi.orphan(); | 892 bi.orphan(); |
| 893 SharedObject::copyPtr(shared, fOptBreakIterator); | 893 SharedObject::copyPtr(shared, fOptBreakIterator); |
| 894 } | 894 } |
| 895 } | 895 } |
| 896 | 896 |
| 897 | 897 |
| 898 U_NAMESPACE_END | 898 U_NAMESPACE_END |
| 899 | 899 |
| 900 #endif /* !UCONFIG_NO_FORMATTING */ | 900 #endif /* !UCONFIG_NO_FORMATTING */ |
| 901 | 901 |
| OLD | NEW |