mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-15 11:01:08 +08:00
Tree.Parent is in a special case a form, but it could also turn into some panel or whatever in the future. Be more stable when detecting the origin of the tree.
This commit is contained in:
@ -6657,7 +6657,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
lntTable, lntView:
|
lntTable, lntView:
|
||||||
if Sender.Parent is TfrmSelectDBObject then begin
|
if GetParentFormOrFrame(Sender) is TfrmSelectDBObject then begin
|
||||||
Columns := TTableColumnList.Create(True);
|
Columns := TTableColumnList.Create(True);
|
||||||
DBObj.Connection.ParseTableStructure(DBObj.CreateCode, Columns, nil, nil);
|
DBObj.Connection.ParseTableStructure(DBObj.CreateCode, Columns, nil, nil);
|
||||||
ChildCount := Columns.Count;
|
ChildCount := Columns.Count;
|
||||||
@ -6693,8 +6693,8 @@ begin
|
|||||||
2: begin
|
2: begin
|
||||||
DBObjects := FConnections[Node.Parent.Parent.Index].GetDBObjects(FConnections[Node.Parent.Parent.Index].AllDatabases[Node.Parent.Index]);
|
DBObjects := FConnections[Node.Parent.Parent.Index].GetDBObjects(FConnections[Node.Parent.Parent.Index].AllDatabases[Node.Parent.Index]);
|
||||||
Item^ := DBObjects[Node.Index];
|
Item^ := DBObjects[Node.Index];
|
||||||
if (Sender.Parent is TfrmSelectDBObject) and (Item.NodeType in [lntTable, lntView]) then
|
if (GetParentFormOrFrame(Sender) is TfrmSelectDBObject) and (Item.NodeType in [lntTable, lntView]) then
|
||||||
InitialStates := InitialStates + [ivsHasChildren];
|
Include(InitialStates, ivsHasChildren);
|
||||||
end;
|
end;
|
||||||
3: begin
|
3: begin
|
||||||
Item^ := TDBObject.Create(FConnections[Node.Parent.Parent.Parent.Index]);
|
Item^ := TDBObject.Create(FConnections[Node.Parent.Parent.Parent.Index]);
|
||||||
|
Reference in New Issue
Block a user