summaryrefslogtreecommitdiff
path: root/sc/source/core/tool/interpr8.cxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-08-25 11:02:50 +0200
committerEike Rathke <erack@redhat.com>2016-08-25 10:20:26 +0000
commitdb8c3afe8c5a5756537d16cf0399e3b46876cc8b (patch)
treee43e25742e2c461e565adba3d8a69ecccd6c86ab /sc/source/core/tool/interpr8.cxx
parent9fda8f5ad61c11d72718a50a175b23cb43bfa9ab (diff)
let ScInterpreter::pStack contain const formula::FormulaToken*
For two reasons: * introduce a new PushTokenRef() to push an already existing token, which can be used in several places that currently unnecessarily copy-construct a new token to be pushed * prevent unwanted side effects in case a token on the stack would be fiddled with, which was possible but just by convention wasn't done Change-Id: I715d81bcba8bdb415af45e889e9f9db1e0ac4888 Reviewed-on: https://gerrit.libreoffice.org/28377 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sc/source/core/tool/interpr8.cxx')
-rw-r--r--sc/source/core/tool/interpr8.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx
index 972b125267c0..d219c6e4692f 100644
--- a/sc/source/core/tool/interpr8.cxx
+++ b/sc/source/core/tool/interpr8.cxx
@@ -1895,7 +1895,7 @@ void ScInterpreter::ScIfs_MS()
}
//push result :
- FormulaTokenRef xToken( PopToken() );
+ FormulaConstTokenRef xToken( PopToken() );
if ( xToken )
{
// Remove unused arguments of IFS from the stack before pushing the result.
@@ -1904,7 +1904,7 @@ void ScInterpreter::ScIfs_MS()
Pop();
nParamCount--;
}
- PushTempToken( xToken.get() );
+ PushTokenRef( xToken );
}
else
PushError( errUnknownStackVariable );
@@ -2006,7 +2006,7 @@ void ScInterpreter::ScSwitch_MS()
}
// push result
- FormulaTokenRef xToken( PopToken() );
+ FormulaConstTokenRef xToken( PopToken() );
if ( xToken )
{
// Remove unused arguments of SWITCH from the stack before pushing the result.
@@ -2015,7 +2015,7 @@ void ScInterpreter::ScSwitch_MS()
Pop();
nParamCount--;
}
- PushTempToken( xToken.get() );
+ PushTokenRef( xToken );
}
else
PushError( errUnknownStackVariable );