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@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2018-12-20 17:17:22 +03:00 committed by Alexandre Julliard
parent d4029a1acf
commit 5a622342d9
2 changed files with 2 additions and 2 deletions

View File

@ -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))

View File

@ -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;