diff options
-rw-r--r-- | i18npool/inc/calendar_hijri.hxx | 18 | ||||
-rw-r--r-- | i18npool/source/calendar/calendar_hijri.cxx | 19 |
2 files changed, 6 insertions, 31 deletions
diff --git a/i18npool/inc/calendar_hijri.hxx b/i18npool/inc/calendar_hijri.hxx index c11a507bb420..707c877710a0 100644 --- a/i18npool/inc/calendar_hijri.hxx +++ b/i18npool/inc/calendar_hijri.hxx @@ -37,24 +37,6 @@ private: void mapToGregorian() override; void mapFromGregorian() override; - // Synodic Period (mean time between 2 successive new moon: 29d, 12 hr, 44min, 3sec - static const double SynPeriod; - - static const double SynMonth; // Solar days in a year/SynPeriod - - // Julian day on Jan 1, 1900 - static const double jd1900; - - // Reference point: September 1984 25d 3h 10m UT. == 1405 Hijri == 1048 Synodial month from 1900 - static const sal_Int32 SynRef; - static const sal_Int32 GregRef; - - // Period between 1.30pm - 6:30pm - static const double EveningPeriod; - - // "Leap" years - static const sal_Int32 LeapYear[]; - private: static double NewMoon(sal_Int32 n); static void getHijri(sal_Int32 *day, sal_Int32 *month, sal_Int32 *year); diff --git a/i18npool/source/calendar/calendar_hijri.cxx b/i18npool/source/calendar/calendar_hijri.cxx index 2944f455bb37..3d24150f8bf8 100644 --- a/i18npool/source/calendar/calendar_hijri.cxx +++ b/i18npool/source/calendar/calendar_hijri.cxx @@ -30,26 +30,17 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::i18n; -#define GREGORIAN_CROSSOVER 2299161 - namespace i18npool { // Synodic Period (mean time between 2 successive new moon: 29d, 12 hr, 44min, 3sec -const double Calendar_hijri::SynPeriod = 29.53058868; -const double Calendar_hijri::SynMonth = 365.25/29.53058868; // Solar days in a year/SynPeriod +constexpr double SynPeriod = 29.53058868; // Julian day on Jan 1, 1900 -const double Calendar_hijri::jd1900 = 2415020.75933; +constexpr double jd1900 = 2415020.75933; // Reference point: March 26, 2001 == 1422 Hijri == 1252 Synodial month from 1900 -const sal_Int32 Calendar_hijri::SynRef = 1252; -const sal_Int32 Calendar_hijri::GregRef = 1422; - -const double Calendar_hijri::EveningPeriod = 6.0; - -const sal_Int32 Calendar_hijri::LeapYear[] = { - 2, 5, 7, 10, 13, 16, 18, 21, 24, 26, 29 -}; +constexpr sal_Int32 SynRef = 1252; +constexpr sal_Int32 GregRef = 1422; Calendar_hijri::Calendar_hijri() { @@ -249,6 +240,8 @@ Calendar_hijri::getGregorianDay(sal_Int32 lJulianDay, sal_Int32 *pnDay, sal_Int3 /* working variables */ tools::Long lFactorA, lFactorB, lFactorC, lFactorD, lFactorE; + constexpr sal_Int32 GREGORIAN_CROSSOVER = 2299161; + /* test whether to adjust for the Gregorian calendar crossover */ if (lJulianDay >= GREGORIAN_CROSSOVER) { /* calculate a small adjustment */ |