From 53ae156ba41b20db5ea36236522d926669db520f Mon Sep 17 00:00:00 2001 From: deepika-u Date: Mon, 20 Feb 2023 17:03:00 +0530 Subject: [PATCH] Added an option to overrule the last file dialog location on Windows #466 --- .../win32/org/eclipse/swt/widgets/FileDialog.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java index 4026c6bfbbc..c09ef6e4471 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java @@ -294,7 +294,12 @@ public String open () { char[] path = (filterPath.replace('/', '\\') + "\0").toCharArray(); if (COM.SHCreateItemFromParsingName(path, 0, COM.IID_IShellItem, ppv) == COM.S_OK) { IShellItem psi = new IShellItem(ppv[0]); - fileDialog.SetDefaultFolder(psi); + if (filterPath.length() > 0) { + fileDialog.SetFolder(psi); + } + else { + fileDialog.SetDefaultFolder(psi); + } psi.Release(); } }