diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/interpr1.cxx | 6 | ||||
-rw-r--r-- | sc/source/core/tool/interpr4.cxx | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 4a63f1426396..06cc58d1549f 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -238,9 +238,11 @@ void ScInterpreter::ScIfError( bool bNAonly ) { const short* pJump = pCur->GetJump(); short nJumpCount = pJump[ 0 ]; - if (!sp) + if (!sp || nJumpCount != 2) { - PushError( errUnknownStackVariable); + // Reset nGlobalError here to not propagate the old error, if any. + nGlobalError = (sp ? errParameterExpected : errUnknownStackVariable); + PushError( nGlobalError); aCode.Jump( pJump[ nJumpCount ], pJump[ nJumpCount ] ); return; } diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 66e02ea7a8b0..58bc0046148a 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -3082,7 +3082,10 @@ void ScInterpreter::ScExternal() void ScInterpreter::ScMissing() { - PushTempToken( new FormulaMissingToken ); + if ( aCode.IsEndOfPath() ) + PushTempToken( new ScEmptyCellToken( false, false ) ); + else + PushTempToken( new FormulaMissingToken ); } #ifndef DISABLE_SCRIPTING |