ICU-22421 Remove two unused internal methods in gregorian cal

Remove pinDayOfMonth() and yearLength(int32_t year)
from GregorianCalendar.

These two methods are
1. Unused by any code inside ICU, not in source/{common,i18n,test}.
2. Marked as @internal in the header.
3. Wrap inside #ifndef U_HIDE_INTERNAL_API block in the header
4. In "protected:" section.
5. No ICU4J counterpart.

The yearLength(int32_t year) dup the functionality as
handleGetYearLength of the same class and that one is the correct one to
be keep and used..
There is another yearLength() w/o the year as parameter should NOT be
removed and still needed internally.
This commit is contained in:
Frank Tang 2023-06-22 10:38:29 -07:00 committed by Frank Yung-Fong Tang
parent e83b0715a1
commit 26bd70e301
2 changed files with 0 additions and 42 deletions

View file

@ -610,14 +610,6 @@ GregorianCalendar::monthLength(int32_t month, int32_t year) const
// -------------------------------------
int32_t
GregorianCalendar::yearLength(int32_t year) const
{
return isLeapYear(year) ? 366 : 365;
}
// -------------------------------------
int32_t
GregorianCalendar::yearLength() const
{
@ -626,24 +618,6 @@ GregorianCalendar::yearLength() const
// -------------------------------------
/**
* After adjustments such as add(MONTH), add(YEAR), we don't want the
* month to jump around. E.g., we don't want Jan 31 + 1 month to go to Mar
* 3, we want it to go to Feb 28. Adjustments which might run into this
* problem call this method to retain the proper month.
*/
void
GregorianCalendar::pinDayOfMonth()
{
int32_t monthLen = monthLength(internalGetMonth());
int32_t dom = internalGet(UCAL_DATE);
if(dom > monthLen)
set(UCAL_DATE, monthLen);
}
// -------------------------------------
UBool
GregorianCalendar::validateFields() const
{

View file

@ -536,14 +536,6 @@ public:
virtual int32_t monthLength(int32_t month, int32_t year) const;
#ifndef U_HIDE_INTERNAL_API
/**
* return the length of the given year.
* @param year the given year.
* @return the length of the given year.
* @internal
*/
int32_t yearLength(int32_t year) const;
/**
* return the length of the year field.
* @return the length of the year field
@ -551,14 +543,6 @@ public:
*/
int32_t yearLength(void) const;
/**
* After adjustments such as add(MONTH), add(YEAR), we don't want the
* month to jump around. E.g., we don't want Jan 31 + 1 month to go to Mar
* 3, we want it to go to Feb 28. Adjustments which might run into this
* problem call this method to retain the proper month.
* @internal
*/
void pinDayOfMonth(void);
#endif /* U_HIDE_INTERNAL_API */
/**