i18npool/source/calendar/calendar_jewish.cxx | 9 +++++++++ 1 file changed, 9 insertions(+)
New commits: commit d392b24623a46058d0fa35e445a4ceae519c738f Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Nov 2 12:56:23 2023 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Thu Nov 2 16:29:09 2023 +0100 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.mcnam...@collabora.com> 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())