Commit 95d8fc70 authored by Michael W. Vogel's avatar Michael W. Vogel
Browse files

AnchorDocking: Revert revision 54525 #6139a22b as it breaks other reloading...

AnchorDocking: Revert revision 54525 #6139a22b as it breaks other reloading of AnchorDocking layouts. Issue #31834

git-svn-id: trunk@55083 -
parent aa236dd4
......@@ -1465,40 +1465,13 @@ function TAnchorDockMaster.CloseUnneededControls(Tree: TAnchorDockLayoutTree
var
i: Integer;
AControl: TControl;
TreeNodeControl: TAnchorDockLayoutTreeNode;
function ParentsIdentical: Boolean;
var
ParentForm: TCustomForm;
ParentAnchorDockLayoutTreeNode: TAnchorDockLayoutTreeNode;
Parent1, Parent2: String;
begin
ParentForm := GetParentForm(AControl, True);
if Assigned(ParentForm) then
Parent1 := ParentForm.Name
else
Parent1 := '';
Parent2 := '';
ParentAnchorDockLayoutTreeNode := TreeNodeControl;
while Assigned(ParentAnchorDockLayoutTreeNode.Parent) do begin
Parent2 := ParentAnchorDockLayoutTreeNode.Name;
ParentAnchorDockLayoutTreeNode := ParentAnchorDockLayoutTreeNode.Parent;
end;
Result := Parent1 = Parent2;
// DebugLn('TAnchorDockMaster.ParentsIdentical [', Parent1, '] [', Parent2, ']');
end;
begin
i:=ControlCount-1;
while i>=0 do begin
AControl:=Controls[i];
TreeNodeControl:=Tree.Root.FindChildNode(AControl.Name,true);
if DockedControlIsVisible(AControl)
and (Application.MainForm<>AControl)
and ((TreeNodeControl=nil) or not ParentsIdentical)
then begin
and (Tree.Root.FindChildNode(AControl.Name,true)=nil)
and (Application.MainForm<>AControl) then begin
DisableControlAutoSizing(AControl);
// AControl is currently on a visible site, but not in the Tree
// => close site
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment