replaced array of with pointer of integer for 1.0.10

git-svn-id: trunk@6638 -
This commit is contained in:
mattias 2005-01-18 22:35:51 +00:00
parent cc5ecdae5c
commit 03115ff293

View File

@ -148,32 +148,34 @@ var
Lines: TStringList; Lines: TStringList;
AList, AList,
BList: TStringList; BList: TStringList;
Indents: array of Integer; Indents: ^Integer;
X, Y: Integer; X, Y: Integer;
EqPos: Integer; EqPos: Integer;
ALine: String; ALine: String;
begin begin
Lines := TStringList.Create; Lines := TStringList.Create;
SetLength(Indents, ALines.Count); if ALines.Count>0 then begin
GetMem(Indents,SizeOf(Integer)*ALines.Count);
// Put a line on multiple lines, on one line // Put a line on multiple lines, on one line
ALine := ''; ALine := '';
for X := 0 to ALines.Count-1 do begin for X := 0 to ALines.Count-1 do begin
ALine := ALine + ALines.Strings[X]; ALine := ALine + ALines.Strings[X];
if IsAWholeLine(ALine) then begin if IsAWholeLine(ALine) then begin
Indents[Lines.Add(ALine)] := GetIndent(ALine); Indents[Lines.Add(ALine)] := GetIndent(ALine);
ALine := ''; ALine := '';
end;
end; end;
// exited the loop without finding the end of a line
if Length(ALine) > 0 then begin
X := Lines.Add(ALine);
Indents[X] := GetIndent(ALine);
end;
ALines.Clear;
end; end;
// exited the loop without finding the end of a line
if Length(ALine) > 0 then begin
X := Lines.Add(ALine);
Indents[X] := GetIndent(ALine);
end;
ALines.Clear;
AList := TStringList.Create; AList := TStringList.Create;
BList := TStringList.Create; BList := TStringList.Create;
@ -194,6 +196,7 @@ begin
BList.Free; BList.Free;
Result := ALines; Result := ALines;
ReAllocMem(Indents,0);
// TODO: How do you stop this from adding a new line at the end of the last item // TODO: How do you stop this from adding a new line at the end of the last item
end; end;
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////