mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2026-01-06 15:40:33 +01:00
TAChart: Avoid ListChartSource.CopyFrom adding NaN-Points at the end when copying from a DbChartSource and RecordCount is not correct.
git-svn-id: trunk@64839 -
This commit is contained in:
parent
82be1e231b
commit
bd831082aa
@ -719,6 +719,18 @@ begin
|
||||
FData.Add(pcd); // don't use ItemAdd() here
|
||||
pcd := nil;
|
||||
end;
|
||||
|
||||
// Remove NaN-points from the end. They can occur when ASource is
|
||||
// a DbChartSource for which RecordCount may be too large.
|
||||
for i := Count-1 downto 0 do
|
||||
begin
|
||||
pcd := FData[i];
|
||||
if IsNaN(pcd^.Point) then begin
|
||||
Dispose(pcd);
|
||||
FData.Delete(i);
|
||||
end else
|
||||
break;
|
||||
end;
|
||||
except
|
||||
if pcd <> nil then
|
||||
Dispose(pcd);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user