diff options
author | Jean-Pierre Ledure <jp@ledure.be> | 2022-05-15 17:51:45 +0200 |
---|---|---|
committer | Jean-Pierre Ledure <jp@ledure.be> | 2022-05-16 16:22:55 +0200 |
commit | f9fa11e1c273e6aeba0d7656d518eaea0b14890b (patch) | |
tree | c3e48c578285131e1c9bdfb3f1e58927a4b3b16e /wizards | |
parent | 4ebfd85322beffed953db01121a45c4a8a12cd59 (diff) |
ScriptForge - (SF_Calc) FIX CompactUp/Left whan range is 1 row/col
When the range to compact spans only 1 row (CompactUp)
or 1 column (CompactLeft), a GetValue() method returns
a scalar and not an array as expected in usual cases.
This caused an abort of the script when invoking the
UBound() value of the returned array with a Basic run-time error
Object variable not set
A test on being scalar or array of the result of
the GetValue() method avoids the error.
To be done in both CompactXXX() methods.
Impact only on Basic code. Python not involved.
No changes due in documentation.
Change-Id: I74cf2b274944b442f843e1f4b7ac3a05dd6eaae7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134352
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/source/sfdocuments/SF_Calc.xba | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/wizards/source/sfdocuments/SF_Calc.xba b/wizards/source/sfdocuments/SF_Calc.xba index bc17d4abe578..4b42163753bb 100644 --- a/wizards/source/sfdocuments/SF_Calc.xba +++ b/wizards/source/sfdocuments/SF_Calc.xba @@ -714,6 +714,7 @@ Try: SetFormula(sFormulaRange, FilterFormula) ' Get the columns to compact: 0 = False, 1 = True vCompact = GetValue(sFormulaRange) + If Not IsArray(vCompact) Then vCompact = Array(vCompact) ClearAll(sFormulaRange) ' Iterates from the last to the first column of the range and remove the columns that match the filter @@ -823,6 +824,7 @@ Try: SetFormula(sFormulaRange, FilterFormula) ' Get the rows to compact: 0 = False, 1 = True vCompact = GetValue(sFormulaRange) + If Not IsArray(vCompact) Then vCompact = Array(vCompact) ClearAll(sFormulaRange) ' Iterates from the last to the first row of the range and remove the rows that match the filter |