| 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 | 7 |
| 8 #include "unicode/utypes.h" | 8 #include "unicode/utypes.h" |
| 9 | 9 |
| 10 #if !UCONFIG_NO_FORMATTING | 10 #if !UCONFIG_NO_FORMATTING |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 } | 388 } |
| 389 } | 389 } |
| 390 if (i >= ruleCount) { | 390 if (i >= ruleCount) { |
| 391 // This case should never happen | 391 // This case should never happen |
| 392 status = U_INVALID_STATE_ERROR; | 392 status = U_INVALID_STATE_ERROR; |
| 393 goto error; | 393 goto error; |
| 394 } | 394 } |
| 395 if (done[i]) { | 395 if (done[i]) { |
| 396 continue; | 396 continue; |
| 397 } | 397 } |
| 398 const TimeArrayTimeZoneRule *tar = dynamic_cast<const TimeArrayTimeZoneR
ule *>(toRule); | 398 const TimeArrayTimeZoneRule *tar = CR_DYNAMIC_CAST<const TimeArrayTimeZo
neRule *>(toRule); |
| 399 const AnnualTimeZoneRule *ar; | 399 const AnnualTimeZoneRule *ar; |
| 400 if (tar != NULL) { | 400 if (tar != NULL) { |
| 401 // Get the previous raw offset and DST savings before the very first
start time | 401 // Get the previous raw offset and DST savings before the very first
start time |
| 402 TimeZoneTransition tzt0; | 402 TimeZoneTransition tzt0; |
| 403 t = start; | 403 t = start; |
| 404 while (TRUE) { | 404 while (TRUE) { |
| 405 avail = getNextTransition(t, FALSE, tzt0); | 405 avail = getNextTransition(t, FALSE, tzt0); |
| 406 if (!avail) { | 406 if (!avail) { |
| 407 break; | 407 break; |
| 408 } | 408 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 TimeArrayTimeZoneRule *newTar = new TimeArrayTimeZoneRul
e(name, | 459 TimeArrayTimeZoneRule *newTar = new TimeArrayTimeZoneRul
e(name, |
| 460 tar->getRawOffset(), tar->getDSTSavings(), newTimes,
asize, timeType); | 460 tar->getRawOffset(), tar->getDSTSavings(), newTimes,
asize, timeType); |
| 461 uprv_free(newTimes); | 461 uprv_free(newTimes); |
| 462 filteredRules->addElement(newTar, status); | 462 filteredRules->addElement(newTar, status); |
| 463 if (U_FAILURE(status)) { | 463 if (U_FAILURE(status)) { |
| 464 goto error; | 464 goto error; |
| 465 } | 465 } |
| 466 } | 466 } |
| 467 } | 467 } |
| 468 } | 468 } |
| 469 } else if ((ar = dynamic_cast<const AnnualTimeZoneRule *>(toRule)) != NU
LL) { | 469 } else if ((ar = CR_DYNAMIC_CAST<const AnnualTimeZoneRule *>(toRule)) !=
NULL) { |
| 470 ar->getFirstStart(tzt.getFrom()->getRawOffset(), tzt.getFrom()->getD
STSavings(), firstStart); | 470 ar->getFirstStart(tzt.getFrom()->getRawOffset(), tzt.getFrom()->getD
STSavings(), firstStart); |
| 471 if (firstStart == tzt.getTime()) { | 471 if (firstStart == tzt.getTime()) { |
| 472 // Just add the rule as is | 472 // Just add the rule as is |
| 473 filteredRules->addElement(ar->clone(), status); | 473 filteredRules->addElement(ar->clone(), status); |
| 474 if (U_FAILURE(status)) { | 474 if (U_FAILURE(status)) { |
| 475 goto error; | 475 goto error; |
| 476 } | 476 } |
| 477 } else { | 477 } else { |
| 478 // Calculate the transition year | 478 // Calculate the transition year |
| 479 int32_t year, month, dom, dow, doy, mid; | 479 int32_t year, month, dom, dow, doy, mid; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 return; | 551 return; |
| 552 } | 552 } |
| 553 status = U_UNSUPPORTED_ERROR; | 553 status = U_UNSUPPORTED_ERROR; |
| 554 } | 554 } |
| 555 | 555 |
| 556 U_NAMESPACE_END | 556 U_NAMESPACE_END |
| 557 | 557 |
| 558 #endif /* #if !UCONFIG_NO_FORMATTING */ | 558 #endif /* #if !UCONFIG_NO_FORMATTING */ |
| 559 | 559 |
| 560 //eof | 560 //eof |
| OLD | NEW |