mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-15 21:46:12 +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 jt = 'obj' then begin
|
||||||
if it.Strings['ObjType'] <> 'class' then
|
if it.Strings['ObjType'] <> 'class' then
|
||||||
continue;
|
continue;
|
||||||
// Exclude class?
|
|
||||||
if FOnCheckItem(AUnitName + '.' + CurObjName) = crExclude then
|
|
||||||
continue;
|
|
||||||
d:=TClassDef.Create(CurDef, dtClass);
|
d:=TClassDef.Create(CurDef, dtClass);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -446,11 +443,6 @@ var
|
|||||||
dtClass:
|
dtClass:
|
||||||
with TClassDef(d) do begin
|
with TClassDef(d) do begin
|
||||||
AncestorClass:=TClassDef(_GetRef(it.Get('Ancestor', TJSONObject(nil)), TClassDef));
|
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');
|
_ReadDefs(d, it, 'Fields');
|
||||||
end;
|
end;
|
||||||
dtRecord:
|
dtRecord:
|
||||||
|
@ -1250,6 +1250,28 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TWriter.WriteUnit(u: TUnitDef);
|
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
|
var
|
||||||
d: TDef;
|
d: TDef;
|
||||||
i: integer;
|
i: integer;
|
||||||
@ -1262,6 +1284,9 @@ begin
|
|||||||
if not u.IsUsed then
|
if not u.IsUsed then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
if AnsiCompareText(u.Name, 'system') <> 0 then
|
||||||
|
_ExcludeClasses(nil);
|
||||||
|
|
||||||
for i:=0 to High(u.UsedUnits) do
|
for i:=0 to High(u.UsedUnits) do
|
||||||
WriteUnit(u.UsedUnits[i]);
|
WriteUnit(u.UsedUnits[i]);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user