mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
JBR-1273 Common Item Dialog does not open when wrong path to directory is passed
Handle set directory / set file properly
This commit is contained in:
committed by
alexey.ushakov@jetbrains.com
parent
b802473cc3
commit
2f694a75e6
@@ -749,16 +749,23 @@ AwtFileDialog::Show(void *p)
|
||||
OLE_HRT(pfd->SetFileTypes(s_fileFilterCount, s_fileFilterSpec));
|
||||
OLE_HRT(pfd->SetFileTypeIndex(1));
|
||||
|
||||
IShellItemPtr directoryItem;
|
||||
OLE_NEXT_TRY
|
||||
OLE_HRT(CreateShellItem(directoryBuffer, directoryItem));
|
||||
OLE_HRT(pfd->SetFolder(directoryItem));
|
||||
OLE_CATCH
|
||||
|
||||
CoTaskStringHolder shortName = GetShortName(fileBuffer);
|
||||
if (shortName) {
|
||||
OLE_HRT(pfd->SetFileName(shortName));
|
||||
{
|
||||
IShellItemPtr directoryItem;
|
||||
OLE_TRY
|
||||
OLE_HRT(CreateShellItem(directoryBuffer, directoryItem));
|
||||
OLE_HRT(pfd->SetFolder(directoryItem));
|
||||
OLE_CATCH
|
||||
}
|
||||
|
||||
{
|
||||
CoTaskStringHolder shortName = GetShortName(fileBuffer);
|
||||
if (shortName) {
|
||||
OLE_TRY
|
||||
OLE_HRT(pfd->SetFileName(shortName));
|
||||
OLE_CATCH
|
||||
}
|
||||
}
|
||||
|
||||
OLE_CATCH
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user