diff options
author | Eike Rathke <erack@redhat.com> | 2018-05-15 19:36:52 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-05-16 11:38:53 +0200 |
commit | 40c9a129e5a53e6eadfe8ca80c98ccf7eda957f9 (patch) | |
tree | 562addd881be843d94863e0edd6f4f4c1b4a4be0 /basic/source/inc | |
parent | 8920d865ee148518bf71f71ce1866b24cc17c07e (diff) |
Resolves: tdf#117612 truncate DateAdd("m",...) to last day of month
... instead of resulting in error because of roll-over not being set.
Fallout from
commit 6d424f07701bf26d8fb173563b567d5f097c33e2
CommitDate: Tue May 2 23:12:34 2017 +0200
Replace mouth-painted "inaccurate around leap year" rollover algorithm
that does stricter checking but DateAdd() needs a lax checking
with truncate to last day of month.
Change-Id: I9d6f95ad3ac38257d492019bd621070491e98e76
Diffstat (limited to 'basic/source/inc')
-rw-r--r-- | basic/source/inc/date.hxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/basic/source/inc/date.hxx b/basic/source/inc/date.hxx index 4b28f1d66b02..c0cfd66a5cf7 100644 --- a/basic/source/inc/date.hxx +++ b/basic/source/inc/date.hxx @@ -24,7 +24,14 @@ #include <com/sun/star/util/Time.hpp> #include <com/sun/star/util/DateTime.hpp> -bool implDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, bool bUseTwoDigitYear, bool bRollOver, double& rdRet ); +enum class SbDateCorrection +{ + None, + RollOver, + TruncateToMonth +}; + +bool implDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, bool bUseTwoDigitYear, SbDateCorrection eCorr, double& rdRet ); double implTimeSerial( sal_Int16 nHour, sal_Int16 nMinute, sal_Int16 nSecond); bool implDateTimeSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, sal_Int16 nHour, sal_Int16 nMinute, sal_Int16 nSecond, |