IDE: Fix a range error when two ActionListEditors have an action with same name. Patch from Anton, issue #19218

git-svn-id: trunk@30456 -
This commit is contained in:
juha 2011-04-24 20:21:37 +00:00
parent 0dcb68fda8
commit 12f497705c

View File

@ -377,10 +377,10 @@ end;
procedure TActionListEditor.OnComponentRenamed(AComponent: TComponent); procedure TActionListEditor.OnComponentRenamed(AComponent: TComponent);
begin begin
if (not Visible) or (FActionList=nil) if Visible and Assigned(FActionList)
or (not Assigned(FActionList.ActionByName(AComponent.Name))) and (AComponent is TAction) and (TAction(AComponent).ActionList = FActionList)
then Exit; and Assigned(FActionList.ActionByName(AComponent.Name)) then
lstActionName.Items[lstActionName.ItemIndex] := AComponent.Name; lstActionName.Items[lstActionName.ItemIndex] := AComponent.Name;
end; end;
procedure TActionListEditor.OnComponentSelection( procedure TActionListEditor.OnComponentSelection(