[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - sc/qa sc/source

Winfried Donkers winfrieddonkers at libreoffice.org
Thu Sep 7 13:17:21 UTC 2017


 sc/qa/unit/data/functions/financial/fods/nper.fods |   36 +++++++++++++++------
 sc/source/core/tool/interpr2.cxx                   |    2 -
 2 files changed, 27 insertions(+), 11 deletions(-)

New commits:
commit 085768b2a0dd1fc6371e8b2ba4e2418ba96cdb21
Author: Winfried Donkers <winfrieddonkers at libreoffice.org>
Date:   Wed Sep 6 16:52:05 2017 +0200

    tdf#112177 remove incorrect constraint for Calc function NPER.
    
    Change-Id: I123ea8ee2e333665ac448c6b3814c3bac0b687ab
    Reviewed-on: https://gerrit.libreoffice.org/42011
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Eike Rathke <erack at redhat.com>
    (cherry picked from commit 003c2cfaa258e204402a366a105366da74e220a2)
    Reviewed-on: https://gerrit.libreoffice.org/42047

diff --git a/sc/qa/unit/data/functions/financial/fods/nper.fods b/sc/qa/unit/data/functions/financial/fods/nper.fods
index 22c06f914a25..2eac9b8f339f 100644
--- a/sc/qa/unit/data/functions/financial/fods/nper.fods
+++ b/sc/qa/unit/data/functions/financial/fods/nper.fods
@@ -1528,20 +1528,20 @@
      <table:table-cell table:number-columns-repeated="9"/>
     </table:table-row>
     <table:table-row table:style-name="ro6">
-     <table:table-cell table:style-name="ce48" table:formula="of:=NPER(0.06/52; 0; 8000; 0 ;2)" office:value-type="string" office:string-value="" calcext:value-type="error">
-      <text:p>Err:502</text:p>
+     <table:table-cell table:formula="of:=NPER(0.06; 0; -80; 400 ;2)" office:value-type="float" office:value="27.6208695898296" calcext:value-type="float">
+      <text:p>27.6208695898296</text:p>
      </table:table-cell>
-     <table:table-cell table:formula="of:#ERR502!" office:value-type="string" office:string-value="" calcext:value-type="error">
-      <text:p>Err:502</text:p>
+     <table:table-cell office:value-type="float" office:value="27.6208695898296" calcext:value-type="float">
+      <text:p>27.6208695898296</text:p>
      </table:table-cell>
-     <table:table-cell table:style-name="ce53" table:formula="of:=ORG.OPENOFFICE.ERRORTYPE([.A12])=502" office:value-type="boolean" office:boolean-value="true" calcext:value-type="boolean">
-      <text:p>TRUE</text:p>
+     <table:table-cell table:style-name="ce51" table:formula="of:=ROUND([.A12];12)=ROUND([.B12];12)" office:value-type="boolean" office:boolean-value="true" calcext:value-type="boolean">
+      <text:p>WAAR</text:p>
      </table:table-cell>
-     <table:table-cell table:formula="of:=FORMULA([.A12])" office:value-type="string" office:string-value="=NPER(0.06/52, 0, 8000, 0 ,2)" calcext:value-type="string">
-      <text:p>=NPER(0.06/52, 0, 8000, 0 ,2)</text:p>
+     <table:table-cell table:formula="of:=FORMULA([.A12])" office:value-type="string" office:string-value="=NPER(0.06; 0; -80; 400 ;2)" calcext:value-type="string">
+      <text:p>=NPER(0,06; 0; -80; 400 ;2)</text:p>
      </table:table-cell>
      <table:table-cell office:value-type="string" calcext:value-type="string">
-      <text:p>No payment, no result</text:p>
+      <text:p>future value achieved with interest from present value</text:p>
      </table:table-cell>
      <table:table-cell table:number-columns-repeated="4"/>
      <table:table-cell table:style-name="ce20" table:number-columns-repeated="2"/>
@@ -1570,6 +1570,24 @@
      <table:table-cell table:number-columns-repeated="6"/>
     </table:table-row>
     <table:table-row table:style-name="ro6">
+     <table:table-cell table:formula="of:=NPER(0.06; 0; 80; 400 ;2)" office:value-type="string" office:string-value="" calcext:value-type="error">
+      <text:p>#NUM!</text:p>
+     </table:table-cell>
++     <table:table-cell office:value-type="string" calcext:value-type="string">
++      <text:p>#NUM!</text:p>
+     </table:table-cell>
+     <table:table-cell table:style-name="ce26" table:formula="of:=ISERROR([.A14])" office:value-type="boolean" office:boolean-value="true" calcext:value-type="boolean">
+      <text:p>WAAR</text:p>
+     </table:table-cell>
+     <table:table-cell table:formula="of:=FORMULA([.A14])" office:value-type="string" office:string-value="=NPER(0,06; 0; 80; 400 ;2)" calcext:value-type="string">
+      <text:p>=NPER(0,06; 0; 80; 400 ;2)</text:p>
+     </table:table-cell>
+     <table:table-cell office:value-type="string" calcext:value-type="string">
+      <text:p>future value cannot be achieved with interest from present value</text:p>
+     </table:table-cell>
+     <table:table-cell table:number-columns-repeated="15"/>
+    </table:table-row>
+    <table:table-row table:style-name="ro6">
      <table:table-cell table:style-name="ce21"/>
      <table:table-cell/>
      <table:table-cell table:style-name="ce26"/>
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 3e61c081e24b..35f748a959e2 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -2007,8 +2007,6 @@ void ScInterpreter::ScNper()
     // amount to be paid to get from fPV to fFV is fFV_+_fPV.
     if ( fPV + fFV == 0.0 )
         PushDouble( 0.0 );
-    else if ( fPmt == 0.0 )
-        PushIllegalArgument();  // No payment, future value can never be reached
     else if (fInterest == 0.0)
         PushDouble(-(fPV + fFV)/fPmt);
     else if (bPayInAdvance)


More information about the Libreoffice-commits mailing list