Merged revision(s) 57113 #f00551aab4 from trunk:

TAChart: Fix crash if multi-valued lineseries is displayed in legend using styles.
........

git-svn-id: branches/fixes_1_8@57212 -
This commit is contained in:
maxim 2018-02-01 22:42:40 +00:00
parent 735cd248e4
commit b54c67b9b1

View File

@ -565,6 +565,7 @@ end;
procedure TLineSeries.GetLegendItems(AItems: TChartLegendItems);
var
lb: TBrush;
lp: TPen;
p: TSeriesPointer;
i: Integer;
@ -589,14 +590,16 @@ begin
AItems.Add(li);
end;
lmStyle:
if Styles <> nil then
if Styles <> nil then begin
if Assigned(p) then lb := p.Brush else lb := nil;
for s in Styles.Styles do
AItems.Add(TLegendItemLinePointer.CreateWithBrush(
IfThen((lp <> nil) and s.UsePen, s.Pen, lp) as TPen,
IfThen(s.UseBrush, s.Brush, p.Brush) as TBrush,
IfThen(s.UseBrush, s.Brush, lb) as TBrush,
p,
LegendTextStyle(s)
));
end;
end;
end;