From 705a7956ce8c63a81483f274d58ad1c9c83c2111 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sun, 11 May 2014 16:22:48 +0000 Subject: [PATCH] fpspreadsheet: Pass visibility of gridlines and sheet headers from TsWorksheetGrid to underlying Worksheet for saving. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3041 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../examples/fpsgrid/fpsgrid.lpi | 136 +++++++++--------- .../fpspreadsheet/fpspreadsheetgrid.pas | 13 ++ 2 files changed, 81 insertions(+), 68 deletions(-) diff --git a/components/fpspreadsheet/examples/fpsgrid/fpsgrid.lpi b/components/fpspreadsheet/examples/fpsgrid/fpsgrid.lpi index 78254f20b..ccd169e5d 100644 --- a/components/fpspreadsheet/examples/fpsgrid/fpsgrid.lpi +++ b/components/fpspreadsheet/examples/fpsgrid/fpsgrid.lpi @@ -139,8 +139,8 @@ - - + + @@ -150,8 +150,8 @@ - - + + @@ -585,123 +585,123 @@ - + - - + + - - + + - - + + - - + + - + - + - + - - - - - - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + + + + - + - + - + - + - - - - - - - - - - - - - - - - - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + diff --git a/components/fpspreadsheet/fpspreadsheetgrid.pas b/components/fpspreadsheet/fpspreadsheetgrid.pas index cd3562d9b..1056637f5 100644 --- a/components/fpspreadsheet/fpspreadsheetgrid.pas +++ b/components/fpspreadsheet/fpspreadsheetgrid.pas @@ -2096,13 +2096,26 @@ begin Options := Options + [goHorzLine, goVertLine] else Options := Options - [goHorzLine, goVertLine]; + + if FWorksheet <> nil then + if AValue then + FWorksheet.Options := FWorksheet.Options + [soShowGridLines] + else + FWorksheet.Options := FWorksheet.Options - [soShowGridLines]; end; { Shows / hides the worksheet's row and column headers. } procedure TsCustomWorksheetGrid.SetShowHeaders(AValue: Boolean); begin if AValue = GetShowHeaders then Exit; + FHeaderCount := ord(AValue); + if FWorksheet <> nil then + if AValue then + FWorksheet.Options := FWorksheet.Options + [soShowHeaders] + else + FWorksheet.Options := FWorksheet.Options - [soShowHeaders]; + Setup; end;