From c25ec11dc4865c1e62ce832cc964a8ab84fdd0b5 Mon Sep 17 00:00:00 2001 From: juha Date: Sun, 3 Jun 2012 17:50:53 +0000 Subject: [PATCH] LCL: cleanup and formatting, removed a left-over for loop git-svn-id: trunk@37503 - --- lcl/grids.pas | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lcl/grids.pas b/lcl/grids.pas index d8c2b5aae3..7aa9263ff3 100644 --- a/lcl/grids.pas +++ b/lcl/grids.pas @@ -10334,7 +10334,7 @@ procedure TCustomStringGrid.LoadFromCSVStream(AStream: TStream; var Lines, HeaderL: TStringList; - i, j, x, StartRow: Integer; + i, j, StartRow: Integer; S: String; begin Lines := TStringList.Create; @@ -10348,7 +10348,6 @@ begin Lines.Delete(i); if Lines.Count>0 then begin ParseDelimitedText(Lines[0], ADelimiter, '"', HeaderL); - for x := 0 to HeaderL.Count - 1 do // Set Columns count based on loaded data if Columns.Enabled then begin while Columns.VisibleCount<>HeaderL.Count do @@ -10366,11 +10365,9 @@ begin RowCount := FixedRows + Lines.Count-1; // Set column captions and set StartRow for the following rows if WithHeader then begin - if FixedRows>0 then - if Columns.Enabled then begin - for i:=0 to Columns.Count-1 do - Columns[i].Title.Caption:=HeaderL[i] - end; + if (FixedRows>0) and Columns.Enabled then + for i:=0 to Columns.Count-1 do + Columns[i].Title.Caption:=HeaderL[i]; StartRow := Max(FixedRows-1, 0); j := 0; end else begin