mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-16 04:49:25 +02:00
ide: fix creation of project .lrs files before the build if they does not exist (issue #0014620)
git-svn-id: trunk@21760 -
This commit is contained in:
parent
464c907ed3
commit
c7998ac533
@ -546,7 +546,7 @@ type
|
||||
// uses sections
|
||||
function FindUnitInAllUsesSections(Code: TCodeBuffer;
|
||||
const AnUnitName: string;
|
||||
out NamePos, InPos: integer): boolean;
|
||||
out NamePos, InPos: integer; const IgnoreMissingIncludeFiles: Boolean = False): boolean;
|
||||
function RenameUsedUnit(Code: TCodeBuffer;
|
||||
const OldUnitName, NewUnitName, NewUnitInFile: string): boolean;
|
||||
function ReplaceUsedUnits(Code: TCodeBuffer;
|
||||
@ -3879,8 +3879,10 @@ end;
|
||||
|
||||
function TCodeToolManager.FindUnitInAllUsesSections(Code: TCodeBuffer;
|
||||
const AnUnitName: string;
|
||||
out NamePos, InPos: integer): boolean;
|
||||
var NameAtomPos, InAtomPos: TAtomPosition;
|
||||
out NamePos, InPos: integer; const IgnoreMissingIncludeFiles: Boolean = False): boolean;
|
||||
var
|
||||
NameAtomPos, InAtomPos: TAtomPosition;
|
||||
OldIgnoreMissingIncludeFiles: Boolean;
|
||||
begin
|
||||
Result:=false;
|
||||
{$IFDEF CTDEBUG}
|
||||
@ -3890,7 +3892,9 @@ begin
|
||||
{$IFDEF CTDEBUG}
|
||||
DebugLn('TCodeToolManager.FindUnitInAllUsesSections B ',Code.Filename,' UnitName=',AnUnitName);
|
||||
{$ENDIF}
|
||||
OldIgnoreMissingIncludeFiles := FCurCodeTool.Scanner.IgnoreMissingIncludeFiles;
|
||||
try
|
||||
FCurCodeTool.Scanner.IgnoreMissingIncludeFiles := IgnoreMissingIncludeFiles;
|
||||
Result:=FCurCodeTool.FindUnitInAllUsesSections(UpperCaseStr(AnUnitName),
|
||||
NameAtomPos, InAtomPos);
|
||||
if Result then begin
|
||||
@ -3900,6 +3904,7 @@ begin
|
||||
except
|
||||
on e: Exception do Result:=HandleException(e);
|
||||
end;
|
||||
FCurCodeTool.Scanner.IgnoreMissingIncludeFiles := OldIgnoreMissingIncludeFiles;
|
||||
end;
|
||||
|
||||
function TCodeToolManager.RenameUsedUnit(Code: TCodeBuffer;
|
||||
|
@ -241,8 +241,7 @@ begin
|
||||
LastLrsFileName := lrsFileName;
|
||||
SetFileNames(MainFileName);
|
||||
|
||||
if UpdateSource then
|
||||
UpdateCanHaveLrsInclude(MainFileName);
|
||||
UpdateCanHaveLrsInclude(MainFileName);
|
||||
|
||||
try
|
||||
// update resources (FLazarusResources, FSystemResources, ...)
|
||||
@ -448,11 +447,11 @@ begin
|
||||
if CodeBuf = nil then
|
||||
Exit;
|
||||
|
||||
// Check that .lrs contains Forms and Interfaces in the uses section. If it does not
|
||||
// we cannot add LResources (it is not lazarus application)
|
||||
// Check that .lpr contains Forms and Interfaces in the uses section. If it does not
|
||||
// we cannot add LResources (it is not a lazarus application)
|
||||
FCanHaveLrsInclude :=
|
||||
CodeToolBoss.FindUnitInAllUsesSections(CodeBuf, 'Forms', NamePos, InPos) and
|
||||
CodeToolBoss.FindUnitInAllUsesSections(CodeBuf, 'Interfaces', NamePos, InPos);
|
||||
CodeToolBoss.FindUnitInAllUsesSections(CodeBuf, 'Forms', NamePos, InPos, True) and
|
||||
CodeToolBoss.FindUnitInAllUsesSections(CodeBuf, 'Interfaces', NamePos, InPos, True);
|
||||
end;
|
||||
|
||||
function TProjectResources.RenameDirectives(const CurFileName,
|
||||
|
Loading…
Reference in New Issue
Block a user