fpspreadsheet: Split chart writing code off of ods writer.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8996 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz 2023-10-29 12:10:50 +00:00
parent d199c93aa2
commit 17283ba9c6
6 changed files with 1511 additions and 1409 deletions

View File

@ -83,7 +83,7 @@ begin
ch.Background.Style := fsSolidFill; ch.Background.Style := fsSolidFill;
ch.Border.Style := clsSolid; ch.Border.Style := clsSolid;
ch.PlotArea.Background.Style := fsSolidFill; ch.PlotArea.Background.Style := fsSolidFill;
ch.RotatedAxes := true; //ch.RotatedAxes := true;
ch.StackMode := csmStackedPercentage; ch.StackMode := csmStackedPercentage;
//ch.Interpolation := ciCubicSpline; //ch.Interpolation := ciCubicSpline;

View File

@ -33,7 +33,7 @@
This package is all you need if you don't want graphical components (such as grids and charts)."/> This package is all you need if you don't want graphical components (such as grids and charts)."/>
<License Value="LGPL with static linking exception. This is the same license as is used in the LCL (Lazarus Component Library)."/> <License Value="LGPL with static linking exception. This is the same license as is used in the LCL (Lazarus Component Library)."/>
<Version Major="1" Minor="17"/> <Version Major="1" Minor="17"/>
<Files Count="58"> <Files Count="59">
<Item1> <Item1>
<Filename Value="source\fps.inc"/> <Filename Value="source\fps.inc"/>
<Type Value="Include"/> <Type Value="Include"/>
@ -305,6 +305,10 @@ This package is all you need if you don&apos;t want graphical components (such a
<Filename Value="source\common\fpspreadsheet_chart.inc"/> <Filename Value="source\common\fpspreadsheet_chart.inc"/>
<Type Value="Binary"/> <Type Value="Binary"/>
</Item58> </Item58>
<Item59>
<Filename Value="source\common\fpsopendocumentchart.pas"/>
<UnitName Value="fpsopendocumentchart"/>
</Item59>
</Files> </Files>
<CompatibilityMode Value="True"/> <CompatibilityMode Value="True"/>
<i18n> <i18n>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -197,6 +197,19 @@ type
property NumFormatList: TStringList read FNumFormatList; property NumFormatList: TStringList read FNumFormatList;
end; end;
{@@ Helper class for the spreadsheet writer to keep processing of charts
out of the main writer unit. }
TsBasicSpreadChartWriter = class
protected
FWriter: TsBasicSpreadWriter;
public
constructor Create(AWriter: TsBasicSpreadWriter); virtual;
procedure CreateStreams; virtual; abstract;
procedure DestroyStreams; virtual; abstract;
procedure ResetStreams; virtual; abstract;
procedure WriteCharts; virtual; abstract;
property Writer: TsBasicSpreadWriter read FWriter;
end;
type type
TsSpreadFileAccess = (faRead, faWrite); TsSpreadFileAccess = (faRead, faWrite);
@ -912,6 +925,21 @@ begin
raise Exception.Create(rsUnsupportedWriteFormat); raise Exception.Create(rsUnsupportedWriteFormat);
end; end;
{------------------------------------------------------------------------------}
{ TsBasicSpreadChartWriter }
{------------------------------------------------------------------------------}
{@@ Constructor of the ChartWriter. It gets the main writer as parameter. }
constructor TsBasicSpreadChartWriter.Create(AWriter: TsBasicSpreadWriter);
begin
FWriter := AWriter;
end;
{------------------------------------------------------------------------------}
{ TsSpreadFormatRegistry }
{------------------------------------------------------------------------------}
type type
TsSpreadFormatData = class TsSpreadFormatData = class
private private

View File

@ -18,6 +18,9 @@ uses
{$ENDIF} {$ENDIF}
fpstypes, fpsreaderwriter; fpstypes, fpsreaderwriter;
const
XML_HEADER = '<?xml version="1.0" encoding="utf-8" ?>';
type type
TsSpreadXMLReader = class(TsCustomSpreadReader) TsSpreadXMLReader = class(TsCustomSpreadReader)
protected protected