Dmitry Timoshkov : comdlg32: When FOS_PICKFOLDERS is specified item selection box should contain full path name.

Alexandre Julliard julliard at winehq.org
Thu Dec 20 14:25:27 CST 2018


Module: wine
Branch: master
Commit: 5a622342d9e658e0db880d79c1412c79e53a74c4
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=5a622342d9e658e0db880d79c1412c79e53a74c4

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Thu Dec 20 17:17:22 2018 +0300

comdlg32: When FOS_PICKFOLDERS is specified item selection box should contain full path name.

Otherwise when selecting a folder using IFileOpenDialog interface
the caller instead of C:\Temp receives C:\Temp\Temp. This matches
both an old GetOpenFileName behaviour and what IFileOpenDialog returns
under Windows.

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comdlg32/filedlg.c | 2 +-
 dlls/comdlg32/itemdlg.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c
index deae866..541410c 100644
--- a/dlls/comdlg32/filedlg.c
+++ b/dlls/comdlg32/filedlg.c
@@ -639,7 +639,7 @@ void COMDLG32_GetCanonicalPath(PCIDLIST_ABSOLUTE pidlAbsCurrent,
   }
   PathAddBackslashW(lpstrPathAndFile);
 
-  TRACE("current directory=%s\n", debugstr_w(lpstrPathAndFile));
+  TRACE("current directory=%s, file=%s\n", debugstr_w(lpstrPathAndFile), debugstr_w(lpstrFile));
 
   /* if the user specified a fully qualified path use it */
   if(PathIsRelativeW(lpstrFile))
diff --git a/dlls/comdlg32/itemdlg.c b/dlls/comdlg32/itemdlg.c
index ff97ae2..5f36d2b 100644
--- a/dlls/comdlg32/itemdlg.c
+++ b/dlls/comdlg32/itemdlg.c
@@ -424,7 +424,7 @@ static void fill_filename_from_selection(FileDialogImpl *This)
                 (!(This->options & FOS_PICKFOLDERS) &&  (attr & SFGAO_FOLDER))))
                 continue;
 
-            hr = IShellItem_GetDisplayName(psi, SIGDN_PARENTRELATIVEPARSING, &names[valid_count]);
+            hr = IShellItem_GetDisplayName(psi, (This->options & FOS_PICKFOLDERS) ? SIGDN_FILESYSPATH : SIGDN_PARENTRELATIVEPARSING, &names[valid_count]);
             if(SUCCEEDED(hr))
             {
                 len_total += lstrlenW(names[valid_count]) + 3;




More information about the wine-cvs mailing list