diff options
author | Winfried Donkers <winfrieddonkers@libreoffice.org> | 2016-07-28 12:45:08 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-07-29 19:25:30 +0000 |
commit | 5c78a453bce458afef45ec998b6dd7142f4877b9 (patch) | |
tree | ef6681e84ae614ff47f5f1a06607b03414ee7949 /scaddins | |
parent | tdf#101094 (17) OPTIONS: Options cache removal: COPY (diff) | |
download | core-5c78a453bce458afef45ec998b6dd7142f4877b9.tar.gz core-5c78a453bce458afef45ec998b6dd7142f4877b9.zip |
Make Calc Add-In function RECEIVED behave like Excel and Gnumeric.
EXcel and Gnumeric demand that Maturity > Settlement, Calc now does too.
Change-Id: Id02918153d5c07f438c9160330b0dc09fdf13f6c
Reviewed-on: https://gerrit.libreoffice.org/27619
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'scaddins')
-rw-r--r-- | scaddins/source/analysis/financial.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scaddins/source/analysis/financial.cxx b/scaddins/source/analysis/financial.cxx index 6b4a6fdaba16..7a38d5876cc6 100644 --- a/scaddins/source/analysis/financial.cxx +++ b/scaddins/source/analysis/financial.cxx @@ -79,7 +79,7 @@ double SAL_CALL AnalysisAddIn::getAccrintm( const css::uno::Reference< css::bean double SAL_CALL AnalysisAddIn::getReceived( const css::uno::Reference< css::beans::XPropertySet >& xOpt, sal_Int32 nSettle, sal_Int32 nMat, double fInvest, double fDisc, const css::uno::Any& rOB ) throw( css::uno::RuntimeException, css::lang::IllegalArgumentException, std::exception ) { - if( fInvest <= 0.0 || fDisc <= 0.0 ) + if( fInvest <= 0.0 || fDisc <= 0.0 || nSettle >= nMat ) throw css::lang::IllegalArgumentException(); double fRet = fInvest / ( 1.0 - ( fDisc * GetYearDiff( GetNullDate( xOpt ), nSettle, nMat, getDateMode( xOpt, rOB ) ) ) ); |