mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-27 01:00:29 +02:00
IdeIntf: Prevent a crash when Action is deleted in ActionsEditor. Issue #27624, patch from Anton.
git-svn-id: trunk@48187 -
This commit is contained in:
parent
dc0729c75b
commit
85dae0945d
@ -135,6 +135,7 @@ type
|
|||||||
protected
|
protected
|
||||||
procedure OnComponentRenamed(AComponent: TComponent);
|
procedure OnComponentRenamed(AComponent: TComponent);
|
||||||
procedure OnComponentSelection(const NewSelection: TPersistentSelectionList);
|
procedure OnComponentSelection(const NewSelection: TPersistentSelectionList);
|
||||||
|
procedure OnComponentDelete(APersistent: TPersistent);
|
||||||
procedure OnRefreshPropertyValues;
|
procedure OnRefreshPropertyValues;
|
||||||
function GetSelectedAction: TContainedAction;
|
function GetSelectedAction: TContainedAction;
|
||||||
procedure Notification(AComponent: TComponent; Operation: TOperation);
|
procedure Notification(AComponent: TComponent; Operation: TOperation);
|
||||||
@ -757,6 +758,16 @@ begin
|
|||||||
ACanvas.DrawFocusRect(ARect);
|
ACanvas.DrawFocusRect(ARect);
|
||||||
end;
|
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);
|
procedure TActionListEditor.SBShowMenuNewActionsClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
MousePoint: TPoint;
|
MousePoint: TPoint;
|
||||||
@ -891,6 +902,7 @@ begin
|
|||||||
GlobalDesignHook.AddHandlerComponentRenamed(@OnComponentRenamed);
|
GlobalDesignHook.AddHandlerComponentRenamed(@OnComponentRenamed);
|
||||||
GlobalDesignHook.AddHandlerSetSelection(@OnComponentSelection);
|
GlobalDesignHook.AddHandlerSetSelection(@OnComponentSelection);
|
||||||
GlobalDesignHook.AddHandlerRefreshPropertyValues(@OnRefreshPropertyValues);
|
GlobalDesignHook.AddHandlerRefreshPropertyValues(@OnRefreshPropertyValues);
|
||||||
|
GlobalDesignHook.AddHandlerPersistentDeleting(@OnComponentDelete);
|
||||||
|
|
||||||
AddActionEditor(Self);
|
AddActionEditor(Self);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user