mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Workaround to avoid exceptions in FindNode() when an Int64 from TDBQuery.RecNo comes in and gets compared to the Cardinal typed VTree.Node.Index.
This commit is contained in:
@ -1610,20 +1610,17 @@ var
|
|||||||
begin
|
begin
|
||||||
// Helper to find a node by its index
|
// Helper to find a node by its index
|
||||||
Result := nil;
|
Result := nil;
|
||||||
// Grid.RootNodeCount is unfortunately Cardinal, not Int64.
|
if Assigned(ParentNode) then
|
||||||
// Work around that as long as VT does not change that.
|
Node := VT.GetFirstChild(ParentNode)
|
||||||
if (idx >= Low(Cardinal)) or (idx <= High(Cardinal)) then begin
|
else
|
||||||
if Assigned(ParentNode) then
|
Node := VT.GetFirst;
|
||||||
Node := VT.GetFirstChild(ParentNode)
|
while Assigned(Node) do begin
|
||||||
else
|
// Note: Grid.RootNodeCount is unfortunately Cardinal, not UInt64.
|
||||||
Node := VT.GetFirst;
|
if Node.Index = idx then begin
|
||||||
while Assigned(Node) do begin
|
Result := Node;
|
||||||
if Node.Index = idx then begin
|
break;
|
||||||
Result := Node;
|
|
||||||
break;
|
|
||||||
end;
|
|
||||||
Node := VT.GetNextSibling(Node);
|
|
||||||
end;
|
end;
|
||||||
|
Node := VT.GetNextSibling(Node);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user