summaryrefslogtreecommitdiffstats
path: root/svtools/source/control/calendar.cxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2011-11-30 02:05:22 +0100
committerEike Rathke <erack@redhat.com>2011-11-30 02:05:22 +0100
commitdca69d5bb2d0e542de26624dd9f71fb87e1533f2 (patch)
treed3d6b62417885946113b6f13e10ca0f4fc45613c /svtools/source/control/calendar.cxx
parentonline update: Now check even the checkForUpdates(). (diff)
downloadcore-dca69d5bb2d0e542de26624dd9f71fb87e1533f2.tar.gz
core-dca69d5bb2d0e542de26624dd9f71fb87e1533f2.zip
renamed Date::IsValid() to IsValidAndGregorian() to prevent misassumptions
Once smaller than 1582-10-15 decrementing a Date will not produce a valid date.
Diffstat (limited to 'svtools/source/control/calendar.cxx')
-rw-r--r--svtools/source/control/calendar.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index 7b4bf577db6a..4ff76c3e23e2 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -1974,7 +1974,7 @@ void Calendar::Select()
void Calendar::SelectDate( const Date& rDate, sal_Bool bSelect )
{
- if ( !rDate.IsValid() )
+ if ( !rDate.IsValidAndGregorian() )
return;
Table* pOldSel;
@@ -2037,7 +2037,7 @@ Date Calendar::GetSelectDate( sal_uLong nIndex ) const
void Calendar::SetCurDate( const Date& rNewDate )
{
- if ( !rNewDate.IsValid() )
+ if ( !rNewDate.IsValidAndGregorian() )
return;
if ( maCurDate != rNewDate )
@@ -2638,9 +2638,9 @@ sal_Bool CalendarField::ShowDropDown( sal_Bool bShow )
Calendar* pCalendar = GetCalendar();
Date aDate = GetDate();
- if ( IsEmptyDate() || !aDate.IsValid() )
+ if ( IsEmptyDate() || !aDate.IsValidAndGregorian() )
{
- if ( maDefaultDate.IsValid() )
+ if ( maDefaultDate.IsValidAndGregorian() )
aDate = maDefaultDate;
else
aDate = Date();