diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-02-28 22:01:52 -0500 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-02-29 14:18:43 +0100 |
commit | a2d96b51f3272ecbdc0f4f9d4b2ee65409892554 (patch) | |
tree | b4f7e3fa40fb79cc03758abba501184ceecd6f06 /sax | |
parent | e532d4932b8a265cc82bf06ef54db58c9b532e38 (diff) |
Correctly calculate leap year.
With the old code, year 2000 would not be a leap year, but it actually
is. With this, Calc correctly loads cell with date value of 2000-2-29.
(regression from CWS sw33bf02 8786083eb9dabb0d7b328a217ba99a1d71493ad7)
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Signed-off-by: Eike Rathke <erack@redhat.com>
Signed-off-by: Michael Stahl <mstahl@redhat.com>
(cherry picked from commit 3c993bd0c3120445f27cb37e6ecfd8b45c6605e0)
Diffstat (limited to 'sax')
-rw-r--r-- | sax/source/tools/converter.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx index f2dea8a9a1a3..eb22e0f2d544 100644 --- a/sax/source/tools/converter.cxx +++ b/sax/source/tools/converter.cxx @@ -1320,7 +1320,7 @@ readDateTimeComponent(const ::rtl::OUString & rString, static bool lcl_isLeapYear(const sal_uInt32 nYear) { return ((nYear % 4) == 0) - && !(((nYear % 100) == 0) || ((nYear % 400) == 0)); + && (((nYear % 100) != 0) || ((nYear % 400) == 0)); } static sal_uInt16 |