diff --git a/icu4c/source/i18n/buddhcal.cpp b/icu4c/source/i18n/buddhcal.cpp index 7723ade105d2..c99b97e26713 100644 --- a/icu4c/source/i18n/buddhcal.cpp +++ b/icu4c/source/i18n/buddhcal.cpp @@ -36,7 +36,6 @@ static const int32_t kGregorianEpoch = 1970; // used as the default value of BuddhistCalendar::BuddhistCalendar(const Locale& aLocale, UErrorCode& success) : GregorianCalendar(aLocale, success) { - setTimeInMillis(getNow(), success); // Call this again now that the vtable is set up properly. } BuddhistCalendar::~BuddhistCalendar() @@ -48,12 +47,6 @@ BuddhistCalendar::BuddhistCalendar(const BuddhistCalendar& source) { } -BuddhistCalendar& BuddhistCalendar::operator= ( const BuddhistCalendar& right) -{ - GregorianCalendar::operator=(right); - return *this; -} - BuddhistCalendar* BuddhistCalendar::clone() const { return new BuddhistCalendar(*this); diff --git a/icu4c/source/i18n/buddhcal.h b/icu4c/source/i18n/buddhcal.h index 1fa8395b35b2..196b21311fda 100644 --- a/icu4c/source/i18n/buddhcal.h +++ b/icu4c/source/i18n/buddhcal.h @@ -82,13 +82,6 @@ class BuddhistCalendar : public GregorianCalendar { */ BuddhistCalendar(const BuddhistCalendar& source); - /** - * Default assignment operator - * @param right the object to be copied. - * @internal - */ - BuddhistCalendar& operator=(const BuddhistCalendar& right); - /** * Create and return a polymorphic copy of this calendar. * @return return a polymorphic copy of this calendar. diff --git a/icu4c/source/i18n/cecal.cpp b/icu4c/source/i18n/cecal.cpp index 7771c32efb30..33d32adab731 100644 --- a/icu4c/source/i18n/cecal.cpp +++ b/icu4c/source/i18n/cecal.cpp @@ -53,7 +53,6 @@ static const int32_t LIMITS[UCAL_FIELD_COUNT][4] = { CECalendar::CECalendar(const Locale& aLocale, UErrorCode& success) : Calendar(TimeZone::forLocaleOrDefault(aLocale), aLocale, success) { - setTimeInMillis(getNow(), success); } CECalendar::CECalendar (const CECalendar& other) @@ -65,13 +64,6 @@ CECalendar::~CECalendar() { } -CECalendar& -CECalendar::operator=(const CECalendar& right) -{ - Calendar::operator=(right); - return *this; -} - //------------------------------------------------------------------------- // Calendar framework //------------------------------------------------------------------------- diff --git a/icu4c/source/i18n/cecal.h b/icu4c/source/i18n/cecal.h index 9c3332f3b84a..e6514e18f857 100644 --- a/icu4c/source/i18n/cecal.h +++ b/icu4c/source/i18n/cecal.h @@ -82,13 +82,6 @@ class U_I18N_API CECalendar : public Calendar { */ virtual ~CECalendar(); - /** - * Default assignment operator - * @param right Calendar object to be copied - * @internal - */ - CECalendar& operator=(const CECalendar& right); - protected: //------------------------------------------------------------------------- // Calendar framework diff --git a/icu4c/source/i18n/chnsecal.cpp b/icu4c/source/i18n/chnsecal.cpp index 63dcba994025..70b37f19073c 100644 --- a/icu4c/source/i18n/chnsecal.cpp +++ b/icu4c/source/i18n/chnsecal.cpp @@ -130,7 +130,6 @@ ChineseCalendar::ChineseCalendar(const Locale& aLocale, UErrorCode& success) : Calendar(TimeZone::forLocaleOrDefault(aLocale), aLocale, success), hasLeapMonthBetweenWinterSolstices(false) { - setTimeInMillis(getNow(), success); // Call this again now that the vtable is set up properly. } ChineseCalendar::ChineseCalendar(const ChineseCalendar& other) : Calendar(other) { diff --git a/icu4c/source/i18n/gregocal.cpp b/icu4c/source/i18n/gregocal.cpp index 0c09faf3f2ff..e012317c3746 100644 --- a/icu4c/source/i18n/gregocal.cpp +++ b/icu4c/source/i18n/gregocal.cpp @@ -147,6 +147,7 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(GregorianCalendar) // in Java, -12219292800000L //const UDate GregorianCalendar::kPapalCutover = -12219292800000L; static const uint32_t kCutoverJulianDay = 2299161; +static const int32_t kDefaultCutoverYear = 1582; static const UDate kPapalCutover = (2299161.0 - kEpochStartAsJulianDay) * U_MILLIS_PER_DAY; //static const UDate kPapalCutoverJulian = (2299161.0 - kEpochStartAsJulianDay); @@ -155,7 +156,7 @@ static const UDate kPapalCutover = (2299161.0 - kEpochStartAsJulianDay) * U_MILL GregorianCalendar::GregorianCalendar(UErrorCode& status) : Calendar(status), fGregorianCutover(kPapalCutover), -fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582), +fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(kDefaultCutoverYear), fIsGregorian(true), fInvertGregorian(false) { setTimeInMillis(getNow(), status); @@ -164,34 +165,22 @@ fIsGregorian(true), fInvertGregorian(false) // ------------------------------------- GregorianCalendar::GregorianCalendar(TimeZone* zone, UErrorCode& status) -: Calendar(zone, Locale::getDefault(), status), -fGregorianCutover(kPapalCutover), -fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582), -fIsGregorian(true), fInvertGregorian(false) +: GregorianCalendar(zone, Locale::getDefault(), status) { - setTimeInMillis(getNow(), status); } // ------------------------------------- GregorianCalendar::GregorianCalendar(const TimeZone& zone, UErrorCode& status) -: Calendar(zone, Locale::getDefault(), status), -fGregorianCutover(kPapalCutover), -fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582), -fIsGregorian(true), fInvertGregorian(false) +: GregorianCalendar(zone, Locale::getDefault(), status) { - setTimeInMillis(getNow(), status); } // ------------------------------------- GregorianCalendar::GregorianCalendar(const Locale& aLocale, UErrorCode& status) -: Calendar(TimeZone::forLocaleOrDefault(aLocale), aLocale, status), -fGregorianCutover(kPapalCutover), -fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582), -fIsGregorian(true), fInvertGregorian(false) +: GregorianCalendar(TimeZone::forLocaleOrDefault(aLocale), aLocale, status) { - setTimeInMillis(getNow(), status); } // ------------------------------------- @@ -200,7 +189,7 @@ GregorianCalendar::GregorianCalendar(TimeZone* zone, const Locale& aLocale, UErrorCode& status) : Calendar(zone, aLocale, status), fGregorianCutover(kPapalCutover), - fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582), + fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(kDefaultCutoverYear), fIsGregorian(true), fInvertGregorian(false) { setTimeInMillis(getNow(), status); @@ -212,7 +201,7 @@ GregorianCalendar::GregorianCalendar(const TimeZone& zone, const Locale& aLocale UErrorCode& status) : Calendar(zone, aLocale, status), fGregorianCutover(kPapalCutover), - fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582), + fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(kDefaultCutoverYear), fIsGregorian(true), fInvertGregorian(false) { setTimeInMillis(getNow(), status); @@ -224,7 +213,7 @@ GregorianCalendar::GregorianCalendar(int32_t year, int32_t month, int32_t date, UErrorCode& status) : Calendar(TimeZone::createDefault(), Locale::getDefault(), status), fGregorianCutover(kPapalCutover), - fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582), + fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(kDefaultCutoverYear), fIsGregorian(true), fInvertGregorian(false) { set(UCAL_ERA, AD); @@ -237,15 +226,8 @@ GregorianCalendar::GregorianCalendar(int32_t year, int32_t month, int32_t date, GregorianCalendar::GregorianCalendar(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, UErrorCode& status) - : Calendar(TimeZone::createDefault(), Locale::getDefault(), status), - fGregorianCutover(kPapalCutover), - fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582), - fIsGregorian(true), fInvertGregorian(false) + : GregorianCalendar(year, month, date, status) { - set(UCAL_ERA, AD); - set(UCAL_YEAR, year); - set(UCAL_MONTH, month); - set(UCAL_DATE, date); set(UCAL_HOUR_OF_DAY, hour); set(UCAL_MINUTE, minute); } @@ -255,17 +237,8 @@ GregorianCalendar::GregorianCalendar(int32_t year, int32_t month, int32_t date, GregorianCalendar::GregorianCalendar(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, int32_t second, UErrorCode& status) - : Calendar(TimeZone::createDefault(), Locale::getDefault(), status), - fGregorianCutover(kPapalCutover), - fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582), - fIsGregorian(true), fInvertGregorian(false) + : GregorianCalendar(year, month, date, hour, minute, status) { - set(UCAL_ERA, AD); - set(UCAL_YEAR, year); - set(UCAL_MONTH, month); - set(UCAL_DATE, date); - set(UCAL_HOUR_OF_DAY, hour); - set(UCAL_MINUTE, minute); set(UCAL_SECOND, second); } diff --git a/icu4c/source/i18n/hebrwcal.cpp b/icu4c/source/i18n/hebrwcal.cpp index ef70a48f2353..1f8a4bc341c0 100644 --- a/icu4c/source/i18n/hebrwcal.cpp +++ b/icu4c/source/i18n/hebrwcal.cpp @@ -164,7 +164,6 @@ HebrewCalendar::HebrewCalendar(const Locale& aLocale, UErrorCode& success) : Calendar(TimeZone::forLocaleOrDefault(aLocale), aLocale, success) { - setTimeInMillis(getNow(), success); // Call this again now that the vtable is set up properly. } diff --git a/icu4c/source/i18n/indiancal.cpp b/icu4c/source/i18n/indiancal.cpp index b1fd39b9927e..ca839da4d553 100644 --- a/icu4c/source/i18n/indiancal.cpp +++ b/icu4c/source/i18n/indiancal.cpp @@ -41,7 +41,6 @@ IndianCalendar* IndianCalendar::clone() const { IndianCalendar::IndianCalendar(const Locale& aLocale, UErrorCode& success) : Calendar(TimeZone::forLocaleOrDefault(aLocale), aLocale, success) { - setTimeInMillis(getNow(), success); // Call this again now that the vtable is set up properly. } IndianCalendar::IndianCalendar(const IndianCalendar& other) : Calendar(other) { diff --git a/icu4c/source/i18n/islamcal.cpp b/icu4c/source/i18n/islamcal.cpp index dfeac36a6651..727141fa2912 100644 --- a/icu4c/source/i18n/islamcal.cpp +++ b/icu4c/source/i18n/islamcal.cpp @@ -202,7 +202,6 @@ IslamicCalendar* IslamicCalendar::clone() const { IslamicCalendar::IslamicCalendar(const Locale& aLocale, UErrorCode& success) : Calendar(TimeZone::forLocaleOrDefault(aLocale), aLocale, success) { - setTimeInMillis(getNow(), success); // Call this again now that the vtable is set up properly. } IslamicCalendar::~IslamicCalendar() diff --git a/icu4c/source/i18n/japancal.cpp b/icu4c/source/i18n/japancal.cpp index c0dd9fad0dc0..b389b4530b29 100644 --- a/icu4c/source/i18n/japancal.cpp +++ b/icu4c/source/i18n/japancal.cpp @@ -115,7 +115,6 @@ JapaneseCalendar::JapaneseCalendar(const Locale& aLocale, UErrorCode& success) : GregorianCalendar(aLocale, success) { init(success); - setTimeInMillis(getNow(), success); // Call this again now that the vtable is set up properly. } JapaneseCalendar::~JapaneseCalendar() @@ -130,12 +129,6 @@ JapaneseCalendar::JapaneseCalendar(const JapaneseCalendar& source) U_ASSERT(U_SUCCESS(status)); } -JapaneseCalendar& JapaneseCalendar::operator= ( const JapaneseCalendar& right) -{ - GregorianCalendar::operator=(right); - return *this; -} - JapaneseCalendar* JapaneseCalendar::clone() const { return new JapaneseCalendar(*this); diff --git a/icu4c/source/i18n/japancal.h b/icu4c/source/i18n/japancal.h index 627b12750b98..3271cbfb794a 100644 --- a/icu4c/source/i18n/japancal.h +++ b/icu4c/source/i18n/japancal.h @@ -104,13 +104,6 @@ class JapaneseCalendar : public GregorianCalendar { */ JapaneseCalendar(const JapaneseCalendar& source); - /** - * Default assignment operator - * @param right the object to be copied. - * @internal - */ - JapaneseCalendar& operator=(const JapaneseCalendar& right); - /** * Create and return a polymorphic copy of this calendar. * @return return a polymorphic copy of this calendar. diff --git a/icu4c/source/i18n/persncal.cpp b/icu4c/source/i18n/persncal.cpp index 4ad6bc3a59f5..6675cf414c29 100644 --- a/icu4c/source/i18n/persncal.cpp +++ b/icu4c/source/i18n/persncal.cpp @@ -125,7 +125,6 @@ PersianCalendar* PersianCalendar::clone() const { PersianCalendar::PersianCalendar(const Locale& aLocale, UErrorCode& success) : Calendar(TimeZone::forLocaleOrDefault(aLocale), aLocale, success) { - setTimeInMillis(getNow(), success); // Call this again now that the vtable is set up properly. } PersianCalendar::PersianCalendar(const PersianCalendar& other) : Calendar(other) { diff --git a/icu4c/source/i18n/taiwncal.cpp b/icu4c/source/i18n/taiwncal.cpp index e6ffd71ba308..1f9480310022 100644 --- a/icu4c/source/i18n/taiwncal.cpp +++ b/icu4c/source/i18n/taiwncal.cpp @@ -36,7 +36,6 @@ static const int32_t kGregorianEpoch = 1970; TaiwanCalendar::TaiwanCalendar(const Locale& aLocale, UErrorCode& success) : GregorianCalendar(aLocale, success) { - setTimeInMillis(getNow(), success); // Call this again now that the vtable is set up properly. } TaiwanCalendar::~TaiwanCalendar() @@ -48,12 +47,6 @@ TaiwanCalendar::TaiwanCalendar(const TaiwanCalendar& source) { } -TaiwanCalendar& TaiwanCalendar::operator= ( const TaiwanCalendar& right) -{ - GregorianCalendar::operator=(right); - return *this; -} - TaiwanCalendar* TaiwanCalendar::clone() const { return new TaiwanCalendar(*this); diff --git a/icu4c/source/i18n/taiwncal.h b/icu4c/source/i18n/taiwncal.h index a8fa3d1829ed..d12ab1c4a2ee 100644 --- a/icu4c/source/i18n/taiwncal.h +++ b/icu4c/source/i18n/taiwncal.h @@ -79,13 +79,6 @@ class TaiwanCalendar : public GregorianCalendar { */ TaiwanCalendar(const TaiwanCalendar& source); - /** - * Default assignment operator - * @param right the object to be copied. - * @internal - */ - TaiwanCalendar& operator=(const TaiwanCalendar& right); - /** * Create and return a polymorphic copy of this calendar. * @return return a polymorphic copy of this calendar.