mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 20:47:58 +02:00
TAChart: Fix crash when unsorted data are entered into DataPointsEditor for a sorted chartsource
git-svn-id: trunk@62289 -
This commit is contained in:
parent
7b46b7ced2
commit
4c785559bb
@ -78,18 +78,23 @@ function DataPointsEditor(AListChartSource: TListChartsource;
|
||||
AOptions: TDataPointsEditorOptions = []): Boolean;
|
||||
var
|
||||
F: TDataPointsEditorForm;
|
||||
wasSorted: Boolean;
|
||||
begin
|
||||
Result := false;
|
||||
F := TDataPointsEditorForm.Create(Application);
|
||||
try
|
||||
wasSorted := AListChartSource.Sorted;
|
||||
AListChartSource.Sorted := false;
|
||||
F.InitData(
|
||||
AListChartSource.XCount,
|
||||
AListChartSource.YCount,
|
||||
AListChartSource.DataPoints,
|
||||
AOptions
|
||||
);
|
||||
if F.ShowModal = mrOK then
|
||||
if F.ShowModal = mrOK then begin
|
||||
F.ExtractData(Result);
|
||||
if wasSorted then AListChartSource.Sorted := true;
|
||||
end;
|
||||
finally
|
||||
F.Free;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user