mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 11:09:19 +02:00
* pas2jni: Fixed handling of array type properties.
git-svn-id: trunk@32611 -
This commit is contained in:
parent
c0eafe38aa
commit
c797d6ac1e
@ -1022,9 +1022,19 @@ var
|
|||||||
vt: TDef;
|
vt: TDef;
|
||||||
s, ss: string;
|
s, ss: string;
|
||||||
i: integer;
|
i: integer;
|
||||||
|
isarray, isdynarray: boolean;
|
||||||
begin
|
begin
|
||||||
if not d.IsUsed then
|
if not d.IsUsed then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
isarray:=(d.VarType <> nil) and (d.VarType.DefType = dtArray);
|
||||||
|
isdynarray:=isarray and (TArrayDef(d.VarType).RangeHigh < TArrayDef(d.VarType).RangeLow);
|
||||||
|
if isdynarray then
|
||||||
|
if not (voRead in d.VarOpt) then
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
d.VarOpt:=d.VarOpt + [voWrite];
|
||||||
|
|
||||||
if d.VarType <> nil then begin
|
if d.VarType <> nil then begin
|
||||||
case d.DefType of
|
case d.DefType of
|
||||||
dtVar:
|
dtVar:
|
||||||
@ -1051,7 +1061,7 @@ begin
|
|||||||
pd.Parent:=d.Parent;
|
pd.Parent:=d.Parent;
|
||||||
pd.ProcType:=ptFunction;
|
pd.ProcType:=ptFunction;
|
||||||
pd.Name:='get' + d.Name;
|
pd.Name:='get' + d.Name;
|
||||||
if (d.VarType <> nil) and (d.VarType.DefType = dtArray) then
|
if isarray then
|
||||||
// Array var
|
// Array var
|
||||||
pd.ReturnType:=_WriteArrayIndex(pd)
|
pd.ReturnType:=_WriteArrayIndex(pd)
|
||||||
else begin
|
else begin
|
||||||
@ -1081,9 +1091,12 @@ begin
|
|||||||
pd.ProcType:=ptProcedure;
|
pd.ProcType:=ptProcedure;
|
||||||
pd.Name:='set' + d.Name;
|
pd.Name:='set' + d.Name;
|
||||||
vt:=d.VarType;;
|
vt:=d.VarType;;
|
||||||
if (d.VarType <> nil) and (d.VarType.DefType = dtArray) then
|
if isarray then begin
|
||||||
// Array var
|
// Array var
|
||||||
vt:=_WriteArrayIndex(pd)
|
if (d.DefType = dtProp) and not isdynarray then
|
||||||
|
exit;
|
||||||
|
vt:=_WriteArrayIndex(pd);
|
||||||
|
end
|
||||||
else
|
else
|
||||||
if d.DefType = dtProp then begin
|
if d.DefType = dtProp then begin
|
||||||
for i:=0 to d.Count - 1 do begin
|
for i:=0 to d.Count - 1 do begin
|
||||||
|
Loading…
Reference in New Issue
Block a user