diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-11-02 12:56:23 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-11-02 16:29:09 +0100 |
commit | d392b24623a46058d0fa35e445a4ceae519c738f (patch) | |
tree | 84f07d25b2484811c07f54085e12e6e78137f7b2 /i18npool | |
parent | 86ab194c621aa48b9718815e426fe4d5560ddbb0 (diff) |
add a fast path for the 1999-12-31 date in calendar conversion
seen in:
https: //user-images.githubusercontent.com/833656/279971758-ef3d86b1-23ea-4e57-ad15-1f9b12df6bdd.svg
Change-Id: I76f5e83860ea49e52099ece670e7c259fd89e666
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158830
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/source/calendar/calendar_jewish.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/i18npool/source/calendar/calendar_jewish.cxx b/i18npool/source/calendar/calendar_jewish.cxx index ab5a32a221d8..19b55eaf8789 100644 --- a/i18npool/source/calendar/calendar_jewish.cxx +++ b/i18npool/source/calendar/calendar_jewish.cxx @@ -140,6 +140,15 @@ public: HebrewDate(sal_Int32 m, sal_Int32 d, sal_Int32 y) : year(y), month(m), day(d) { } explicit HebrewDate(sal_Int32 d) { // Computes the Hebrew date from the absolute date. + + if (d == 730119) // 1999-12-31 : a very common date used in calc + { + year = 5760; + month = 10; + day = 22; + return; + } + year = (d + HebrewEpoch) / 366; // Approximation from below. // Search forward for year from the approximation. while (d >= HebrewDate(7,1,year + 1).GetAbsoluteDate()) |