wizards/source/scriptforge/SF_FileSystem.xba | 3 +++ wizards/source/scriptforge/SF_Utils.xba | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-)
New commits: commit ffbe4d480802a351a13ec70777e68e37c3c019eb Author: Jean-Pierre Ledure <[email protected]> AuthorDate: Wed Apr 12 16:27:59 2023 +0200 Commit: Jean-Pierre Ledure <[email protected]> CommitDate: Thu Apr 13 09:44:06 2023 +0200 ScriptForge (SF_FileSystem) tdf#154462 2nd call of PickFile() fails Error happens in gen and gtk3 modes. Does not happen in kf5 mode. Linux only. Windows OK. Patch on master: https://git.libreoffice.org/core/commit/9c60996fc2a536803d016d6f60f879f8a1e49a54 Change-Id: I2f28b389d33a62af969e9d48e398fa220f99d347 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150297 Tested-by: Jean-Pierre Ledure <[email protected]> Reviewed-by: Jean-Pierre Ledure <[email protected]> Tested-by: Jenkins diff --git a/wizards/source/scriptforge/SF_FileSystem.xba b/wizards/source/scriptforge/SF_FileSystem.xba index 21464c708fe5..d81465dbff13 100644 --- a/wizards/source/scriptforge/SF_FileSystem.xba +++ b/wizards/source/scriptforge/SF_FileSystem.xba @@ -1588,6 +1588,9 @@ Try: ' Get selected file iAccept = .Execute() If iAccept = com.sun.star.ui.dialogs.ExecutableDialogResults.OK Then sFile = .getSelectedFiles()(0) + + ' Do not reuse a FilePicker, side effects observed (a.o. TDF#154462) + .dispose() End With Finally: diff --git a/wizards/source/scriptforge/SF_Utils.xba b/wizards/source/scriptforge/SF_Utils.xba index 91b703c46431..23145cb991df 100644 --- a/wizards/source/scriptforge/SF_Utils.xba +++ b/wizards/source/scriptforge/SF_Utils.xba @@ -21,7 +21,7 @@ REM ===================================================================== GLOBAL Global _SF_ As Variant ' SF_Root (Basic) object) ''' ScriptForge version -Const SF_Version = "7.4" +Const SF_Version = "7.5" ''' Standard symbolic names for VarTypes ' V_EMPTY = 0 @@ -370,9 +370,7 @@ Dim oDefaultContext As Object End If Set _GetUNOService = .FileAccess Case "FilePicker" - If IsEmpty(.FilePicker) Or IsNull(.FilePicker) Then - Set .FilePicker = CreateUnoService("com.sun.star.ui.dialogs.FilePicker") - End If + Set .FilePicker = CreateUnoService("com.sun.star.ui.dialogs.FilePicker") ' Do not reuse an existing FilePicker: TDF#154462 Set _GetUNOService = .FilePicker Case "FilterFactory" If IsEmpty(.FilterFactory) Or IsNull(.FilterFactory) Then
