From fc82b28dc73770efdea8a3b8dd8d86e43064c23b Mon Sep 17 00:00:00 2001 From: paul Date: Wed, 2 Dec 2009 03:34:16 +0000 Subject: [PATCH] ideintf: simplify component treeview get caption method git-svn-id: trunk@22917 - --- ideintf/componenttreeview.pas | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/ideintf/componenttreeview.pas b/ideintf/componenttreeview.pas index c143e6b420..2c30ffa392 100644 --- a/ideintf/componenttreeview.pas +++ b/ideintf/componenttreeview.pas @@ -601,16 +601,6 @@ end; function TComponentTreeView.CreateNodeCaption(APersistent: TPersistent): string; - function GetItemIndex(AItem: TCollectionItem): Integer; - var - i: integer; - begin - for i := 0 to AItem.Collection.Count - 1 do - if AItem.Collection.Items[i] = AItem then - Exit(i); - Result := -1; - end; - function GetCollectionName(ACollection: TCollection): String; var PropList: PPropList; @@ -644,9 +634,7 @@ begin Result := GetCollectionName(TCollection(APersistent)) + ': ' + Result else if APersistent is TCollectionItem then - begin - Result := IntToStr(GetItemIndex(TCollectionItem(APersistent))) + ' - ' + TCollectionItem(APersistent).DisplayName; - end; + Result := IntToStr(TCollectionItem(APersistent).Index) + ' - ' + TCollectionItem(APersistent).DisplayName; end; initialization