mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-08-26 19:30:34 +02:00
* Set children length to zero after clearing
This commit is contained in:
parent
38a6cfc3f9
commit
b83a5f1fd5
@ -976,6 +976,7 @@ ResourceString
|
|||||||
SErrUnknownTemplateGroup = 'Unknown template group item: "%s"';
|
SErrUnknownTemplateGroup = 'Unknown template group item: "%s"';
|
||||||
SErrDuplicateTemplateGroup = 'Duplicate template group item: "%s"';
|
SErrDuplicateTemplateGroup = 'Duplicate template group item: "%s"';
|
||||||
SErrNoGroupInNonGroupTemplate = 'Group name can only be used group value template';
|
SErrNoGroupInNonGroupTemplate = 'Group name can only be used group value template';
|
||||||
|
|
||||||
{ TSimpleLoopTemplateGroup }
|
{ TSimpleLoopTemplateGroup }
|
||||||
|
|
||||||
procedure TSimpleLoopTemplateGroup.SetGroupValueTemplate(AValue: String);
|
procedure TSimpleLoopTemplateGroup.SetGroupValueTemplate(AValue: String);
|
||||||
@ -1085,9 +1086,6 @@ begin
|
|||||||
inherited Assign(Source);
|
inherited Assign(Source);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TLoopTemplateValue }
|
|
||||||
|
|
||||||
|
|
||||||
{ TListLoopTemplateWidget.TPropListLoopEnumerator }
|
{ TListLoopTemplateWidget.TPropListLoopEnumerator }
|
||||||
|
|
||||||
function TListLoopTemplateWidget.TPropListLoopEnumerator.GetValue(const aName: String): String;
|
function TListLoopTemplateWidget.TPropListLoopEnumerator.GetValue(const aName: String): String;
|
||||||
@ -1217,19 +1215,12 @@ begin
|
|||||||
FList:=aValue;
|
FList:=aValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Type
|
|
||||||
THackList = class(TList)
|
|
||||||
Public
|
|
||||||
Property List;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TListLoopTemplateWidget.GetArray: TJSArray;
|
function TListLoopTemplateWidget.GetArray: TJSArray;
|
||||||
|
|
||||||
Var
|
Var
|
||||||
I : integer;
|
I : integer;
|
||||||
C : TCollection;
|
C : TCollection;
|
||||||
FL : TFPList;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Case FListKind of
|
Case FListKind of
|
||||||
lkCollection :
|
lkCollection :
|
||||||
@ -1357,7 +1348,7 @@ end;
|
|||||||
procedure TCustomLoopTemplateWidget.SetGroups(AValue: TLoopTemplateGroupList);
|
procedure TCustomLoopTemplateWidget.SetGroups(AValue: TLoopTemplateGroupList);
|
||||||
begin
|
begin
|
||||||
if FGroups=AValue then Exit;
|
if FGroups=AValue then Exit;
|
||||||
FGroups:=AValue;
|
FGroups.Assign(AValue);
|
||||||
if IsRendered then
|
if IsRendered then
|
||||||
Refresh;
|
Refresh;
|
||||||
end;
|
end;
|
||||||
@ -1379,7 +1370,7 @@ end;
|
|||||||
function TCustomLoopTemplateWidget.RenderGroupHeaders(aEnum : TLoopEnumerator) : String;
|
function TCustomLoopTemplateWidget.RenderGroupHeaders(aEnum : TLoopEnumerator) : String;
|
||||||
|
|
||||||
Var
|
Var
|
||||||
GrpIdx,J : Integer;
|
GrpIdx: Integer;
|
||||||
grp : TLoopTemplateGroup;
|
grp : TLoopTemplateGroup;
|
||||||
StartGroups : Boolean;
|
StartGroups : Boolean;
|
||||||
S,V : String;
|
S,V : String;
|
||||||
@ -1457,6 +1448,7 @@ end;
|
|||||||
|
|
||||||
destructor TCustomLoopTemplateWidget.Destroy;
|
destructor TCustomLoopTemplateWidget.Destroy;
|
||||||
begin
|
begin
|
||||||
|
FreeAndNil(FGroups);
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2174,17 +2166,23 @@ procedure TCustomWebWidget.InvalidateParentElement;
|
|||||||
|
|
||||||
Var
|
Var
|
||||||
I : Integer;
|
I : Integer;
|
||||||
|
C : TCustomWebWidget;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
FParentElement:=nil;
|
FParentElement:=nil;
|
||||||
For I:=0 to ChildCount-1 do
|
For I:=0 to ChildCount-1 do
|
||||||
Children[i].InvalidateParentElement;
|
begin
|
||||||
|
C:=Children[i];
|
||||||
|
if Assigned(C) then // Can be Nil
|
||||||
|
C.InvalidateParentElement;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomWebWidget.InvalidateElement;
|
procedure TCustomWebWidget.InvalidateElement;
|
||||||
|
|
||||||
Var
|
Var
|
||||||
I : Integer;
|
I : Integer;
|
||||||
|
C : TCustomWebWidget;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
If FStyles.Count>0 then
|
If FStyles.Count>0 then
|
||||||
@ -2193,7 +2191,11 @@ begin
|
|||||||
FReferences.FRefs:=Nil;
|
FReferences.FRefs:=Nil;
|
||||||
FElement:=nil;
|
FElement:=nil;
|
||||||
For I:=0 to ChildCount-1 do
|
For I:=0 to ChildCount-1 do
|
||||||
Children[i].InvalidateElement;
|
begin
|
||||||
|
C:=Children[i];
|
||||||
|
if Assigned(C) then // Can be Nil
|
||||||
|
C.InvalidateElement;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomWebWidget.WidgetClasses: String;
|
function TCustomWebWidget.WidgetClasses: String;
|
||||||
@ -2899,6 +2901,7 @@ begin
|
|||||||
FChildren[i]:=Nil;
|
FChildren[i]:=Nil;
|
||||||
C.Free;
|
C.Free;
|
||||||
end;
|
end;
|
||||||
|
FChildren.Length:=0;
|
||||||
Parent:=Nil;
|
Parent:=Nil;
|
||||||
ParentID:='';
|
ParentID:='';
|
||||||
FChildren:=Nil;
|
FChildren:=Nil;
|
||||||
|
Loading…
Reference in New Issue
Block a user