diff options
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/runtime/methods.cxx | 10 | ||||
-rw-r--r-- | basic/source/runtime/methods1.cxx | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 56fa68c2aa52..f1b5b7d3365e 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -1702,7 +1702,7 @@ sal_Int16 implGetDateDay( double aDate ) aDate -= 2.0; // standardize: 1.1.1900 => 0.0 aDate = floor( aDate ); Date aRefDate( 1, 1, 1900 ); - aRefDate += static_cast<sal_Int32>(aDate); + aRefDate.AddDays( aDate ); sal_Int16 nRet = (sal_Int16)( aRefDate.GetDay() ); return nRet; @@ -1711,9 +1711,9 @@ sal_Int16 implGetDateDay( double aDate ) sal_Int16 implGetDateMonth( double aDate ) { Date aRefDate( 1,1,1900 ); - long nDays = (long)aDate; + sal_Int32 nDays = (sal_Int32)aDate; nDays -= 2; // standardize: 1.1.1900 => 0.0 - aRefDate += nDays; + aRefDate.AddDays( nDays ); sal_Int16 nRet = (sal_Int16)( aRefDate.GetMonth() ); return nRet; } @@ -4582,7 +4582,7 @@ sal_Int16 implGetDateYear( double aDate ) Date aRefDate( 1,1,1900 ); long nDays = (long) aDate; nDays -= 2; // standardize: 1.1.1900 => 0.0 - aRefDate += nDays; + aRefDate.AddDays( nDays ); sal_Int16 nRet = aRefDate.GetYear(); return nRet; } @@ -4672,7 +4672,7 @@ bool implDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, if (nAddMonths) aCurDate.AddMonths( nAddMonths); if (nAddDays) - aCurDate += nAddDays; + aCurDate.AddDays( nAddDays); } long nDiffDays = GetDayDiff( aCurDate ); diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index 1dbfa9db3285..a67de7407a6b 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -3037,9 +3037,9 @@ void SbRtl_Me(StarBASIC *, SbxArray & rPar, bool) sal_Int16 implGetWeekDay( double aDate, bool bFirstDayParam, sal_Int16 nFirstDay ) { Date aRefDate( 1,1,1900 ); - long nDays = (long) aDate; + sal_Int32 nDays = (sal_Int32) aDate; nDays -= 2; // normalize: 1.1.1900 => 0 - aRefDate += nDays; + aRefDate.AddDays( nDays); DayOfWeek aDay = aRefDate.GetDayOfWeek(); sal_Int16 nDay; if ( aDay != SUNDAY ) |