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:
juha 2011-09-15 17:22:16 +00:00
parent ad2d7983d8
commit ae9dead608

View File

@ -734,21 +734,18 @@ begin
ACanvas.Brush.Color := clHighlight;
ACanvas.Font.Color := clHighlightText;
end
else
begin
else begin
ACanvas.Brush.Color := clWindow;
ACanvas.Font.Color := clWindowText;
end;
AAction := TListBox(Control).Items.Objects[Index] as TCustomAction;
S := TListBox(Control).Items[Index];
R := ARect;
dh := R.Bottom - R.Top;
ACanvas.FillRect(R);
inc(R.Left, 2);
if FActionList.Images <> nil then
begin
if (TListBox(Control).Items.Objects[Index] is TCustomAction)
and (FActionList.Images <> nil) then begin
AAction := TListBox(Control).Items.Objects[Index] as TCustomAction;
S := TListBox(Control).Items[Index];
R.Right := R.Left + dh;
if AAction.ImageIndex <> -1 then
begin