diff options
author | Eike Rathke <erack@redhat.com> | 2016-06-30 18:49:36 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-06-30 18:53:50 +0200 |
commit | 14e31d6cf4c4ba8a28b932c77994bc905686dba5 (patch) | |
tree | 4c1ca786a1f9e108457c51d10eb3f4d88638af6f /scaddins/source | |
parent | ad59dcf7dad19540403f5812677901e6fad30257 (diff) |
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
Diffstat (limited to 'scaddins/source')
-rw-r--r-- | scaddins/source/datefunc/datefunc.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scaddins/source/datefunc/datefunc.cxx b/scaddins/source/datefunc/datefunc.cxx index cd9b3b005718..ca4003cd37e7 100644 --- a/scaddins/source/datefunc/datefunc.cxx +++ b/scaddins/source/datefunc/datefunc.cxx @@ -591,6 +591,9 @@ sal_Int32 SAL_CALL ScaDateAddIn::getDiffWeeks( sal_Int32 nStartDate, sal_Int32 nEndDate, 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 nDays1 = nStartDate + nNullDate; @@ -628,6 +631,9 @@ sal_Int32 SAL_CALL ScaDateAddIn::getDiffMonths( sal_Int32 nStartDate, sal_Int32 nEndDate, 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 nDays1 = nStartDate + nNullDate; @@ -673,6 +679,9 @@ sal_Int32 SAL_CALL ScaDateAddIn::getDiffYears( sal_Int32 nStartDate, sal_Int32 nEndDate, sal_Int32 nMode ) throw( uno::RuntimeException, lang::IllegalArgumentException, std::exception ) { + if (nMode != 0 && nMode != 1) + throw lang::IllegalArgumentException(); + if ( nMode != 1 ) return getDiffMonths( xOptions, nStartDate, nEndDate, nMode ) / 12; |