[Libreoffice-commits] core.git: 2 commits - sc/source

Winfried Donkers winfrieddonkers at libreoffice.org
Mon Mar 6 15:51:27 UTC 2017


 sc/source/core/tool/interpr2.cxx |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

New commits:
commit ccd030e61fa43c472b85b184882e87f4fab2faf2
Author: Winfried Donkers <winfrieddonkers at libreoffice.org>
Date:   Thu Mar 2 15:16:57 2017 +0100

    tdf#106236 Check for all constraints with Calc function PDURATION.
    
    Plus use of correct prefixes for variable names.
    
    Change-Id: I430039fa23fc73e13bf1992f4188a67ae47b52ab
    Reviewed-on: https://gerrit.libreoffice.org/34819
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index b9dd738..a33aa33 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -1880,10 +1880,13 @@ void ScInterpreter::ScPDuration()
 {
     if ( MustHaveParamCount( GetByte(), 3 ) )
     {
-        double nFuture = GetDouble();
-        double nPresent = GetDouble();
-        double nInterest = GetDouble();
-        PushDouble(log(nFuture / nPresent) / rtl::math::log1p(nInterest));
+        double fFuture = GetDouble();
+        double fPresent = GetDouble();
+        double fInterest = GetDouble();
+        if ( fFuture <= 0.0 || fPresent <= 0.0 || fInterest <= 0.0 )
+            PushIllegalArgument();
+        else
+            PushDouble( ( log( fFuture / fPresent ) / rtl::math::log1p( fInterest ) ) );
     }
 }
 
commit 9a7b5d86aceb97fc9f3d36bee817d3d0fc976254
Author: Winfried Donkers <winfrieddonkers at libreoffice.org>
Date:   Mon Feb 27 15:05:32 2017 +0100

    tdf#106210 Apply correct constraint for calc function EFFECTIVE.
    
    (= ODFF formula EFFECT)
    
    Change-Id: Ib9adeece3d2f1331b80ce8eae74831420e6c2e6b
    Reviewed-on: https://gerrit.libreoffice.org/34682
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 55cc788..b9dd738 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -2331,8 +2331,10 @@ void ScInterpreter::ScEffect()
     {
         double fPeriods = GetDouble();
         double fNominal = GetDouble();
-        if (fPeriods < 1.0 || fNominal <= 0.0)
+        if (fPeriods < 1.0 || fNominal < 0.0)
             PushIllegalArgument();
+        else if ( fNominal == 0.0 )
+            PushDouble( 0.0 );
         else
         {
             fPeriods = ::rtl::math::approxFloor(fPeriods);


More information about the Libreoffice-commits mailing list