mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 23:39:24 +02:00
LCL: cleanup and formatting, removed a left-over for loop
git-svn-id: trunk@37503 -
This commit is contained in:
parent
9cfccbdc1a
commit
c25ec11dc4
@ -10334,7 +10334,7 @@ procedure TCustomStringGrid.LoadFromCSVStream(AStream: TStream;
|
|||||||
|
|
||||||
var
|
var
|
||||||
Lines, HeaderL: TStringList;
|
Lines, HeaderL: TStringList;
|
||||||
i, j, x, StartRow: Integer;
|
i, j, StartRow: Integer;
|
||||||
S: String;
|
S: String;
|
||||||
begin
|
begin
|
||||||
Lines := TStringList.Create;
|
Lines := TStringList.Create;
|
||||||
@ -10348,7 +10348,6 @@ begin
|
|||||||
Lines.Delete(i);
|
Lines.Delete(i);
|
||||||
if Lines.Count>0 then begin
|
if Lines.Count>0 then begin
|
||||||
ParseDelimitedText(Lines[0], ADelimiter, '"', HeaderL);
|
ParseDelimitedText(Lines[0], ADelimiter, '"', HeaderL);
|
||||||
for x := 0 to HeaderL.Count - 1 do
|
|
||||||
// Set Columns count based on loaded data
|
// Set Columns count based on loaded data
|
||||||
if Columns.Enabled then begin
|
if Columns.Enabled then begin
|
||||||
while Columns.VisibleCount<>HeaderL.Count do
|
while Columns.VisibleCount<>HeaderL.Count do
|
||||||
@ -10366,11 +10365,9 @@ begin
|
|||||||
RowCount := FixedRows + Lines.Count-1;
|
RowCount := FixedRows + Lines.Count-1;
|
||||||
// Set column captions and set StartRow for the following rows
|
// Set column captions and set StartRow for the following rows
|
||||||
if WithHeader then begin
|
if WithHeader then begin
|
||||||
if FixedRows>0 then
|
if (FixedRows>0) and Columns.Enabled then
|
||||||
if Columns.Enabled then begin
|
|
||||||
for i:=0 to Columns.Count-1 do
|
for i:=0 to Columns.Count-1 do
|
||||||
Columns[i].Title.Caption:=HeaderL[i]
|
Columns[i].Title.Caption:=HeaderL[i];
|
||||||
end;
|
|
||||||
StartRow := Max(FixedRows-1, 0);
|
StartRow := Max(FixedRows-1, 0);
|
||||||
j := 0;
|
j := 0;
|
||||||
end else begin
|
end else begin
|
||||||
|
Loading…
Reference in New Issue
Block a user