]> granicus.if.org Git - icu/commitdiff
ICU-21491 Remove internal usage of @internal BasicTimeZone::getOffsetFromLocal
authorFrank Tang <ftang@chromium.org>
Wed, 16 Jun 2021 21:53:22 +0000 (21:53 +0000)
committerFrank Yung-Fong Tang <ftang@google.com>
Thu, 24 Jun 2021 03:39:45 +0000 (20:39 -0700)
See #1681

icu4c/source/i18n/calendar.cpp
icu4c/source/i18n/smpdtfmt.cpp

index a09ab1508a2103a7a25fee1f934ee2d5222686c8..9b1ed9fac21f6dd3e4640ffdf35ce704d48c9636 100644 (file)
@@ -3163,8 +3163,8 @@ int32_t Calendar::computeZoneOffset(double millis, double millisInDay, UErrorCod
     UDate wall = millis + millisInDay;
     BasicTimeZone* btz = getBasicTimeZone();
     if (btz) {
-        int duplicatedTimeOpt = (fRepeatedWallTime == UCAL_WALLTIME_FIRST) ? BasicTimeZone::kFormer : BasicTimeZone::kLatter;
-        int nonExistingTimeOpt = (fSkippedWallTime == UCAL_WALLTIME_FIRST) ? BasicTimeZone::kLatter : BasicTimeZone::kFormer;
+        UTimeZoneLocalOption duplicatedTimeOpt = (fRepeatedWallTime == UCAL_WALLTIME_FIRST) ? UCAL_TZ_LOCAL_FORMER : UCAL_TZ_LOCAL_LATTER;
+        UTimeZoneLocalOption nonExistingTimeOpt = (fSkippedWallTime == UCAL_WALLTIME_FIRST) ? UCAL_TZ_LOCAL_LATTER : UCAL_TZ_LOCAL_FORMER;
         btz->getOffsetFromLocal(wall, nonExistingTimeOpt, duplicatedTimeOpt, rawOffset, dstOffset, ec);
     } else {
         const TimeZone& tz = getTimeZone();
index 291a87b43e4040774148fef6ff2b21d710493579..bf706ff0a57ed0f947f4e9c549d965352a2a1ac7 100644 (file)
@@ -2580,10 +2580,10 @@ SimpleDateFormat::parse(const UnicodeString& text, Calendar& cal, ParsePosition&
             if (btz != NULL) {
                 if (tzTimeType == UTZFMT_TIME_TYPE_STANDARD) {
                     btz->getOffsetFromLocal(localMillis,
-                        BasicTimeZone::kStandard, BasicTimeZone::kStandard, raw, dst, status);
+                        UCAL_TZ_LOCAL_STANDARD_FORMER, UCAL_TZ_LOCAL_STANDARD_LATTER, raw, dst, status);
                 } else {
                     btz->getOffsetFromLocal(localMillis,
-                        BasicTimeZone::kDaylight, BasicTimeZone::kDaylight, raw, dst, status);
+                        UCAL_TZ_LOCAL_DAYLIGHT_FORMER, UCAL_TZ_LOCAL_DAYLIGHT_LATTER, raw, dst, status);
                 }
             } else {
                 // No good way to resolve ambiguous time at transition,