diff options
author | Eike Rathke <erack@redhat.com> | 2022-03-11 21:44:21 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-03-14 14:20:26 +0100 |
commit | 91ca6a8eded939373e78ecf6091b3598936f2c08 (patch) | |
tree | 5d180180cab4ef888545119974c2b0e299b28bdd /sc | |
parent | 69bf8f5e6dc43adde087403531641f2bd064a22c (diff) |
Related: tdf#111675 Clear global error for arguments if possible
... i.e. if the last result / current stack value is svError
already (usually is nowadays in case of error) and error
evaluating functions may be pending.
Change-Id: I36fc0f169d36dfa7007e8bd3a5c368ed2bb3c919
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131405
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit efb713febeaaf3e4b17886d405d46845d4a0e676)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131363
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/interpr4.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index bc99592a15a8..1a0eed81302f 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -4540,6 +4540,18 @@ StackVar ScInterpreter::Interpret() } if ( nErrorFunction >= nErrorFunctionCount ) ++nErrorFunction; // that's it, error => terminate + else if (nErrorFunctionCount && sp && GetStackType() == svError) + { + // Clear global error if we have an individual error result, so + // an error evaluating function can receive multiple arguments + // and not all evaluated arguments inheriting the error. + // This is important for at least IFS() and SWITCH() as long as + // they are classified as error evaluating functions and not + // implemented as short-cutting jump code paths, but also for + // more than one evaluated argument to AGGREGATE() or COUNT() + // that may ignore errors. + nGlobalError = FormulaError::NONE; + } } } |