Commit 85dae094 authored by Juha Manninen's avatar Juha Manninen
Browse files

IdeIntf: Prevent a crash when Action is deleted in ActionsEditor. Issue #27624, patch from Anton.

git-svn-id: trunk@48187 -
parent dc0729c7
......@@ -135,6 +135,7 @@ type
protected
procedure OnComponentRenamed(AComponent: TComponent);
procedure OnComponentSelection(const NewSelection: TPersistentSelectionList);
procedure OnComponentDelete(APersistent: TPersistent);
procedure OnRefreshPropertyValues;
function GetSelectedAction: TContainedAction;
procedure Notification(AComponent: TComponent; Operation: TOperation);
......@@ -757,6 +758,16 @@ begin
ACanvas.DrawFocusRect(ARect);
end;
procedure TActionListEditor.OnComponentDelete(APersistent: TPersistent);
var
i: Integer;
begin
if not (APersistent is TContainedAction) then Exit;
i := lstActionName.Items.IndexOfObject(APersistent);
if i >= 0 then
lstActionName.Items.Delete(i);
end;
procedure TActionListEditor.SBShowMenuNewActionsClick(Sender: TObject);
var
MousePoint: TPoint;
......@@ -891,6 +902,7 @@ begin
GlobalDesignHook.AddHandlerComponentRenamed(@OnComponentRenamed);
GlobalDesignHook.AddHandlerSetSelection(@OnComponentSelection);
GlobalDesignHook.AddHandlerRefreshPropertyValues(@OnRefreshPropertyValues);
GlobalDesignHook.AddHandlerPersistentDeleting(@OnComponentDelete);
AddActionEditor(Self);
end;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment