summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-02-11 14:58:16 +0100
committerEike Rathke <erack@redhat.com>2015-02-11 15:02:00 +0100
commit6583f4e30015164af4972921b5bb7880dfb65f65 (patch)
tree90641789569c7cfae2dfa4e9694ef74746b1b060 /sc
parent0b75eda1090f92adc678ceff2565da2dc7d9328c (diff)
tdf#88576 check that two parameters are given for IFERROR() and IFNA()
Otherwise the functions failed only for the error case resulting in #NULL! error. Change-Id: Ieb987637698ab418fc0a60cd873e23878c9f497b
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/interpr1.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 6ecf137baafa..12f77a6c7d62 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -242,9 +242,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;
}