summaryrefslogtreecommitdiff
path: root/wizards
diff options
context:
space:
mode:
authorJean-Pierre Ledure <jp@ledure.be>2022-12-13 17:50:43 +0100
committerJean-Pierre Ledure <jp@ledure.be>2022-12-14 08:16:02 +0000
commitce3b32f5d522042bd87535762e5e7002d1498cc8 (patch)
treea911daec6406f95dd096741fb285c76fffe3723a /wizards
parent5102157de7d4747304ca6024b44a25fa914049e0 (diff)
SF_Dictionary: tdf#152351 Fix ReplaceItem does not accept array as value
Next basic code Dim myDict as Variant myDict = CreateScriptService("Dictionary") myDict.Add("key", Array()) myDict.ReplaceItem("key", Array(1, 2, 3)) produces an error message incriminating the user code. While it should run normally ... Fixed by enlarging the validation rules. Patch on master: https://gerrit.libreoffice.org/c/core/+/144041 Change-Id: I2f2b32f30744b9d23f09aa3a9463165a75f7b778 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144076 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Reviewed-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins
Diffstat (limited to 'wizards')
-rw-r--r--wizards/source/scriptforge/SF_Dictionary.xba6
1 files changed, 5 insertions, 1 deletions
diff --git a/wizards/source/scriptforge/SF_Dictionary.xba b/wizards/source/scriptforge/SF_Dictionary.xba
index 367fc47553d8..22ada5148e2a 100644
--- a/wizards/source/scriptforge/SF_Dictionary.xba
+++ b/wizards/source/scriptforge/SF_Dictionary.xba
@@ -751,7 +751,11 @@ Const cstSubArgs = &quot;Key, Value&quot;
Check:
If SF_Utils._EnterFunction(cstThisSub, cstSubArgs) Then
If Not SF_Utils._Validate(Key, &quot;Key&quot;, V_STRING) Then GoTo Catch
- If Not SF_Utils._Validate(Value, &quot;Value&quot;) Then GoTo Catch
+ If IsArray(Value) Then
+ If Not SF_Utils._ValidateArray(Value, &quot;Value&quot;) Then GoTo Catch
+ Else
+ If Not SF_Utils._Validate(Value, &quot;Value&quot;) Then GoTo Catch
+ End If
End If
If Not Exists(Key) Then GoTo CatchUnknown