TAChart: Check value for NaN BEFORE setting in x-sorted ListChartSource (instead of AFTER). Issue #35188, patch by Marcin Wiazowski.

git-svn-id: trunk@60856 -
This commit is contained in:
wp 2019-04-06 08:24:27 +00:00
parent 87794fe7a2
commit 48a07c9bb8

View File

@ -743,14 +743,15 @@ var
end;
begin
if Sorted then
if IsNan(AValue) then
raise EChartError.CreateFmt('X = NaN in sorted source %s', [NameOrClassName(Self)]);
oldX := Item[AIndex]^.X;
Result := AIndex;
if IsEquivalent(oldX, AValue) then exit;
Item[AIndex]^.X := AValue;
UpdateExtent;
if Sorted then begin
if IsNan(AValue) then
raise EChartError.CreateFmt('X = NaN in sorted source %s', [NameOrClassName(Self)]);
if AValue > oldX then
while (Result < Count - 1) and (Item[Result + 1]^.X < AValue) do
Inc(Result)