Resolves: tdf#100440 check mode to be 0 or 1 for MONTHS(), YEARS() and WEEKS()
Needed to adapt the WEEKS and YEARS test documents to cope with the change. Change-Id: Ia52505418f4fed684bd04290c608e2a65eee2fbc
This commit is contained in:
parent
ad59dcf7da
commit
14e31d6cf4
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -591,6 +591,9 @@ sal_Int32 SAL_CALL ScaDateAddIn::getDiffWeeks(
|
|||||||
sal_Int32 nStartDate, sal_Int32 nEndDate,
|
sal_Int32 nStartDate, sal_Int32 nEndDate,
|
||||||
sal_Int32 nMode ) throw( uno::RuntimeException, lang::IllegalArgumentException, std::exception )
|
sal_Int32 nMode ) throw( uno::RuntimeException, lang::IllegalArgumentException, std::exception )
|
||||||
{
|
{
|
||||||
|
if (nMode != 0 && nMode != 1)
|
||||||
|
throw lang::IllegalArgumentException();
|
||||||
|
|
||||||
sal_Int32 nNullDate = GetNullDate( xOptions );
|
sal_Int32 nNullDate = GetNullDate( xOptions );
|
||||||
|
|
||||||
sal_Int32 nDays1 = nStartDate + nNullDate;
|
sal_Int32 nDays1 = nStartDate + nNullDate;
|
||||||
@ -628,6 +631,9 @@ sal_Int32 SAL_CALL ScaDateAddIn::getDiffMonths(
|
|||||||
sal_Int32 nStartDate, sal_Int32 nEndDate,
|
sal_Int32 nStartDate, sal_Int32 nEndDate,
|
||||||
sal_Int32 nMode ) throw( uno::RuntimeException, lang::IllegalArgumentException, std::exception )
|
sal_Int32 nMode ) throw( uno::RuntimeException, lang::IllegalArgumentException, std::exception )
|
||||||
{
|
{
|
||||||
|
if (nMode != 0 && nMode != 1)
|
||||||
|
throw lang::IllegalArgumentException();
|
||||||
|
|
||||||
sal_Int32 nNullDate = GetNullDate( xOptions );
|
sal_Int32 nNullDate = GetNullDate( xOptions );
|
||||||
|
|
||||||
sal_Int32 nDays1 = nStartDate + nNullDate;
|
sal_Int32 nDays1 = nStartDate + nNullDate;
|
||||||
@ -673,6 +679,9 @@ sal_Int32 SAL_CALL ScaDateAddIn::getDiffYears(
|
|||||||
sal_Int32 nStartDate, sal_Int32 nEndDate,
|
sal_Int32 nStartDate, sal_Int32 nEndDate,
|
||||||
sal_Int32 nMode ) throw( uno::RuntimeException, lang::IllegalArgumentException, std::exception )
|
sal_Int32 nMode ) throw( uno::RuntimeException, lang::IllegalArgumentException, std::exception )
|
||||||
{
|
{
|
||||||
|
if (nMode != 0 && nMode != 1)
|
||||||
|
throw lang::IllegalArgumentException();
|
||||||
|
|
||||||
if ( nMode != 1 )
|
if ( nMode != 1 )
|
||||||
return getDiffMonths( xOptions, nStartDate, nEndDate, nMode ) / 12;
|
return getDiffMonths( xOptions, nStartDate, nEndDate, nMode ) / 12;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user