[Libreoffice-commits] core.git: scaddins/source
Winfried Donkers
winfrieddonkers at libreoffice.org
Fri Jul 29 19:26:01 UTC 2016
scaddins/source/analysis/financial.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 5c78a453bce458afef45ec998b6dd7142f4877b9
Author: Winfried Donkers <winfrieddonkers at libreoffice.org>
Date: Thu Jul 28 12:45:08 2016 +0200
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 at libreoffice.org>
Reviewed-by: Eike Rathke <erack at redhat.com>
Tested-by: Eike Rathke <erack at redhat.com>
diff --git a/scaddins/source/analysis/financial.cxx b/scaddins/source/analysis/financial.cxx
index 6b4a6fd..7a38d58 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 ) ) ) );
More information about the Libreoffice-commits
mailing list