mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 17:39:20 +02:00
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:
parent
87794fe7a2
commit
48a07c9bb8
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user