diff options
author | Eike Rathke <erack@redhat.com> | 2011-11-30 02:05:22 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2011-11-30 02:05:22 +0100 |
commit | dca69d5bb2d0e542de26624dd9f71fb87e1533f2 (patch) | |
tree | d3d6b62417885946113b6f13e10ca0f4fc45613c /svtools | |
parent | cb937da55c3ab3d238b97d6e0e709ea2a04d2c26 (diff) |
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')
-rw-r--r-- | svtools/source/contnr/templwin.cxx | 2 | ||||
-rw-r--r-- | svtools/source/control/calendar.cxx | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/svtools/source/contnr/templwin.cxx b/svtools/source/contnr/templwin.cxx index 3792826ee571..c2daae824d1d 100644 --- a/svtools/source/contnr/templwin.cxx +++ b/svtools/source/contnr/templwin.cxx @@ -164,7 +164,7 @@ void lcl_insertDateTimeEntry(SvtExtendedMultiLineEdit_Impl* i_pEditWin, DateTime( Date( i_rUDT.Day, i_rUDT.Month, i_rUDT.Year ), Time( i_rUDT.Hours, i_rUDT.Minutes, i_rUDT.Seconds, i_rUDT.HundredthSeconds ) ); - if ( aToolsDT.IsValid() ) + if ( aToolsDT.IsValidAndGregorian() ) { LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), 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(); |