IDE: create package source: do not add unit with package unit name

git-svn-id: trunk@38194 -
This commit is contained in:
mattias 2012-08-07 07:24:20 +00:00
parent ed1898fb75
commit fa30c0d956

View File

@ -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