IDE+codetools: replaced some FindFile calls with LoadFile

git-svn-id: trunk@16775 -
This commit is contained in:
mattias 2008-09-28 13:15:51 +00:00
parent 0e57f86bb5
commit 2011685e93
5 changed files with 6 additions and 5 deletions

View File

@ -399,6 +399,7 @@ begin
NewBuffer.LastIncludedByFile:=FindIncludeLink(AFilename); NewBuffer.LastIncludedByFile:=FindIncludeLink(AFilename);
end else begin end else begin
NewBuffer.Source:=OldBuffer.Source; NewBuffer.Source:=OldBuffer.Source;
NewBuffer.IsDeleted:=false;
Result:=NewBuffer.Save; Result:=NewBuffer.Save;
end; end;
if not Result then exit; if not Result then exit;

View File

@ -1060,7 +1060,7 @@ begin
case CurrentPage of case CurrentPage of
cepCode: cepCode:
begin begin
CodeBuffer:=CodeToolBoss.FindFile(CodeFilename); CodeBuffer:=CodeToolBoss.LoadFile(CodeFilename,false,false);
if CodeBuffer=nil then exit; if CodeBuffer=nil then exit;
ACodeTool:=nil; ACodeTool:=nil;
CodeToolBoss.Explore(CodeBuffer,ACodeTool,false); CodeToolBoss.Explore(CodeBuffer,ACodeTool,false);
@ -1070,7 +1070,7 @@ begin
end; end;
cepDirectives: cepDirectives:
begin begin
CodeBuffer:=CodeToolBoss.FindFile(DirectivesFilename); CodeBuffer:=CodeToolBoss.LoadFile(DirectivesFilename,false,false);
if CodeBuffer=nil then exit; if CodeBuffer=nil then exit;
CodeBuffer.AbsoluteToLineCol(CurNode.StartPos,Caret.Y,Caret.X); CodeBuffer.AbsoluteToLineCol(CurNode.StartPos,Caret.Y,Caret.X);
if Caret.Y<1 then exit; if Caret.Y<1 then exit;

View File

@ -143,7 +143,7 @@ begin
for i := 0 to Project1.JumpHistory.Count -1 do begin for i := 0 to Project1.JumpHistory.Count -1 do begin
jh_item := Project1.JumpHistory.Items[i]; jh_item := Project1.JumpHistory.Items[i];
SrcLine:=''; SrcLine:='';
CodeBuf:=CodeToolBoss.FindFile(jh_item.Filename); CodeBuf:=CodeToolBoss.LoadFile(jh_item.Filename,false,False);
if CodeBuf<>nil then if CodeBuf<>nil then
SrcLine:=CodeBuf.GetLine(jh_item.CaretXY.Y-1); SrcLine:=CodeBuf.GetLine(jh_item.CaretXY.Y-1);
Filename:=jh_item.Filename; Filename:=jh_item.Filename;

View File

@ -312,7 +312,7 @@ procedure TQuickFixLinkerUndefinedReference.Execute(const Msg: TIDEMessageLine;
Error('no main file in project'); Error('no main file in project');
exit; exit;
end; end;
CodeBuf:=CodeToolBoss.FindFile(CurProject.MainFile.Filename); CodeBuf:=CodeToolBoss.LoadFile(CurProject.MainFile.Filename,true,false);
if (CodeBuf=nil) then begin if (CodeBuf=nil) then begin
Error('project main file has no source'); Error('project main file has no source');
exit; exit;

View File

@ -310,7 +310,7 @@ begin
lStartPos := StrToInt(lItem.SubItems[3]); lStartPos := StrToInt(lItem.SubItems[3]);
CodeBuffer := CodeToolBoss.FindFile(MainFilename); CodeBuffer := CodeToolBoss.LoadFile(MainFilename,false,false);
if CodeBuffer = nil then if CodeBuffer = nil then
Exit; //==> Exit; //==>