diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-07-10 19:06:10 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-07-10 20:05:25 +0200 |
commit | 5760c94b8847164f9a7a181f031c7c86643944af (patch) | |
tree | eec33567fa521f17a8431508791b2375063ccefe /basic/source/inc | |
parent | 2490559b6cddb0815808055dc7f32c733a48c44b (diff) |
tdf#134576: proper handling of For/For Each with On Error Resume Next
1. In SbiRuntime::PushForEach, always initialize SbiForStack::eForType
to avoid handling the loop as simple For loop in SbiRuntime::StepNEXT.
2. In SbiRuntime::PushForEach, just like in SbiRuntime::PushFor, don't
set error, but imitialize the loop properly. This allows to proceed to
SbiRuntime::StepTESTFOR, where the error will be handled gracefully.
3. In SbiRuntime::StepTESTFOR, check for the proper initialization of
the iteration, and set the error.
4. In SbiRuntime::StepTESTFOR, on error, modify the type of iteration
into Error - to make sure that loop ends on next iteration (so only a
single iteration happens inside the Resume Next).
Change-Id: Idd0bab79fb0099fa3ad295b7fc6ab2eb6173f7b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98537
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'basic/source/inc')
-rw-r--r-- | basic/source/inc/runtime.hxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx index 3b59a5b18341..65be051e704f 100644 --- a/basic/source/inc/runtime.hxx +++ b/basic/source/inc/runtime.hxx @@ -55,7 +55,8 @@ enum class ForType { To, EachArray, EachCollection, - EachXEnumeration + EachXEnumeration, + Error, }; struct SbiForStack { // for/next stack: |