LCL: fix regression in autosize after r56947 #9ecac75432. Issue #28654

git-svn-id: trunk@57082 -
This commit is contained in:
ondrej 2018-01-14 05:24:17 +00:00
parent 9d51568748
commit 81c4a099c2
2 changed files with 18 additions and 18 deletions

View File

@ -3017,13 +3017,16 @@ procedure TControl.DoAllAutoSize;
var
AWinControl: TWinControl;
i: Integer;
Needed: Boolean;
begin
if AControl.AutoSizeDelayed then exit;
Needed:=cfAutoSizeNeeded in AControl.FControlFlags;
//DebugLn(['TControl.DoAllAutoSize.AutoSizeControl ',DbgSName(AControl),' AutoSize=',AControl.AutoSize,' IsControlVisible=',AControl.IsControlVisible,' cfAutoSizeNeeded=',Needed]);
if AControl.IsControlVisible then
begin
if (cfAutoSizeNeeded in AControl.FControlFlags) and AControl.AutoSize and
Exclude(AControl.FControlFlags, cfAutoSizeNeeded);
if not AControl.IsControlVisible then exit;
if Needed and AControl.AutoSize and
(not ((AControl.Parent = nil) and (csDesigning in AControl.ComponentState)))
then
AControl.DoAutoSize;
@ -3037,8 +3040,6 @@ procedure TControl.DoAllAutoSize;
AutoSizeControl(AWinControl.Controls[i]);
end;
end;
Exclude(AControl.FControlFlags, cfAutoSizeNeeded);
end;
function CallAllOnResize(AControl: TControl): boolean;
// The OnResize event is called for Delphi compatibility after child resizes.

View File

@ -2554,8 +2554,6 @@ var
CurControl: TControl;
begin
Result := True;
if cfAutoSizeNeeded in FControlFlags then
Exit;
for I := ControlCount - 1 downto 0 do
begin
CurControl:=Controls[I];
@ -2563,6 +2561,7 @@ var
or (CurControl.Anchors <> [akLeft, akTop])
or (CurControl.AnchorSide[akLeft].Control<>nil)
or (CurControl.AnchorSide[akTop].Control<>nil)
or (cfAutoSizeNeeded in CurControl.FControlFlags)
or (ChildSizing.Layout<>cclNone)
then Exit;
end;