mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-18 14:29:34 +02:00
IDE: create package source: do not add unit with package unit name
git-svn-id: trunk@38194 -
This commit is contained in:
parent
ed1898fb75
commit
fa30c0d956
@ -4066,6 +4066,7 @@ var
|
||||
procedure UseUnit(AnUnitName: string);
|
||||
begin
|
||||
if AddedUnitNames.Contains(AnUnitName) then exit;
|
||||
if CompareDottedIdentifiers(PChar(AnUnitName),PChar(PkgUnitName))=0 then exit;
|
||||
AddedUnitNames.Add(AnUnitName,'');
|
||||
if UsedUnits<>'' then
|
||||
UsedUnits:=UsedUnits+', ';
|
||||
@ -4085,6 +4086,11 @@ begin
|
||||
exit;
|
||||
end;
|
||||
|
||||
// get unit name
|
||||
PkgUnitName := ExtractFileNameOnly(SrcFilename);
|
||||
if CompareDottedIdentifiers(PChar(APackage.Name), PChar(PkgUnitName))=0 then
|
||||
PkgUnitName := APackage.Name;
|
||||
|
||||
// collect unitnames
|
||||
e:=LineEnding;
|
||||
UsedUnits:='';
|
||||
@ -4166,9 +4172,6 @@ begin
|
||||
+' This source is only used to compile and install the package.'+e
|
||||
+' }'+e+e;
|
||||
// leave the unit case the same as the package name (e.g: package name LazReport, unit name lazreport)
|
||||
PkgUnitName := ExtractFileNameOnly(SrcFilename);
|
||||
if AnsiSameText(APackage.Name, PkgUnitName) then
|
||||
PkgUnitName := APackage.Name;
|
||||
Src:='unit '+ PkgUnitName +';'+e
|
||||
+e
|
||||
+'interface'+e
|
||||
|
Loading…
Reference in New Issue
Block a user