mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2026-01-08 09:31:42 +01:00
JBR-1273 Common Item Dialog does not open when wrong path to directory is passed
Handle set directory / set file properly
(cherry picked from commit b96492f7de)
This commit is contained in:
committed by
jbrbot
parent
c4b2f712f5
commit
1aea5f877c
@@ -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