diff options
-rw-r--r-- | scaddins/source/analysis/financial.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scaddins/source/analysis/financial.cxx b/scaddins/source/analysis/financial.cxx index 8ad0ebb2ced9..052f8b564525 100644 --- a/scaddins/source/analysis/financial.cxx +++ b/scaddins/source/analysis/financial.cxx @@ -40,7 +40,8 @@ double SAL_CALL AnalysisAddIn::getAmorlinc( const css::uno::Reference< css::bean double fCost, sal_Int32 nDate, sal_Int32 nFirstPer, double fRestVal, double fPer, double fRate, const css::uno::Any& rOB ) throw( css::uno::RuntimeException, css::lang::IllegalArgumentException, std::exception ) { - if( nDate > nFirstPer || fRate <= 0.0 || fRestVal > fCost ) + if ( nDate > nFirstPer || fRate <= 0.0 || fRestVal > fCost || + fCost <= 0.0 || fRestVal < 0 || fPer < 0 ) throw css::lang::IllegalArgumentException(); double fRet = GetAmorlinc( GetNullDate( xOpt ), fCost, nDate, nFirstPer, fRestVal, fPer, fRate, getDateMode( xOpt, rOB ) ); |