39constexpr double jd1900 = 2415020.75933;
47 cCalendar =
"com.sun.star.i18n.Calendar_hijri";
50#define FIELDS ((1 << CalendarFieldIndex::ERA) | (1 << CalendarFieldIndex::YEAR) | (1 << CalendarFieldIndex::MONTH) | (1 << CalendarFieldIndex::DAY_OF_MONTH))
58 sal_Int32
day =
static_cast<sal_Int32
>(
fieldSetValue[CalendarFieldIndex::DAY_OF_MONTH]);
59 sal_Int32
month =
static_cast<sal_Int32
>(
fieldSetValue[CalendarFieldIndex::MONTH]) + 1;
68 fieldSetValue[CalendarFieldIndex::DAY_OF_MONTH] =
static_cast<sal_Int16
>(
day);
78 day =
static_cast<sal_Int32
>(
fieldValue[CalendarFieldIndex::DAY_OF_MONTH]);
79 month =
static_cast<sal_Int32
>(
fieldValue[CalendarFieldIndex::MONTH]) + 1;
80 year =
static_cast<sal_Int32
>(
fieldValue[CalendarFieldIndex::YEAR]);
87 fieldValue[CalendarFieldIndex::DAY_OF_MONTH] =
static_cast<sal_Int16
>(
day);
88 fieldValue[CalendarFieldIndex::MONTH] = sal::static_int_cast<sal_Int16>(
month - 1);
90 fieldValue[CalendarFieldIndex::ERA] =
static_cast<sal_Int16
>(
year) < 1 ? 0 : 1;
103 double jd,
t, t2, t3, k, ma, sa, tf, xtra;
136 xtra = (0.1734 - 0.000393 *
t) * sin(sa)
137 + 0.0021 * sin(sa * 2)
139 + 0.0161 * sin(2 * ma)
140 - 0.0004 * sin(3 * ma)
142 - 0.0051 * sin(sa + ma)
143 - 0.0074 * sin(sa - ma)
144 + 0.0004 * sin(tf + sa)
145 - 0.0004 * sin(tf - sa)
146 - 0.0006 * sin(tf + ma)
147 + 0.0010 * sin(tf - ma)
148 + 0.0005 * sin(sa + 2 * ma);
151 jd += xtra - (0.41 + 1.2053 *
t + 0.4992 * t2)/1440;
173 prevday = julday - 0.5;
180 }
while (newjd > prevday);
184 syndiff = newsyn -
SynRef;
187 *
day =
static_cast<sal_Int32
>(julday - newjd + 0.5);
188 *
month = (syndiff % 12) + 1;
192 *
year =
GregRef +
static_cast<sal_Int32
>(syndiff / 12);
195 if (syndiff != 0 && *
month <= 0) {
201 if (*
year <= 0) (*year)--;
210 if ( *
year < 0 ) (*year)++;
222 jday = std::trunc(jday + 0.5);
241 tools::Long lFactorA, lFactorB, lFactorC, lFactorD, lFactorE;
243 constexpr sal_Int32 GREGORIAN_CROSSOVER = 2299161;
246 if (lJulianDay >= GREGORIAN_CROSSOVER) {
248 tools::Long lAdjust =
static_cast<tools::Long>((
static_cast<float>(lJulianDay - 1867216) - 0.25) / 36524.25);
250 lFactorA = lJulianDay + 1 + lAdjust -
static_cast<tools::Long>(0.25 * lAdjust);
254 lFactorA = lJulianDay;
257 lFactorB = lFactorA + 1524;
258 lFactorC =
static_cast<tools::Long>(6680.0 + (
static_cast<float>(lFactorB - 2439870) - 122.1) / 365.25);
259 lFactorD =
static_cast<tools::Long>(365 * lFactorC + (0.25 * lFactorC));
266 *pnMonth = lFactorE - 1;
271 *pnYear = lFactorC - 4715;
304 double const gregcal = 15 + 31 * ( 10 + 12 * 1582 );
308 ja = std::trunc(0.01 * jy);
309 intgr +=
static_cast<sal_Int32
>(2 - ja + std::trunc(0.25 * ja));
sal_Int16 fieldSetValue[FIELD_INDEX_COUNT]
sal_Int16 fieldValue[FIELD_INDEX_COUNT]
static void SAL_DLLPUBLIC_EXPORT getGregorianDay(sal_Int32 jd, sal_Int32 *pnDay, sal_Int32 *pnMonth, sal_Int32 *pnYear)
static double SAL_DLLPUBLIC_EXPORT NewMoon(sal_Int32 n)
static void SAL_DLLPUBLIC_EXPORT getHijri(sal_Int32 *day, sal_Int32 *month, sal_Int32 *year)
static sal_Int32 SAL_DLLPUBLIC_EXPORT getJulianDay(sal_Int32 day, sal_Int32 month, sal_Int32 year)
void mapFromGregorian() override
static void SAL_DLLPUBLIC_EXPORT ToGregorian(sal_Int32 *day, sal_Int32 *month, sal_Int32 *year)
void mapToGregorian() override
constexpr double deg2rad(double v)
Constant values shared between i18npool and, for example, the number formatter.
constexpr double SynPeriod
constexpr sal_Int32 SynRef
constexpr sal_Int32 GregRef
constexpr double monthDaysWithoutJanFeb
SwNodeOffset abs(const SwNodeOffset &a)