diff options
author | Jean-Pierre Ledure <jp@ledure.be> | 2022-12-13 11:23:49 +0100 |
---|---|---|
committer | Jean-Pierre Ledure <jp@ledure.be> | 2022-12-13 14:40:13 +0000 |
commit | 57e2245abf50cbd207d5c9c57ed67c055f8afcd6 (patch) | |
tree | ac92ab427c70fc6e90f605d4fcc95836ba3df165 /wizards | |
parent | 65fa248f9a9504747a63698746350db139ae53ce (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.
Change-Id: I667abc81cb712308764c342d0e74b95821e46a5f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144041
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.xba | 6 |
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 = "Key, Value" Check: If SF_Utils._EnterFunction(cstThisSub, cstSubArgs) Then If Not SF_Utils._Validate(Key, "Key", V_STRING) Then GoTo Catch - If Not SF_Utils._Validate(Value, "Value") Then GoTo Catch + If IsArray(Value) Then + If Not SF_Utils._ValidateArray(Value, "Value") Then GoTo Catch + Else + If Not SF_Utils._Validate(Value, "Value") Then GoTo Catch + End If End If If Not Exists(Key) Then GoTo CatchUnknown |