sc/source/core/tool/interpr1.cxx | 6 ++++-- sc/source/core/tool/interpr4.cxx | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-)
New commits: commit 14b76ff3a98898fcccfa6e48ca8ae1e7bea802e2 Author: Winfried Donkers <winfrieddonk...@libreoffice.org> Date: Wed Feb 11 09:32:09 2015 +0100 tdf#88576 fix handling of empty arguments in IF(), IFERROR() and IFNA() Reviewed-on: https://gerrit.libreoffice.org/14415 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Eike Rathke <er...@redhat.com> (cherry picked from commit 0b75eda1090f92adc678ceff2565da2dc7d9328c) 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. (cherry picked from commit 6583f4e30015164af4972921b5bb7880dfb65f65) eb987637698ab418fc0a60cd873e23878c9f497b Change-Id: I8acca26cf7398768a9e25f97f3a9e61754ab2179 Reviewed-on: https://gerrit.libreoffice.org/14423 Tested-by: Eike Rathke <er...@redhat.com> Reviewed-by: Eike Rathke <er...@redhat.com> diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 4a63f14..06cc58d 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 66e02ea..58bc004 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 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits