mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-16 18:25:57 +00:00
ICU-22991 Remove protected direct access to fStamp
This commit is contained in:
parent
4ff5d6a070
commit
81d047524c
2 changed files with 5 additions and 7 deletions
|
@ -219,7 +219,9 @@ int32_t ChineseCalendar::handleGetExtendedYear(UErrorCode& status) {
|
|||
}
|
||||
|
||||
int32_t year;
|
||||
if (newestStamp(UCAL_ERA, UCAL_YEAR, kUnset) <= fStamp[UCAL_EXTENDED_YEAR]) {
|
||||
// if UCAL_EXTENDED_YEAR is not older than UCAL_ERA nor UCAL_YEAR
|
||||
if (newerField(UCAL_EXTENDED_YEAR, newerField(UCAL_ERA, UCAL_YEAR)) ==
|
||||
UCAL_EXTENDED_YEAR) {
|
||||
year = internalGet(UCAL_EXTENDED_YEAR, 1); // Default to year 1
|
||||
} else {
|
||||
// adjust to the instance specific epoch
|
||||
|
|
|
@ -1186,14 +1186,10 @@ int32_t GregorianCalendar::handleGetExtendedYear(UErrorCode& status) {
|
|||
int32_t year = kEpochYear;
|
||||
|
||||
// year field to use
|
||||
int32_t yearField = UCAL_EXTENDED_YEAR;
|
||||
|
||||
// There are three separate fields which could be used to
|
||||
// derive the proper year. Use the one most recently set.
|
||||
if (fStamp[yearField] < fStamp[UCAL_YEAR])
|
||||
yearField = UCAL_YEAR;
|
||||
if (fStamp[yearField] < fStamp[UCAL_YEAR_WOY])
|
||||
yearField = UCAL_YEAR_WOY;
|
||||
UCalendarDateFields yearField = newerField(
|
||||
newerField(UCAL_EXTENDED_YEAR, UCAL_YEAR), UCAL_YEAR_WOY);
|
||||
|
||||
// based on the "best" year field, get the year
|
||||
switch(yearField) {
|
||||
|
|
Loading…
Add table
Reference in a new issue