mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 18:36:10 +02:00
TAChart: Fix access to cached ChartListSource extents while the source is being updated. Issue #35463, patch by Marcin Wiazowski.
git-svn-id: trunk@61080 -
This commit is contained in:
parent
0979ae36e8
commit
6c66672e31
@ -849,7 +849,8 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
FBasicExtentIsValid := true;
|
||||
FBasicExtentIsValid := not IsUpdating; // When updating, we are not allowed
|
||||
// to set "Valid" for caches - see comment in TListChartSource.ClearCaches()
|
||||
Result := FBasicExtent;
|
||||
end;
|
||||
|
||||
@ -888,7 +889,8 @@ begin
|
||||
UpdateMinMax(XList[j], FXListExtent.a.X, FXListExtent.b.X);
|
||||
end;
|
||||
|
||||
FXListExtentIsValid := true;
|
||||
FXListExtentIsValid := not IsUpdating; // When updating, we are not allowed
|
||||
// to set "Valid" for caches - see comment in TListChartSource.ClearCaches()
|
||||
end;
|
||||
|
||||
Result.a.X := Min(Result.a.X, FXListExtent.a.X);
|
||||
@ -915,7 +917,8 @@ begin
|
||||
UpdateMinMax(YList[j], FYListExtent.a.Y, FYListExtent.b.Y);
|
||||
end;
|
||||
|
||||
FYListExtentIsValid := true;
|
||||
FYListExtentIsValid := not IsUpdating; // When updating, we are not allowed
|
||||
// to set "Valid" for caches - see comment in TListChartSource.ClearCaches()
|
||||
end;
|
||||
|
||||
Result.a.Y := Min(Result.a.Y, FYListExtent.a.Y);
|
||||
@ -1018,7 +1021,8 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
FCumulativeExtentIsValid := true;
|
||||
FCumulativeExtentIsValid := not IsUpdating; // When updating, we are not allowed
|
||||
// to set "Valid" for caches - see comment in TListChartSource.ClearCaches()
|
||||
end;
|
||||
|
||||
Result.a.Y := Min(Result.a.Y, FCumulativeExtent.a.Y);
|
||||
@ -1499,7 +1503,8 @@ begin
|
||||
for i := 0 to Count - 1 do
|
||||
with Item[i]^ do
|
||||
FValuesTotal += NumberOr(Y);
|
||||
FValuesTotalIsValid := true;
|
||||
FValuesTotalIsValid := not IsUpdating; // When updating, we are not allowed
|
||||
// to set "Valid" for caches - see comment in TListChartSource.ClearCaches()
|
||||
Result := FValuesTotal;
|
||||
end;
|
||||
|
||||
|
@ -720,16 +720,20 @@ end;
|
||||
|
||||
procedure TListChartSource.ClearCaches;
|
||||
begin
|
||||
// When updating, we are not allowed to set "Valid" for caches - cached
|
||||
// data is not synchronized with real data when updating, so setting "Valid"
|
||||
// could lead to reading outdated cache contents, when calling methods like
|
||||
// BasicExtent() when still in update mode
|
||||
FBasicExtent := EmptyExtent;
|
||||
FBasicExtentIsValid := true;
|
||||
FBasicExtentIsValid := not IsUpdating;
|
||||
FCumulativeExtent := EmptyExtent;
|
||||
FCumulativeExtentIsValid := true;
|
||||
FCumulativeExtentIsValid := not IsUpdating;
|
||||
FXListExtent := EmptyExtent;
|
||||
FXListExtentIsValid := true;
|
||||
FXListExtentIsValid := not IsUpdating;
|
||||
FYListExtent := EmptyExtent;
|
||||
FYListExtentIsValid := true;
|
||||
FYListExtentIsValid := not IsUpdating;
|
||||
FValuesTotal := 0;
|
||||
FValuesTotalIsValid := true;
|
||||
FValuesTotalIsValid := not IsUpdating;
|
||||
end;
|
||||
|
||||
procedure TListChartSource.CopyFrom(ASource: TCustomChartSource);
|
||||
|
Loading…
Reference in New Issue
Block a user