summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinfried Donkers <winfrieddonkers@libreoffice.org>2016-05-04 08:10:48 +0200
committerEike Rathke <erack@redhat.com>2016-05-04 10:26:03 +0000
commita5a731daec8dcb4f44bb618b71e6995ec1deb561 (patch)
treef751bd26b65f207fff5c7f22a7db7f8daa955b33
parentd8d768a0bc06d154a24fffe400e4e9f5534adc3b (diff)
tdf#97831 follow up : use ScInterpreter::ReverseStack()
Change-Id: Ic72a71ab4f90680f1e3496d68441151a36b8f41e Reviewed-on: https://gerrit.libreoffice.org/24630 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/source/core/tool/interpr8.cxx20
1 files changed, 2 insertions, 18 deletions
diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx
index 58e94cfb6742..5cb33f06e6db 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;