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

Winfried Donkers winfrieddonkers at libreoffice.org
Wed May 4 10:26:26 UTC 2016


 sc/source/core/tool/interpr8.cxx |   20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

New commits:
commit a5a731daec8dcb4f44bb618b71e6995ec1deb561
Author: Winfried Donkers <winfrieddonkers at libreoffice.org>
Date:   Wed May 4 08:10:48 2016 +0200

    tdf#97831 follow up : use ScInterpreter::ReverseStack()
    
    Change-Id: Ic72a71ab4f90680f1e3496d68441151a36b8f41e
    Reviewed-on: https://gerrit.libreoffice.org/24630
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx
index 58e94cf..5cb33f0 100644
--- a/sc/source/core/tool/interpr8.cxx
+++ b/sc/source/core/tool/interpr8.cxx
@@ -1396,15 +1396,7 @@ void ScInterpreter::ScConcat_MS()
     short nParamCount = GetByte();
 
     //reverse order of parameter stack to simplify concatenation:
-    FormulaToken* p;
-    assert( sp >= nParamCount && " less stack elements than parameters");
-    short nStackParams = std::min<short>( sp, nParamCount);
-    for ( short i = 0; i < short( nStackParams / 2 ); i++ )
-    {
-        p = pStack[ sp - ( nStackParams - i ) ];
-        pStack[ sp - ( nStackParams - i ) ] = pStack[ sp - 1 - i ];
-        pStack[ sp - 1 - i ] = p;
-    }
+    ReverseStack( nParamCount );
 
     size_t nRefInList = 0;
     while ( nParamCount-- > 0 && !nGlobalError )
@@ -1524,15 +1516,7 @@ void ScInterpreter::ScTextJoin_MS()
     if ( MustHaveParamCountMin( nParamCount, 3 ) )
     {
         //reverse order of parameter stack to simplify processing
-        FormulaToken* p;
-        assert( sp >= nParamCount && " less stack elements than parameters");
-        short nStackParams = std::min<short>( sp, nParamCount);
-        for ( short i = 0; i < short( nStackParams / 2 ); i++ )
-        {
-            p = pStack[ sp - ( nStackParams - i ) ];
-            pStack[ sp - ( nStackParams - i ) ] = pStack[ sp - 1 - i ];
-            pStack[ sp - 1 - i ] = p;
-        }
+        ReverseStack( nParamCount );
 
         // get aDelimiters and bSkipEmpty
         std::vector< OUString > aDelimiters;


More information about the Libreoffice-commits mailing list