summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2012-02-28 22:01:52 -0500
committerMichael Stahl <mstahl@redhat.com>2012-02-29 14:09:18 +0100
commit3c993bd0c3120445f27cb37e6ecfd8b45c6605e0 (patch)
tree36b46cb0b81845097bb709ba05c292cf2002fafe /sax
parent4444565b179db949457ce2e4bade2cb33519df63 (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>
Diffstat (limited to 'sax')
-rw-r--r--sax/source/tools/converter.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx
index eb8cc7435de0..95f6494a2fc4 100644
--- a/sax/source/tools/converter.cxx
+++ b/sax/source/tools/converter.cxx
@@ -1304,7 +1304,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