Selaa lähdekoodia

* patch by Bart Broersma, simplify TStringList.InsertItem, resolves #23860

git-svn-id: trunk@23638 -
florian 12 vuotta sitten
vanhempi
commit
b00ff8a4e0
1 muutettua tiedostoa jossa 1 lisäystä ja 10 poistoa
  1. 1 10
      rtl/objpas/classes/stringl.inc

+ 1 - 10
rtl/objpas/classes/stringl.inc

@@ -1017,16 +1017,7 @@ end;
 
 Procedure TStringList.InsertItem(Index: Integer; const S: string);
 begin
-  Changing;
-  If FCount=Fcapacity then Grow;
-  If Index<FCount then
-    System.Move (FList^[Index],FList^[Index+1],
-                 (FCount-Index)*SizeOf(TStringItem));
-  Pointer(Flist^[Index].Fstring):=Nil;  // Needed to initialize...
-  Flist^[Index].FString:=S;
-  Flist^[Index].Fobject:=Nil;
-  Inc(FCount);
-  Changed;
+  InsertItem(Index, S, nil);
 end;