mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 11:59:20 +02:00
lcl: prevent setbounds infinite loop (bug #0014474)
git-svn-id: trunk@21521 -
This commit is contained in:
parent
5c235ca5a6
commit
b66b9e6cb4
@ -107,7 +107,12 @@ begin
|
|||||||
NewHeight := Height;
|
NewHeight := Height;
|
||||||
|
|
||||||
//debugln('TCustomLabel.DoAutoSize ',dbgsName(Self),' Anchored ',dbgs(Left),',',dbgs(Top),',w=',dbgs(NewWidth),',h=',dbgs(NewHeight));
|
//debugln('TCustomLabel.DoAutoSize ',dbgsName(Self),' Anchored ',dbgs(Left),',',dbgs(Top),',w=',dbgs(NewWidth),',h=',dbgs(NewHeight));
|
||||||
|
FInternalSetBounds := True;
|
||||||
|
try
|
||||||
SetBoundsKeepBase(Left, Top, NewWidth, NewHeight);
|
SetBoundsKeepBase(Left, Top, NewWidth, NewHeight);
|
||||||
|
finally
|
||||||
|
FInternalSetBounds := False;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomLabel.SetAlignment(Value : TAlignment);
|
procedure TCustomLabel.SetAlignment(Value : TAlignment);
|
||||||
@ -211,6 +216,7 @@ begin
|
|||||||
ControlStyle := [csSetCaption, csClickEvents, csDoubleClicks, csReplicatable];
|
ControlStyle := [csSetCaption, csClickEvents, csDoubleClicks, csReplicatable];
|
||||||
SetInitialBounds(0, 0, GetControlClassDefaultSize.X, GetControlClassDefaultSize.Y);
|
SetInitialBounds(0, 0, GetControlClassDefaultSize.X, GetControlClassDefaultSize.Y);
|
||||||
FShowAccelChar := True;
|
FShowAccelChar := True;
|
||||||
|
FInternalSetBounds := False;
|
||||||
Color := clNone;
|
Color := clNone;
|
||||||
AutoSize := True;
|
AutoSize := True;
|
||||||
end;
|
end;
|
||||||
@ -478,7 +484,7 @@ end;
|
|||||||
|
|
||||||
procedure TCustomLabel.SetBounds(aLeft, aTop, aWidth, aHeight: integer);
|
procedure TCustomLabel.SetBounds(aLeft, aTop, aWidth, aHeight: integer);
|
||||||
begin
|
begin
|
||||||
if AutoSize and WordWrap then
|
if not FInternalSetBounds and AutoSize and WordWrap then
|
||||||
InvalidatePreferredSize;
|
InvalidatePreferredSize;
|
||||||
inherited SetBounds(aLeft, aTop, aWidth, aHeight);
|
inherited SetBounds(aLeft, aTop, aWidth, aHeight);
|
||||||
end;
|
end;
|
||||||
|
@ -1363,6 +1363,7 @@ type
|
|||||||
FShowAccelChar: Boolean;
|
FShowAccelChar: Boolean;
|
||||||
FWordWrap: Boolean;
|
FWordWrap: Boolean;
|
||||||
FLayout: TTextLayout;
|
FLayout: TTextLayout;
|
||||||
|
FInternalSetBounds: Boolean;
|
||||||
procedure SetAlignment(Value: TAlignment);
|
procedure SetAlignment(Value: TAlignment);
|
||||||
procedure SetOptimalFill(const AValue: Boolean);
|
procedure SetOptimalFill(const AValue: Boolean);
|
||||||
protected
|
protected
|
||||||
|
Loading…
Reference in New Issue
Block a user