Update cached object reference with new row count after inserting row, which may enable "Data" option in table copy dialog. Closes #666

This commit is contained in:
Ansgar Becker
2022-04-17 11:33:02 +02:00
parent 459925977d
commit 4eda10f726

View File

@@ -6033,6 +6033,7 @@ end;
procedure TMainForm.DisplayRowCountStats(Sender: TBaseVirtualTree);
var
DBObject: TDBObject;
ObjInCache: PDBObject;
IsFiltered, IsLimited: Boolean;
cap: String;
RowsTotal: Int64;
@@ -6065,6 +6066,13 @@ begin
else
cap := cap + ', ' + FormatNumber(Datagrid.RootNodeCount) + ' '+_('rows match to filter');
end;
// Update cached object reference with new row count, which may enable "Data" option
// in table copy dialog. See issue #666
if Assigned(DBtree.FocusedNode) then begin
ObjInCache := DBtree.GetNodeData(DBtree.FocusedNode);
if Assigned(ObjInCache) and ObjInCache.IsSameAs(DBObject) then
ObjInCache.Rows := RowsTotal;
end;
end;
end;
lblDataTop.Caption := cap;