IDE: closing hidden designer form only on revert

git-svn-id: trunk@14916 -
This commit is contained in:
mattias 2008-04-21 09:27:38 +00:00
parent 62f6ee1fed
commit 963a81e03f
2 changed files with 8 additions and 13 deletions

View File

@ -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

View File

@ -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;