wizards/source/sfdatabases/SF_Datasheet.xba | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-)
New commits: commit 56ab74cdf90880dbf756c6ee32135a02a98a6ec7 Author: Jean-Pierre Ledure <j...@ledure.be> AuthorDate: Thu Dec 15 17:39:33 2022 +0100 Commit: Jean-Pierre Ledure <j...@ledure.be> CommitDate: Fri Dec 16 11:03:41 2022 +0000 ScriptForge - (SF_Datasheet) default values in GetText() and GetValue() Before this commit, the 'column' argument was manadatory. Now the argument becomes optional and designates the current column, i.e. the column containing the cursor. Additionally, when a datasheet is closed by code, any filter is better removed to avoid eventual user misunderstandings when the datasheet is reopened manually during the same session. Change-Id: I904cfa56a9407539a89b7d2451dcf6b45292f660 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144242 Tested-by: Jean-Pierre Ledure <j...@ledure.be> Reviewed-by: Jean-Pierre Ledure <j...@ledure.be> Tested-by: Jenkins diff --git a/wizards/source/sfdatabases/SF_Datasheet.xba b/wizards/source/sfdatabases/SF_Datasheet.xba index 681f9549b814..12b7f9e4f9c0 100644 --- a/wizards/source/sfdatabases/SF_Datasheet.xba +++ b/wizards/source/sfdatabases/SF_Datasheet.xba @@ -258,7 +258,11 @@ Check: If Not _IsStillAlive() Then GoTo Finally Try: - _TabControllerModel.close() + With _TabControllerModel + .ApplyFilter = False + .Filter = "" + .close() + End With _Frame.close(True) _Frame.dispose() Dispose() @@ -398,6 +402,8 @@ Try: If Column >= 1 Then lMaxCol = .Count - 1 If Column > lMaxCol + 1 Then lCol = lMaxCol Else lCol = Column - 1 + Else + lCol = .getCurrentColumnPosition() End If End If @@ -452,11 +458,15 @@ Try: If VarType(Column) = V_STRING Then lCol = ScriptForge.SF_Array.IndexOf(_ColumnHeaders, Column, CaseSensitive := False) + 1 Else - lCol = 0 - If Column >= 1 Then - lMaxCol = _ControlView.Count - If Column > lMaxCol Then lCol = lMaxCol Else lCol = Column - End If + With _ControlView + lCol = 0 + If Column >= 1 Then + lMaxCol = .Count + If Column > lMaxCol Then lCol = lMaxCol Else lCol = Column + Else + lCol = .getCurrentColumnPosition() + 1 + End If + End With End If ' The _TabControllerModel acts exactly as a result set, from which the generic _GetColumnValue can extract the searched value