Explorar o código

* Added move on TCollection (bug ID 32673)

git-svn-id: trunk@41795 -
michael %!s(int64=6) %!d(string=hai) anos
pai
achega
2669b68e6d
Modificáronse 2 ficheiros con 6 adicións e 0 borrados
  1. 1 0
      rtl/objpas/classes/classesh.inc
  2. 5 0
      rtl/objpas/classes/collect.inc

+ 1 - 0
rtl/objpas/classes/classesh.inc

@@ -561,6 +561,7 @@ type
     function Insert(Index: Integer): TCollectionItem;
     function FindItemID(ID: Integer): TCollectionItem;
     procedure Exchange(Const Index1, index2: integer);
+    procedure Move(Const Index1, index2: integer);
     procedure Sort(Const Compare : TCollectionSortCompare);
     property Count: Integer read GetCount;
     property ItemClass: TCollectionItemClass read FItemClass;

+ 5 - 0
rtl/objpas/classes/collect.inc

@@ -434,6 +434,11 @@ begin
     FPONotifyObservers(Self,ooChange,Nil);
 end;
 
+procedure TCollection.Move(const Index1, index2: integer);
+begin
+  Items[Index1].Index:=Index2;
+end;
+
 
 {****************************************************************************}
 {*                             TOwnedCollection                             *}