From f2cd9c0c789b5825b4d5bb84b352d089e231e527 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sat, 24 Nov 2018 21:55:10 +0300 Subject: tdf#120703 PVS: V560 A part of conditional expression is always true/false Change-Id: If173f42302553b164267909a0a3156bb25a6d558 Reviewed-on: https://gerrit.libreoffice.org/63957 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- scaddins/source/analysis/financial.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scaddins/source/analysis/financial.cxx') diff --git a/scaddins/source/analysis/financial.cxx b/scaddins/source/analysis/financial.cxx index 0b66bd873c96..3ae91c8cfb59 100644 --- a/scaddins/source/analysis/financial.cxx +++ b/scaddins/source/analysis/financial.cxx @@ -126,7 +126,7 @@ double SAL_CALL AnalysisAddIn::getCumprinc( double fRate, sal_Int32 nNumPeriods, { double fPmt, fPpmt; - if( nStartPer < 1 || nEndPer < nStartPer || fRate <= 0.0 || nEndPer > nNumPeriods || nNumPeriods <= 0 || + if( nStartPer < 1 || nEndPer < nStartPer || fRate <= 0.0 || nEndPer > nNumPeriods || fVal <= 0.0 || ( nPayType != 0 && nPayType != 1 ) ) throw css::lang::IllegalArgumentException(); @@ -164,7 +164,7 @@ double SAL_CALL AnalysisAddIn::getCumipmt( double fRate, sal_Int32 nNumPeriods, { double fPmt, fIpmt; - if( nStartPer < 1 || nEndPer < nStartPer || fRate <= 0.0 || nEndPer > nNumPeriods || nNumPeriods <= 0 || + if( nStartPer < 1 || nEndPer < nStartPer || fRate <= 0.0 || nEndPer > nNumPeriods || fVal <= 0.0 || ( nPayType != 0 && nPayType != 1 ) ) throw css::lang::IllegalArgumentException(); -- cgit