mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 18:39:10 +02:00
TAChart: Fix crash of GUI when TChartStyles is deleted.
git-svn-id: trunk@52090 -
This commit is contained in:
parent
8423094db4
commit
dc69b0c0a5
@ -460,7 +460,7 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Clipbrd, Dialogs, GraphMath, LCLProc, LResources, Math, TADrawerCanvas,
|
Clipbrd, Dialogs, GraphMath, LCLProc, LResources, Math, TADrawerCanvas,
|
||||||
TAGeometry, TAMath, Types;
|
TAGeometry, TAMath, TAStyles, Types;
|
||||||
|
|
||||||
function CompareZPosition(AItem1, AItem2: Pointer): Integer;
|
function CompareZPosition(AItem1, AItem2: Pointer): Integer;
|
||||||
begin
|
begin
|
||||||
@ -1250,11 +1250,19 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChart.Notification(AComponent: TComponent; AOperation: TOperation);
|
procedure TChart.Notification(AComponent: TComponent; AOperation: TOperation);
|
||||||
|
var
|
||||||
|
ax: TChartAxis;
|
||||||
begin
|
begin
|
||||||
if (AOperation = opRemove) and (AComponent = Toolset) then
|
if (AOperation = opRemove) and (AComponent = Toolset) then
|
||||||
FToolset := nil
|
FToolset := nil
|
||||||
else if (AOperation = opRemove) and (AComponent = GUIConnector) then
|
else if (AOperation = opRemove) and (AComponent = GUIConnector) then
|
||||||
GUIConnector := nil;
|
GUIConnector := nil
|
||||||
|
else if (AOperation = opRemove) and (AComponent is TChartStyles) then begin
|
||||||
|
for ax in FAxisList do
|
||||||
|
if ax.Marks.Stripes = AComponent then
|
||||||
|
ax.Marks.Stripes := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
inherited Notification(AComponent, AOperation);
|
inherited Notification(AComponent, AOperation);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user