Browse Source

* Fix wrong start/stop index

git-svn-id: trunk@44635 -
michael 5 years ago
parent
commit
2dfc5b160b
1 changed files with 4 additions and 4 deletions
  1. 4 4
      rtl/objpas/classes/stringl.inc

+ 4 - 4
rtl/objpas/classes/stringl.inc

@@ -1033,8 +1033,8 @@ begin
   Result:=Nil;
   Result:=Nil;
   if aStart>aEnd then exit;
   if aStart>aEnd then exit;
   SetLength(Result,aEnd-aStart+1);
   SetLength(Result,aEnd-aStart+1);
-  For I:=0 to Count-1 do
-    Result[i]:=Objects[i];
+  For I:=aStart to aEnd do
+    Result[i-aStart]:=Objects[i];
 end;
 end;
 
 
 function TStrings.ToStringArray: TStringDynArray;
 function TStrings.ToStringArray: TStringDynArray;
@@ -1052,8 +1052,8 @@ begin
   Result:=Nil;
   Result:=Nil;
   if aStart>aEnd then exit;
   if aStart>aEnd then exit;
   SetLength(Result,aEnd-aStart+1);
   SetLength(Result,aEnd-aStart+1);
-  For I:=0 to Count-1 do
-    Result[i]:=Strings[i];
+  For I:=aStart to aEnd do
+    Result[i-aStart]:=Strings[i];
 end;
 end;