IDE: compiler options: restoring old options when Ok failed

git-svn-id: trunk@14427 -
This commit is contained in:
mattias 2008-03-05 12:53:29 +00:00
parent b0e8ed453a
commit afa9baafa7

View File

@ -737,14 +737,14 @@ var
AdditionalConfig: String;
OldPath: String;
begin
Result:=true;
Result:=false;
// Put the compiler options from the dialog into the TCompilerOptions class
if DestCompilerOptions<>nil then
Options:=DestCompilerOptions
else
Options:=CompilerOpts;
if ReadOnly and (Options=CompilerOpts) then exit;
if ReadOnly and (Options=CompilerOpts) then exit(true);
NewDontUseConfigFile:=not chkConfigFile.Checked;
NewCustomConfigFile:=chkCustomConfigFile.Checked;
@ -777,6 +777,7 @@ begin
OldCompOpts := TBaseCompilerOptionsClass(Options.ClassType).Create(nil);
OldCompOpts.Assign(Options);
try
// paths
OldPath:=Options.GetIncludePath(false);
@ -966,13 +967,19 @@ begin
);
end;
// check for change and save
// check for change and mark as modified
if not OldCompOpts.IsEqual(Options) then begin
Options.Modified:=true;
IncreaseCompilerParseStamp;
end;
Result:=true;
finally
if not Result then begin
Options.Assign(OldCompOpts);
end;
OldCompOpts.Free;
end;
end;
function TfrmCompilerOptions.PutCompilerOptions(
CheckAndWarn: TCheckCompileOptionsMsgLvl): boolean;