mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 08:30:58 +02:00
IDE: closing hidden designer form only on revert
git-svn-id: trunk@14916 -
This commit is contained in:
parent
62f6ee1fed
commit
963a81e03f
19
ide/main.pp
19
ide/main.pp
@ -5258,12 +5258,6 @@ var
|
|||||||
LFMFilename: string;
|
LFMFilename: string;
|
||||||
LFMBuf: TCodeBuffer;
|
LFMBuf: TCodeBuffer;
|
||||||
begin
|
begin
|
||||||
Result:=CloseUnitComponent(AnUnitInfo,CloseFlags);
|
|
||||||
if Result<>mrOk then begin
|
|
||||||
DebugLn(['TMainIDE.DoLoadLFM failed due to CloseUnitComponent for file ',AnUnitInfo.Filename]);
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
|
|
||||||
// Note: think about virtual and normal .lfm files.
|
// Note: think about virtual and normal .lfm files.
|
||||||
LFMFilename:=ChangeFileExt(AnUnitInfo.Filename,'.lfm');
|
LFMFilename:=ChangeFileExt(AnUnitInfo.Filename,'.lfm');
|
||||||
LFMBuf:=nil;
|
LFMBuf:=nil;
|
||||||
@ -5280,8 +5274,7 @@ begin
|
|||||||
Result:=LoadIDECodeBuffer(LFMBuf,LFMFilename,[lbfUpdateFromDisk]);
|
Result:=LoadIDECodeBuffer(LFMBuf,LFMFilename,[lbfUpdateFromDisk]);
|
||||||
if Result<>mrOk then exit;
|
if Result<>mrOk then exit;
|
||||||
|
|
||||||
Result:=DoLoadLFM(AnUnitInfo,LFMBuf,OpenFlags,
|
Result:=DoLoadLFM(AnUnitInfo,LFMBuf,OpenFlags,CloseFlags);
|
||||||
CloseFlags-[cfSaveFirst,cfSaveDependencies]);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TMainIDE.DoLoadLFM(AnUnitInfo: TUnitInfo; LFMBuf: TCodeBuffer;
|
function TMainIDE.DoLoadLFM(AnUnitInfo: TUnitInfo; LFMBuf: TCodeBuffer;
|
||||||
@ -5303,10 +5296,12 @@ var
|
|||||||
begin
|
begin
|
||||||
debugln('TMainIDE.DoLoadLFM A ',AnUnitInfo.Filename,' IsPartOfProject=',dbgs(AnUnitInfo.IsPartOfProject),' ');
|
debugln('TMainIDE.DoLoadLFM A ',AnUnitInfo.Filename,' IsPartOfProject=',dbgs(AnUnitInfo.IsPartOfProject),' ');
|
||||||
|
|
||||||
// close old designer form
|
if ofRevert in OpenFlags then begin
|
||||||
Result:=CloseUnitComponent(AnUnitInfo,CloseFlags);
|
// close old designer form
|
||||||
if Result<>mrOk then exit;
|
Result:=CloseUnitComponent(AnUnitInfo,CloseFlags);
|
||||||
|
if Result<>mrOk then exit;
|
||||||
|
end;
|
||||||
|
|
||||||
// check installed packages
|
// check installed packages
|
||||||
if (AnUnitInfo.Component=nil) and AnUnitInfo.IsPartOfProject
|
if (AnUnitInfo.Component=nil) and AnUnitInfo.IsPartOfProject
|
||||||
and (not (ofProjectLoading in OpenFlags)) then begin
|
and (not (ofProjectLoading in OpenFlags)) then begin
|
||||||
|
@ -77,7 +77,7 @@ type
|
|||||||
cfQuiet,
|
cfQuiet,
|
||||||
cfProjectClosing,
|
cfProjectClosing,
|
||||||
cfCloseDependencies,
|
cfCloseDependencies,
|
||||||
cfSaveDependencies // set cfSaveFirst to closing the dependencies
|
cfSaveDependencies // set cfSaveFirst to close the dependencies
|
||||||
);
|
);
|
||||||
TCloseFlags = set of TCloseFlag;
|
TCloseFlags = set of TCloseFlag;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user