summaryrefslogtreecommitdiff
path: root/tools/source/datetime
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2008-11-10 15:06:12 +0000
committerRüdiger Timm <rt@openoffice.org>2008-11-10 15:06:12 +0000
commit7f5f6b548d071d412efb78e9fee21d68ad6700bc (patch)
tree49c7255c440b542ccffd5af0f72387afa34eaa43 /tools/source/datetime
parentf00cc0b3ee98e5213707c04fe4e84bc8e4fa9932 (diff)
CWS-TOOLING: integrate CWS cmcfixes50
2008-11-10 13:31:50 +0100 cmc r263517 : gio doesn't do anything useful for remote stuff wrt info 2008-11-06 00:11:47 +0100 cmc r263359 : #i93436# pile of other 64bit new gcc warnings 2008-11-05 00:39:03 +0100 cmc r263340 : i95856 let a ppc64 vanilla build succeed 2008-11-04 14:00:25 +0100 cmc r263320 : #i93436# useless const 2008-11-04 11:53:10 +0100 cmc r263314 : #i93436# ambiguous 2008-11-04 11:48:05 +0100 cmc r263313 : #i93436# add some braces 2008-11-04 11:29:24 +0100 cmc r263312 : #i93436# ambiguous 2008-11-04 10:53:46 +0100 cmc r263311 :
Diffstat (limited to 'tools/source/datetime')
-rw-r--r--tools/source/datetime/tdate.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/source/datetime/tdate.cxx b/tools/source/datetime/tdate.cxx
index 9820918cfdf6..7f204d5e46da 100644
--- a/tools/source/datetime/tdate.cxx
+++ b/tools/source/datetime/tdate.cxx
@@ -65,7 +65,10 @@ static USHORT aDaysInMonth[12] = { 31, 28, 31, 30, 31, 30,
inline BOOL ImpIsLeapYear( USHORT nYear )
{
- return (((nYear % 4) == 0) && ((nYear % 100) != 0) || ((nYear % 400) == 0));
+ return (
+ ( ((nYear % 4) == 0) && ((nYear % 100) != 0) ) ||
+ ( (nYear % 400) == 0 )
+ );
}
// -----------------------------------------------------------------------
@@ -76,8 +79,7 @@ inline USHORT DaysInMonth( USHORT nMonth, USHORT nYear )
return aDaysInMonth[nMonth-1];
else
{
- if ( ((nYear % 4) == 0) && ((nYear % 100) != 0) ||
- ((nYear % 400) == 0) )
+ if (ImpIsLeapYear(nYear))
return aDaysInMonth[nMonth-1] + 1;
else
return aDaysInMonth[nMonth-1];