mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-21 11:49:57 +01:00
IDE: Fix crash when TContainedAction instead of TCustomAction is added to ActionList. Issue #20242, patch from Andrew G. Khodotov
git-svn-id: trunk@32355 -
This commit is contained in:
parent
ad2d7983d8
commit
ae9dead608
@ -734,21 +734,18 @@ begin
|
|||||||
ACanvas.Brush.Color := clHighlight;
|
ACanvas.Brush.Color := clHighlight;
|
||||||
ACanvas.Font.Color := clHighlightText;
|
ACanvas.Font.Color := clHighlightText;
|
||||||
end
|
end
|
||||||
else
|
else begin
|
||||||
begin
|
|
||||||
ACanvas.Brush.Color := clWindow;
|
ACanvas.Brush.Color := clWindow;
|
||||||
ACanvas.Font.Color := clWindowText;
|
ACanvas.Font.Color := clWindowText;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
AAction := TListBox(Control).Items.Objects[Index] as TCustomAction;
|
|
||||||
S := TListBox(Control).Items[Index];
|
|
||||||
|
|
||||||
R := ARect;
|
R := ARect;
|
||||||
dh := R.Bottom - R.Top;
|
dh := R.Bottom - R.Top;
|
||||||
ACanvas.FillRect(R);
|
ACanvas.FillRect(R);
|
||||||
inc(R.Left, 2);
|
inc(R.Left, 2);
|
||||||
if FActionList.Images <> nil then
|
if (TListBox(Control).Items.Objects[Index] is TCustomAction)
|
||||||
begin
|
and (FActionList.Images <> nil) then begin
|
||||||
|
AAction := TListBox(Control).Items.Objects[Index] as TCustomAction;
|
||||||
|
S := TListBox(Control).Items[Index];
|
||||||
R.Right := R.Left + dh;
|
R.Right := R.Left + dh;
|
||||||
if AAction.ImageIndex <> -1 then
|
if AAction.ImageIndex <> -1 then
|
||||||
begin
|
begin
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user