From 8db456be207816f0e474739115585c1a4f0131a8 Mon Sep 17 00:00:00 2001 From: juha Date: Thu, 16 Jan 2014 18:28:44 +0000 Subject: [PATCH] IDE: Prevent AV with typing a non-existent file name for Convert Delphi Unit. Issue #25538 git-svn-id: trunk@43735 - --- ide/main.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ide/main.pp b/ide/main.pp index b3623b8538..6deeabb1ac 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -4506,9 +4506,9 @@ begin try InputHistories.ApplyFileDialogSettings(OpenDialog); OpenDialog.Title:=lisChooseDelphiUnit; + OpenDialog.Options:=OpenDialog.Options+[ofPathMustExist,ofFileMustExist,ofAllowMultiSelect]; OpenDialog.Filter:=lisDelphiUnit+' (*.pas)|*.pas|'+ dlgAllFiles+' ('+GetAllFilesMask+')|' + GetAllFilesMask; - OpenDialog.Options:=OpenDialog.Options+[ofAllowMultiSelect]; if InputHistories.LastConvertDelphiUnit<>'' then begin OpenDialog.InitialDir:=ExtractFilePath(InputHistories.LastConvertDelphiUnit); OpenDialog.Filename :=ExtractFileName(InputHistories.LastConvertDelphiUnit); @@ -4543,6 +4543,7 @@ begin try InputHistories.ApplyFileDialogSettings(OpenDialog); OpenDialog.Title:=lisChooseDelphiProject; + OpenDialog.Options:=OpenDialog.Options+[ofPathMustExist,ofFileMustExist]; OpenDialog.Filter:=lisDelphiProject+' (*.dpr)|*.dpr|'+ lisLazarusProject+' (*.lpr)|*.lpr|'+ dlgAllFiles+' ('+GetAllFilesMask+')|' + GetAllFilesMask; @@ -4572,6 +4573,7 @@ begin try InputHistories.ApplyFileDialogSettings(OpenDialog); OpenDialog.Title:=lisChooseDelphiPackage; + OpenDialog.Options:=OpenDialog.Options+[ofPathMustExist,ofFileMustExist]; OpenDialog.Filter:=lisDelphiPackage+' (*.dpk)|*.dpk|'+ dlgAllFiles+' ('+GetAllFilesMask+')|' + GetAllFilesMask; if InputHistories.LastConvertDelphiPackage<>'' then begin