mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-15 08:06:04 +02:00
* pas2jni: Fixed exclusion of descendant classes.
git-svn-id: trunk@29152 -
This commit is contained in:
parent
5790650a36
commit
7860959a13
@ -308,9 +308,6 @@ var
|
||||
if jt = 'obj' then begin
|
||||
if it.Strings['ObjType'] <> 'class' then
|
||||
continue;
|
||||
// Exclude class?
|
||||
if FOnCheckItem(AUnitName + '.' + CurObjName) = crExclude then
|
||||
continue;
|
||||
d:=TClassDef.Create(CurDef, dtClass);
|
||||
end
|
||||
else
|
||||
@ -446,11 +443,6 @@ var
|
||||
dtClass:
|
||||
with TClassDef(d) do begin
|
||||
AncestorClass:=TClassDef(_GetRef(it.Get('Ancestor', TJSONObject(nil)), TClassDef));
|
||||
if (AncestorClass <> nil) and (AncestorClass.DefType = dtNone) then begin
|
||||
// Ancestor class has been excluded
|
||||
FreeAndNil(d);
|
||||
continue;
|
||||
end;
|
||||
_ReadDefs(d, it, 'Fields');
|
||||
end;
|
||||
dtRecord:
|
||||
|
@ -1250,6 +1250,28 @@ begin
|
||||
end;
|
||||
|
||||
procedure TWriter.WriteUnit(u: TUnitDef);
|
||||
|
||||
procedure _ExcludeClasses(AAncestorClass: TClassDef);
|
||||
var
|
||||
i: integer;
|
||||
d: TDef;
|
||||
s: string;
|
||||
begin
|
||||
for i:=0 to u.Count - 1 do begin
|
||||
d:=u[i];
|
||||
if d.DefType = dtClass then begin
|
||||
s:=u.Name + '.' + d.Name;
|
||||
if (TClassDef(d).AncestorClass = AAncestorClass) or
|
||||
( (AAncestorClass = nil) and (DoCheckItem(u.Name + '.' + d.Name) = crExclude) )
|
||||
then begin
|
||||
d.SetNotUsed;
|
||||
ExcludeList.Add(s);
|
||||
_ExcludeClasses(TClassDef(d));
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
var
|
||||
d: TDef;
|
||||
i: integer;
|
||||
@ -1262,6 +1284,9 @@ begin
|
||||
if not u.IsUsed then
|
||||
exit;
|
||||
|
||||
if AnsiCompareText(u.Name, 'system') <> 0 then
|
||||
_ExcludeClasses(nil);
|
||||
|
||||
for i:=0 to High(u.UsedUnits) do
|
||||
WriteUnit(u.UsedUnits[i]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user