LCL, grids: fix Grid-save-to-csv issues related to VisibleColumnsOnly, from wp, issue #30057

git-svn-id: trunk@52253 -
This commit is contained in:
jesus 2016-04-25 22:00:44 +00:00
parent 2f6d4c8b70
commit 2d2e8cfaa7

View File

@ -11038,11 +11038,13 @@ begin
// Collect header column names to a temporary StringList
for i := 0 to ColCount-1 do begin
c := ColumnFromGridColumn(i);
if c=nil then
HeaderL.Add(Cells[i, 0])
else
if (c <> nil) then begin
if c.Visible or not VisibleColumnsOnly then
HeaderL.Add(c.Title.Caption);
HeaderL.Add(c.Title.Caption);
end
else
if not VisibleColumnsOnly then
HeaderL.Add(Cells[i, 0]);
end;
HeaderL.Delimiter:=ADelimiter;
Headerl.StrictDelimiter := False; //force quoting of strings that contain whitespace or Delimiter
@ -11063,8 +11065,6 @@ begin
if Columns.Enabled and VisibleColumnsOnly then begin
HeaderL := TStringList.Create;
try
for j := 1 to FixedCols do
HeaderL.Add('');
for j := 0 to ColCount-1 do begin
c := ColumnFromGridColumn(j);
if c=nil then Continue;