@@ -5062,7 +5062,7 @@ procedure TBaseVirtualTree.SetChildCount(Node: PVirtualNode; NewChildCount: Card
50625062 AdjustTotalHeight(Node, NewHeight, False);
50635063
50645064 AdjustTotalCount(Node, Count, True);
5065- Node.ChildCount := NewChildCount;
5065+ Node.SetChildCount( NewChildCount) ;
50665066 if (FUpdateCount = 0) and (toAutoSort in FOptions.AutoOptions) and (FHeader.SortColumn > InvalidColumn) then
50675067 Sort(Node, FHeader.SortColumn, FHeader.SortDirection, True);
50685068
@@ -5687,7 +5687,7 @@ procedure TBaseVirtualTree.SetRootNodeCount(Value: Cardinal);
56875687 // Don't set the root node count until all other properties (in particular the OnInitNode event) have been set.
56885688 if csLoading in ComponentState then
56895689 begin
5690- FRoot.ChildCount := Value;
5690+ FRoot.SetChildCount( Value) ;
56915691 DoStateChange([tsNeedRootCountUpdate]);
56925692 end
56935693 else
@@ -13864,7 +13864,7 @@ procedure TBaseVirtualTree.InternalConnectNode(Node, Destination: PVirtualNode;
1386413864 Node.States := Node.States - [vsChecking, vsCutOrCopy, vsDeleting];
1386513865
1386613866 if (Mode <> amNoWhere) then begin
13867- System.Inc (Node.Parent.ChildCount);
13867+ Node.Parent.SetChildCount (Node.Parent.ChildCount + 1 );
1386813868 Include(Node.Parent.States, vsHasChildren);
1386913869 AdjustTotalCount(Node.Parent, Node.TotalCount, True);
1387013870
@@ -13940,7 +13940,7 @@ procedure TBaseVirtualTree.InternalDisconnectNode(Node: PVirtualNode; KeepFocus:
1394013940 // Some states are only temporary so take them out.
1394113941 Node.States := Node.States - [vsChecking];
1394213942 Parent := Node.Parent;
13943- System.Dec (Parent.ChildCount);
13943+ Parent.SetChildCount (Parent.ChildCount - 1 );
1394413944 AdjustHeight := (vsExpanded in Parent.States) and (vsVisible in Node.States);
1394513945 if Parent.ChildCount = 0 then
1394613946 begin
@@ -14073,7 +14073,7 @@ procedure TBaseVirtualTree.Loaded;
1407314073 IsReadOnly := toReadOnly in FOptions.MiscOptions;
1407414074 FOptions.InternalSetMiscOptions(FOptions.MiscOptions - [toReadOnly]);
1407514075 LastRootCount := FRoot.ChildCount;
14076- FRoot.ChildCount := 0 ;
14076+ FRoot.SetChildCount(0) ;
1407714077 BeginUpdate;
1407814078 SetChildCount(FRoot, LastRootCount);
1407914079 EndUpdate;
@@ -15119,7 +15119,7 @@ function TBaseVirtualTree.ReadChunk(Stream: TStream; Version: Integer; Node: PVi
1511915119 Align := ChunkBody.Align;
1512015120 CheckState := ChunkBody.CheckState;
1512115121 CheckType := ChunkBody.CheckType;
15122- ChildCount := ChunkBody.ChildCount;
15122+ SetChildCount( ChunkBody.ChildCount) ;
1512315123
1512415124 // Create and read child nodes.
1512515125 while ChunkBody.ChildCount > 0 do
@@ -16901,7 +16901,7 @@ procedure TBaseVirtualTree.DeleteChildren(Node: PVirtualNode; ResetHasChildren:
1690116901 Exclude(Node.States, vsHasChildren);
1690216902 if Node <> FRoot then
1690316903 Exclude(Node.States, vsExpanded);
16904- Node.ChildCount := 0 ;
16904+ Node.SetChildCount(0) ;
1690516905 if (Node = FRoot) or (vsDeleting in Node.States) then
1690616906 begin
1690716907 Node.TotalHeight := FDefaultNodeHeight + NodeHeight[Node];
0 commit comments