| OLD | NEW |
| 1 /* | 1 /* |
| 2 ****************************************************************************** | 2 ****************************************************************************** |
| 3 * Copyright (C) 1996-2010, International Business Machines Corporation and | 3 * Copyright (C) 1996-2010, International Business Machines Corporation and |
| 4 * others. All Rights Reserved. | 4 * others. All Rights Reserved. |
| 5 ****************************************************************************** | 5 ****************************************************************************** |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * File coll.cpp | 9 * File coll.cpp |
| 10 * | 10 * |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 | 229 |
| 230 UCollator* | 230 UCollator* |
| 231 Collator::createUCollator(const char *loc, | 231 Collator::createUCollator(const char *loc, |
| 232 UErrorCode *status) | 232 UErrorCode *status) |
| 233 { | 233 { |
| 234 UCollator *result = 0; | 234 UCollator *result = 0; |
| 235 if (status && U_SUCCESS(*status) && hasService()) { | 235 if (status && U_SUCCESS(*status) && hasService()) { |
| 236 Locale desiredLocale(loc); | 236 Locale desiredLocale(loc); |
| 237 Collator *col = (Collator*)gService->get(desiredLocale, *status); | 237 Collator *col = (Collator*)gService->get(desiredLocale, *status); |
| 238 RuleBasedCollator *rbc; | 238 RuleBasedCollator *rbc; |
| 239 if (col && (rbc = dynamic_cast<RuleBasedCollator *>(col))) { | 239 if (col && (rbc = CR_DYNAMIC_CAST<RuleBasedCollator *>(col))) { |
| 240 if (!rbc->dataIsOwned) { | 240 if (!rbc->dataIsOwned) { |
| 241 result = ucol_safeClone(rbc->ucollator, NULL, NULL, status); | 241 result = ucol_safeClone(rbc->ucollator, NULL, NULL, status); |
| 242 } else { | 242 } else { |
| 243 result = rbc->ucollator; | 243 result = rbc->ucollator; |
| 244 rbc->ucollator = NULL; // to prevent free on delete | 244 rbc->ucollator = NULL; // to prevent free on delete |
| 245 } | 245 } |
| 246 } | 246 } |
| 247 delete col; | 247 delete col; |
| 248 } | 248 } |
| 249 return result; | 249 return result; |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 /* This is useless information */ | 857 /* This is useless information */ |
| 858 /*const UVersionInfo Collator::fVersion = {1, 1, 0, 0};*/ | 858 /*const UVersionInfo Collator::fVersion = {1, 1, 0, 0};*/ |
| 859 | 859 |
| 860 // ------------------------------------- | 860 // ------------------------------------- |
| 861 | 861 |
| 862 U_NAMESPACE_END | 862 U_NAMESPACE_END |
| 863 | 863 |
| 864 #endif /* #if !UCONFIG_NO_COLLATION */ | 864 #endif /* #if !UCONFIG_NO_COLLATION */ |
| 865 | 865 |
| 866 /* eof */ | 866 /* eof */ |
| OLD | NEW |