Object Inspector: Prevent adding the same parent candidates repeatedly for "Change Parent" menu.

git-svn-id: trunk@49427 -
This commit is contained in:
juha 2015-06-24 09:29:48 +00:00
parent 795eed89a4
commit 75347d7f7c

View File

@ -5278,17 +5278,16 @@ var
Candidates: TFPList;
i: Integer;
begin
Result := False;
Candidates := GetChangeParentCandidates;
try
if Candidates.Count = 0 then Exit;
Result := Candidates.Count>0;
ChangeParentPopupmenuItem.Clear;
for i := 0 to Candidates.Count-1 do
begin
Item := NewItem(TWinControl(Candidates[i]).Name, 0, False, True,
@DoChangeParentItemClick, 0, '');
ChangeParentPopupmenuItem.Add(Item);
end;
Result := True;
finally
Candidates.Free;
end;