mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2026-01-08 01:21:42 +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
Vitaly Provodin
parent
3c21b80f93
commit
b80bb31f59
@@ -738,16 +738,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