@@ -5062,7 +5062,7 @@ procedure TBaseVirtualTree.SetChildCount(Node: PVirtualNode; NewChildCount: Card
5062
5062
AdjustTotalHeight(Node, NewHeight, False);
5063
5063
5064
5064
AdjustTotalCount(Node, Count, True);
5065
- Node.ChildCount := NewChildCount;
5065
+ Node.SetChildCount( NewChildCount) ;
5066
5066
if (FUpdateCount = 0) and (toAutoSort in FOptions.AutoOptions) and (FHeader.SortColumn > InvalidColumn) then
5067
5067
Sort(Node, FHeader.SortColumn, FHeader.SortDirection, True);
5068
5068
@@ -5687,7 +5687,7 @@ procedure TBaseVirtualTree.SetRootNodeCount(Value: Cardinal);
5687
5687
// Don't set the root node count until all other properties (in particular the OnInitNode event) have been set.
5688
5688
if csLoading in ComponentState then
5689
5689
begin
5690
- FRoot.ChildCount := Value;
5690
+ FRoot.SetChildCount( Value) ;
5691
5691
DoStateChange([tsNeedRootCountUpdate]);
5692
5692
end
5693
5693
else
@@ -13864,7 +13864,7 @@ procedure TBaseVirtualTree.InternalConnectNode(Node, Destination: PVirtualNode;
13864
13864
Node.States := Node.States - [vsChecking, vsCutOrCopy, vsDeleting];
13865
13865
13866
13866
if (Mode <> amNoWhere) then begin
13867
- System.Inc (Node.Parent.ChildCount);
13867
+ Node.Parent.SetChildCount (Node.Parent.ChildCount + 1 );
13868
13868
Include(Node.Parent.States, vsHasChildren);
13869
13869
AdjustTotalCount(Node.Parent, Node.TotalCount, True);
13870
13870
@@ -13940,7 +13940,7 @@ procedure TBaseVirtualTree.InternalDisconnectNode(Node: PVirtualNode; KeepFocus:
13940
13940
// Some states are only temporary so take them out.
13941
13941
Node.States := Node.States - [vsChecking];
13942
13942
Parent := Node.Parent;
13943
- System.Dec (Parent.ChildCount);
13943
+ Parent.SetChildCount (Parent.ChildCount - 1 );
13944
13944
AdjustHeight := (vsExpanded in Parent.States) and (vsVisible in Node.States);
13945
13945
if Parent.ChildCount = 0 then
13946
13946
begin
@@ -14073,7 +14073,7 @@ procedure TBaseVirtualTree.Loaded;
14073
14073
IsReadOnly := toReadOnly in FOptions.MiscOptions;
14074
14074
FOptions.InternalSetMiscOptions(FOptions.MiscOptions - [toReadOnly]);
14075
14075
LastRootCount := FRoot.ChildCount;
14076
- FRoot.ChildCount := 0 ;
14076
+ FRoot.SetChildCount(0) ;
14077
14077
BeginUpdate;
14078
14078
SetChildCount(FRoot, LastRootCount);
14079
14079
EndUpdate;
@@ -15119,7 +15119,7 @@ function TBaseVirtualTree.ReadChunk(Stream: TStream; Version: Integer; Node: PVi
15119
15119
Align := ChunkBody.Align;
15120
15120
CheckState := ChunkBody.CheckState;
15121
15121
CheckType := ChunkBody.CheckType;
15122
- ChildCount := ChunkBody.ChildCount;
15122
+ SetChildCount( ChunkBody.ChildCount) ;
15123
15123
15124
15124
// Create and read child nodes.
15125
15125
while ChunkBody.ChildCount > 0 do
@@ -16901,7 +16901,7 @@ procedure TBaseVirtualTree.DeleteChildren(Node: PVirtualNode; ResetHasChildren:
16901
16901
Exclude(Node.States, vsHasChildren);
16902
16902
if Node <> FRoot then
16903
16903
Exclude(Node.States, vsExpanded);
16904
- Node.ChildCount := 0 ;
16904
+ Node.SetChildCount(0) ;
16905
16905
if (Node = FRoot) or (vsDeleting in Node.States) then
16906
16906
begin
16907
16907
Node.TotalHeight := FDefaultNodeHeight + NodeHeight[Node];
0 commit comments