mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 19:20:08 +02:00
IDE: compiler options: restoring old options when Ok failed
git-svn-id: trunk@14427 -
This commit is contained in:
parent
b0e8ed453a
commit
afa9baafa7
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user