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

Eike Rathke erack at redhat.com
Tue Jul 4 07:24:32 UTC 2017


 sc/source/core/tool/interpr2.cxx |   11 ++++-------
 sc/source/core/tool/interpr5.cxx |    2 +-
 2 files changed, 5 insertions(+), 8 deletions(-)

New commits:
commit 29c4c8206d03494f32809e06814675d2952ae0bc
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Jul 4 09:18:09 2017 +0200

    Remove artificial parameter count limit from NPV()
    
    Change-Id: I09b1afa89d57a41a3c58cd7cc27ea62dcd508550

diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 53023e348ef5..e453f46a5812 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -1290,7 +1290,7 @@ void ScInterpreter::ScNPV()
 {
     nFuncFmtType = css::util::NumberFormat::CURRENCY;
     short nParamCount = GetByte();
-    if ( MustHaveParamCount( nParamCount, 2, 31 ) )
+    if ( MustHaveParamCountMin( nParamCount, 2) )
     {
         double nVal = 0.0;
         // We turn the stack upside down!
commit 151ee1eb2cd0d9f0c46975ea260c0d12f0ce8db1
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Jul 4 09:15:41 2017 +0200

    Use ReverseStack() in NPV()
    
    Change-Id: Iff84889c4ff5f7a2c5916e18911cbf624937a8f4

diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index f864cead3deb..53023e348ef5 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -1293,11 +1293,8 @@ void ScInterpreter::ScNPV()
     if ( MustHaveParamCount( nParamCount, 2, 31 ) )
     {
         double nVal = 0.0;
-        //We turn the stack upside down!
-        const FormulaToken* pTemp[ 31 ];
-        for( short i = 0; i < nParamCount; i++ )
-            pTemp[ i ] = pStack[ sp - i - 1 ];
-        memcpy( &pStack[ sp - nParamCount ], pTemp, nParamCount * sizeof( FormulaToken* ) );
+        // We turn the stack upside down!
+        ReverseStack( nParamCount);
         if (nGlobalError == FormulaError::NONE)
         {
             double  nCount = 1.0;
commit e922d7531fa6ccf6187cd7e41132226abb2cac58
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Jul 4 09:06:09 2017 +0200

    Remove artificial parameter count limit from SUMPRODUCT()
    
    Change-Id: I49956ebad76628588743e2af4eee9bfde4775198

diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index 75e3f8dd5da1..1947af156de5 100644
--- a/sc/source/core/tool/interpr5.cxx
+++ b/sc/source/core/tool/interpr5.cxx
@@ -1691,7 +1691,7 @@ public:
 void ScInterpreter::ScSumProduct()
 {
     short nParamCount = GetByte();
-    if ( !MustHaveParamCount( nParamCount, 1, 30 ) )
+    if ( !MustHaveParamCountMin( nParamCount, 1) )
         return;
 
     // XXX NOTE: Excel returns #VALUE! for reference list and 0 (why?) for
commit 77fcd7c819a4455fd6d21df3c8c0a74a34545140
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Jul 4 09:03:25 2017 +0200

    Remove artificial parameter count limit from GRETPIVOTDATA()
    
    Change-Id: I28fd0398fa7c8a45e8b372c79955f20eb3ff8c99

diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 277bc19f9869..f864cead3deb 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -3551,7 +3551,7 @@ void ScInterpreter::ScGetPivotData()
 {
     sal_uInt8 nParamCount = GetByte();
 
-    if (!MustHaveParamCount(nParamCount, 2, 30) || (nParamCount % 2) == 1)
+    if (!MustHaveParamCountMin(nParamCount, 2) || (nParamCount % 2) == 1)
     {
         PushError(FormulaError::NoRef);
         return;


More information about the Libreoffice-commits mailing list