fpspreadsheet: Fix data point colors in ods reader when default color should be used.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9225 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz 2024-02-08 22:20:54 +00:00
parent 94208f009b
commit cf44ec6b55

View File

@ -1055,16 +1055,21 @@ procedure TsWorkbookChartSource.UseDataPointColors(ASeries: TsChartSeries);
var
c: TsColor;
g: TsChartGradient;
fill: TsChartFill;
begin
Result := clTAColor;
if (ADatapointStyle <> nil) and (ADatapointStyle.Background <> nil) then
if (ADatapointStyle <> nil) then
begin
case ADatapointStyle.Background.Style of
if ADatapointStyle.Background <> nil then
fill := ADataPointstyle.Background
else
fill := ASeries.Fill;
case fill.Style of
cfsSolid, cfsSolidHatched:
c := ADatapointStyle.Background.Color;
c := fill.Color;
cfsGradient:
begin
g := ASeries.Chart.Gradients[ADatapointStyle.Background.Gradient];
g := ASeries.Chart.Gradients[fill.Gradient];
c := g.StartColor;
end;
end;
@ -2777,6 +2782,8 @@ var
style: TChartStyle;
datapointStyle: TsChartDatapointStyle;
i, j: Integer;
fill: TsChartFill;
line: TsChartLine;
begin
AChartStyles.Styles.Clear;
@ -2796,7 +2803,15 @@ begin
FillAndLineToStyle(AWorkbookSeries.Fill, AWorkbookSeries.Line, style)
else
begin
FillAndLineToStyle(datapointStyle.Background, datapointStyle.Border, style);
if datapointStyle.Background <> nil then
fill := datapointstyle.Background
else
fill := AWorkbookSeries.Fill;
if datapointStyle.Border <> nil then
line := datapointstyle.Border
else
line := AWorkbookSeries.Line;
FillAndLineToStyle(fill, line, style);
if j < AWorkbookSeries.DataPointStyles.Count-1 then
begin
inc(j);