ide: load unit source buffer if it was not loaded before in LoadDependencyHidden, improve verbosity

git-svn-id: trunk@14848 -
This commit is contained in:
paul 2008-04-16 08:28:44 +00:00
parent c2db5ffa0f
commit b70cfb3a82
2 changed files with 13 additions and 1 deletions

View File

@ -1454,6 +1454,8 @@ begin
MainCode:=GetMainCode(Code);
if MainCode=nil then begin
fErrorMsg:='TCodeToolManager.InitCurCodeTool MainCode=nil';
if Code = nil then
fErrorMsg := fErrorMsg + ' Code=nil';
exit;
end;
if MainCode.Scanner=nil then begin

View File

@ -5592,7 +5592,7 @@ var
function LoadDependencyHidden(const RefRootName: string): TModalResult;
var
LFMFilename: String;
LFMCode: TCodeBuffer;
UnitCode, LFMCode: TCodeBuffer;
ModalResult: TModalResult;
UnitFilename: String;
RefUnitInfo: TUnitInfo;
@ -5620,6 +5620,16 @@ var
Project1.AddFile(RefUnitInfo,false);
end;
if RefUnitInfo.Source = nil then
begin
ModalResult := LoadCodeBuffer(UnitCode, UnitFileName, [lbfCheckIfText]);
if ModalResult<>mrOk then begin
debugln('TMainIDE.DoFixupComponentReferences Failed loading ',UnitFilename);
exit(mrCancel);
end;
RefUnitInfo.Source := UnitCode;
end;
// load resource hidden
Result:=DoLoadLFM(RefUnitInfo,LFMCode,
OpenFlags+[ofLoadHiddenResource],[]);