diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-02-19 13:26:48 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-02-19 13:37:42 +0000 |
commit | fd6a0cf1eb8441acb23f22e9e9fafc477bf4e57e (patch) | |
tree | e9aa8b8624800ed1f5284c807fddc93f9529c0cf /odk | |
parent | 405d0bc007b8d90bf0880035c5d69e1fc4b951b1 (diff) |
tdf#153724: make sure to retrieve the variable value before checking the type
Commit 5760c94b8847164f9a7a181f031c7c86643944af tried to avoid all cases
which could set an error in SbiRuntime::PushForEach. To do that, it checked
the type of xObjVar before trying to get an object from it, which otherwise
could set an error.
But the type of the contained value can be not known until it is retrieved
(which can happen inside SbxValue::Get in a call to SbxValue::Broadcast with
SfxHintId::BasicDataWanted). This happens e.g. when the container passed to
'for each' is a call to some special function, like VBA's 'Selection'. Then
SbxValue::GetFullType would return SbxEMPTY prior to SbxValue::Get.
Let's make sure to call SbxValue::Get first (asking for a Variant, to avoid
errors on type mismatch), and only then, check the actual result data type.
Change-Id: Iaa697f38285505e50504ae09f9307fbd29e09a53
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147273
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'odk')
0 files changed, 0 insertions, 0 deletions