From: Frank Tang Date: Wed, 16 Jun 2021 21:53:22 +0000 (+0000) Subject: ICU-21491 Remove internal usage of @internal BasicTimeZone::getOffsetFromLocal X-Git-Tag: cldr/2021-08-11~27 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e4fdaf45fa5f6ff0ad9d221b432a65d35762dda;p=icu ICU-21491 Remove internal usage of @internal BasicTimeZone::getOffsetFromLocal See #1681 --- diff --git a/icu4c/source/i18n/calendar.cpp b/icu4c/source/i18n/calendar.cpp index a09ab1508a2..9b1ed9fac21 100644 --- a/icu4c/source/i18n/calendar.cpp +++ b/icu4c/source/i18n/calendar.cpp @@ -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(); diff --git a/icu4c/source/i18n/smpdtfmt.cpp b/icu4c/source/i18n/smpdtfmt.cpp index 291a87b43e4..bf706ff0a57 100644 --- a/icu4c/source/i18n/smpdtfmt.cpp +++ b/icu4c/source/i18n/smpdtfmt.cpp @@ -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,