mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 19:52:26 +02:00
IDE: load designer form: fixed loading .pas or .pp
git-svn-id: trunk@40098 -
This commit is contained in:
parent
2e47a30822
commit
2c1a0a9089
@ -643,7 +643,7 @@ type
|
||||
function RemoveUnitFromAllUsesSections(Code: TCodeBuffer;
|
||||
const AnUnitName: string): boolean;
|
||||
function FindUsedUnitFiles(Code: TCodeBuffer; var MainUsesSection: TStrings
|
||||
): boolean; // only main uses section
|
||||
): boolean; // only main uses section, if unit not found, returns "unitname" or "unitname in 'filename'"
|
||||
function FindUsedUnitFiles(Code: TCodeBuffer; var MainUsesSection,
|
||||
ImplementationUsesSection: TStrings): boolean;
|
||||
function FindUsedUnitNames(Code: TCodeBuffer; var MainUsesSection,
|
||||
|
@ -4517,6 +4517,7 @@ var
|
||||
begin
|
||||
Result:=false;
|
||||
TheModalResult:=mrCancel;
|
||||
if not FilenameIsPascalSource(UnitFilename) then exit;
|
||||
CurLFMFilename:=ChangeFileExt(UnitFilename,'.lfm');
|
||||
if not FileExistsUTF8(CurLFMFilename) then
|
||||
CurLFMFilename:=ChangeFileExt(UnitFilename,'.dfm');
|
||||
@ -4679,6 +4680,7 @@ var
|
||||
begin
|
||||
Result:=false;
|
||||
TheModalResult:=mrCancel;
|
||||
if not FilenameIsPascalSource(UnitFilename) then exit;
|
||||
AncestorClassName:='';
|
||||
Code:=CodeToolBoss.LoadFile(UnitFilename,true,false);
|
||||
if Code=nil then begin
|
||||
@ -4831,6 +4833,9 @@ function TLazSourceFileManager.LoadComponentDependencyHidden(
|
||||
end;
|
||||
end else begin
|
||||
// load unit source
|
||||
UnitFilename:=ChangeFileExt(LFMFilename,'.pas');
|
||||
if not FileExistsUTF8(UnitFilename) then
|
||||
UnitFilename:=ChangeFileExt(LFMFilename,'.pp');
|
||||
TheModalResult:=LoadCodeBuffer(UnitCode,UnitFilename,[lbfCheckIfText],true);
|
||||
if TheModalResult<>mrOk then exit(TheModalResult=mrAbort);
|
||||
// create unit info
|
||||
|
Loading…
Reference in New Issue
Block a user