mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 14:19:22 +02:00
IDE: replaced unitname compare functions for checking ambiguous units
git-svn-id: trunk@12801 -
This commit is contained in:
parent
9210c88cc5
commit
8a8085d7af
@ -37,7 +37,7 @@ uses
|
|||||||
// LCL
|
// LCL
|
||||||
LCLProc, Dialogs, FileUtil, Forms, Controls,
|
LCLProc, Dialogs, FileUtil, Forms, Controls,
|
||||||
// codetools
|
// codetools
|
||||||
CodeToolManager, DefineTemplates,
|
BasicCodeTools, CodeToolManager, DefineTemplates,
|
||||||
// IDEIntf
|
// IDEIntf
|
||||||
SrcEditorIntf, ProjectIntf, MacroIntf, IDEDialogs, IDEExternToolIntf,
|
SrcEditorIntf, ProjectIntf, MacroIntf, IDEDialogs, IDEExternToolIntf,
|
||||||
LazIDEIntf,
|
LazIDEIntf,
|
||||||
@ -156,13 +156,14 @@ type
|
|||||||
|
|
||||||
function CompareUnitFiles(UnitFile1, UnitFile2: PUnitFile): integer;
|
function CompareUnitFiles(UnitFile1, UnitFile2: PUnitFile): integer;
|
||||||
begin
|
begin
|
||||||
Result:=CompareText(UnitFile1^.UnitName,UnitFile2^.UnitName);
|
Result:=CompareIdentifierPtrs(Pointer(UnitFile1^.UnitName),
|
||||||
|
Pointer(UnitFile2^.UnitName));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CompareUnitNameAndUnitFile(UnitName: PChar;
|
function CompareUnitNameAndUnitFile(UnitName: PChar;
|
||||||
UnitFile: PUnitFile): integer;
|
UnitFile: PUnitFile): integer;
|
||||||
begin
|
begin
|
||||||
Result:=CompareStringPointerI(UnitName,PChar(UnitFile^.UnitName));
|
Result:=CompareIdentifierPtrs(Pointer(UnitName),Pointer(UnitFile^.UnitName));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TBuildManager }
|
{ TBuildManager }
|
||||||
@ -785,6 +786,8 @@ begin
|
|||||||
else
|
else
|
||||||
continue;
|
continue;
|
||||||
CurUnitName:=ExtractFilenameOnly(FileInfo.Name);
|
CurUnitName:=ExtractFilenameOnly(FileInfo.Name);
|
||||||
|
if (CurUnitName='') or (not IsValidIdent(CurUnitName)) then
|
||||||
|
continue;
|
||||||
CurFilename:=CurDir+FileInfo.Name;
|
CurFilename:=CurDir+FileInfo.Name;
|
||||||
// check if unit already found
|
// check if unit already found
|
||||||
ANode:=CurUnitTree.FindKey(PChar(CurUnitName),
|
ANode:=CurUnitTree.FindKey(PChar(CurUnitName),
|
||||||
@ -981,11 +984,11 @@ function TBuildManager.MacroFuncProject(const Param: string; const Data: PtrInt;
|
|||||||
var Abort: boolean): string;
|
var Abort: boolean): string;
|
||||||
begin
|
begin
|
||||||
if Project1<>nil then begin
|
if Project1<>nil then begin
|
||||||
if CompareText(Param,'SrcPath')=0 then
|
if SysUtils.CompareText(Param,'SrcPath')=0 then
|
||||||
Result:=Project1.CompilerOptions.GetSrcPath(false)
|
Result:=Project1.CompilerOptions.GetSrcPath(false)
|
||||||
else if CompareText(Param,'IncPath')=0 then
|
else if SysUtils.CompareText(Param,'IncPath')=0 then
|
||||||
Result:=Project1.CompilerOptions.GetIncludePath(false)
|
Result:=Project1.CompilerOptions.GetIncludePath(false)
|
||||||
else if CompareText(Param,'UnitPath')=0 then
|
else if SysUtils.CompareText(Param,'UnitPath')=0 then
|
||||||
Result:=Project1.CompilerOptions.GetUnitPath(false)
|
Result:=Project1.CompilerOptions.GetUnitPath(false)
|
||||||
else begin
|
else begin
|
||||||
Result:='<Invalid parameter for macro Project:'+Param+'>';
|
Result:='<Invalid parameter for macro Project:'+Param+'>';
|
||||||
|
Loading…
Reference in New Issue
Block a user