From a2d96b51f3272ecbdc0f4f9d4b2ee65409892554 Mon Sep 17 00:00:00 2001
From: Kohei Yoshida <kohei.yoshida@suse.com>
Date: Tue, 28 Feb 2012 22:01:52 -0500
Subject: [PATCH 1/2] 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)
---
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 f2dea8a..eb22e0f 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
--
1.7.7.6