Merge pull request #4651 from RaiKoHoff/Dev_Master

Fix: in case of no file args: open empty doc instead of file open dialog
This commit is contained in:
Pairi Daiza 2023-03-15 10:12:21 +01:00 committed by GitHub
commit bec665c252
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1823,13 +1823,13 @@ HWND InitInstance(const HINSTANCE hInstance, int nCmdShow)
// Pathname parameter
Path_CanonicalizeEx(hfile_pth, Paths.WorkingDirectory);
if (s_IsThisAnElevatedRelaunch || (Path_IsNotEmpty(hfile_pth) /*&& !g_flagNewFromClipboard*/)) {
if (s_IsThisAnElevatedRelaunch || (Path_IsNotEmpty(s_pthArgFilePath) /*&& !g_flagNewFromClipboard*/))
{
fLoadFlags |= Settings.SkipUnicodeDetection ? FLF_SkipUnicodeDetect : 0;
fLoadFlags |= Settings.SkipANSICodePageDetection ? FLF_SkipANSICPDetection : 0;
// Open from Directory
Path_CanonicalizeEx(hfile_pth, Paths.WorkingDirectory);
if (!s_IsThisAnElevatedRelaunch && Path_IsExistingDirectory(hfile_pth)) {
if (OpenFileDlg(Globals.hwndMain, hfile_pth, hfile_pth)) {