mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-14 07:59:35 +02:00
docking: fix crash
git-svn-id: trunk@14008 -
This commit is contained in:
parent
6c623426f8
commit
016f6c1c6e
@ -167,16 +167,19 @@ end;
|
||||
|
||||
function TDockZone.FindZone(AControl: TControl): TDockZone;
|
||||
begin
|
||||
if AControl=ChildControl then begin
|
||||
Result:=Self;
|
||||
Result := nil;
|
||||
if AControl = ChildControl then
|
||||
begin
|
||||
Result := Self;
|
||||
exit;
|
||||
end;
|
||||
if FFirstChildZone<>nil then begin
|
||||
Result:=FFirstChildZone.FindZone(AControl);
|
||||
if Result<>nil then exit;
|
||||
if FFirstChildZone <> nil then
|
||||
begin
|
||||
Result := FFirstChildZone.FindZone(AControl);
|
||||
if Result <> nil then exit;
|
||||
end;
|
||||
if FNextSibling<>nil then
|
||||
Result:=FNextSibling.FindZone(AControl);
|
||||
if FNextSibling <> nil then
|
||||
Result := FNextSibling.FindZone(AControl);
|
||||
end;
|
||||
|
||||
function TDockZone.FirstVisibleChild: TDockZone;
|
||||
|
@ -651,7 +651,7 @@ begin
|
||||
DockCaption := DockSite.GetDockCaption(AControl);
|
||||
TextStyle.Alignment := taLeftJustify;
|
||||
TextStyle.SingleLine := True;
|
||||
TextStyle.Clipping := True;
|
||||
TextStyle.Clipping := False;
|
||||
TextStyle.Opaque := False;
|
||||
TextStyle.Wordbreak := False;
|
||||
TextStyle.SystemFont := False;
|
||||
@ -1064,13 +1064,16 @@ procedure TLazDockTree.RemoveControl(AControl: TControl);
|
||||
var
|
||||
RemoveZone: TLazDockZone;
|
||||
begin
|
||||
RemoveZone:=RootZone.FindZone(AControl) as TLazDockZone;
|
||||
if RemoveZone.ChildCount>0 then
|
||||
raise Exception.Create('TLazDockTree.RemoveControl RemoveZone.ChildCount>0');
|
||||
RemoveZone.FreeSubComponents;
|
||||
if RemoveZone.Parent<>nil then
|
||||
RemoveZone.Parent.Remove(RemoveZone);
|
||||
RemoveZone.Free;
|
||||
RemoveZone := RootZone.FindZone(AControl) as TLazDockZone;
|
||||
if RemoveZone <> nil then
|
||||
begin
|
||||
if RemoveZone.ChildCount>0 then
|
||||
raise Exception.Create('TLazDockTree.RemoveControl RemoveZone.ChildCount>0');
|
||||
RemoveZone.FreeSubComponents;
|
||||
if RemoveZone.Parent<>nil then
|
||||
RemoveZone.Parent.Remove(RemoveZone);
|
||||
RemoveZone.Free;
|
||||
end;
|
||||
|
||||
// Build dock layout (anchors, splitters, pages)
|
||||
BuildDockLayout(RootZone as TLazDockZone);
|
||||
|
Loading…
Reference in New Issue
Block a user