diff options
author | Eike Rathke <erack@redhat.com> | 2016-07-19 22:03:09 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-07-20 16:53:22 +0200 |
commit | e54cd3fbf40300416ef337981bd356b88ad44a41 (patch) | |
tree | ca1c6065d8d79cf6f3a9f7db69a2a0ba999d8ce6 | |
parent | d8e225304b7c8465f5e7f038ec02270445e1b600 (diff) |
Resolves: tdf#100637 narrow down the JumpMatrix path finish condition
... so a pending path result is not prematurely discarded.
Change-Id: I87d58b0d242c3ece503e31a30aaf77150bb0f358
-rw-r--r-- | sc/source/core/tool/interpr4.cxx | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 57475287d7cd..34fcfa88c0a5 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -4369,14 +4369,18 @@ StackVar ScInterpreter::Interpret() { if (nLevel == 1) aErrorFunctionStack.push( nErrorFunction); - bGotResult = JumpMatrix( nLevel ); - if (aErrorFunctionStack.empty()) - assert(!"ScInterpreter::Interpret - aErrorFunctionStack empty in JumpMatrix context"); - else + // Restrict nLevel==1 to not prematurely discard a path result. + if (nLevel == 2 || (!aCode.HasStacked() || aCode.IsEndOfPath())) { - nErrorFunction = aErrorFunctionStack.top(); - if (bGotResult) - aErrorFunctionStack.pop(); + bGotResult = JumpMatrix( nLevel ); + if (aErrorFunctionStack.empty()) + assert(!"ScInterpreter::Interpret - aErrorFunctionStack empty in JumpMatrix context"); + else + { + nErrorFunction = aErrorFunctionStack.top(); + if (bGotResult) + aErrorFunctionStack.pop(); + } } } else |