TAChart: Fix charteditor demo crashing when compiled with -CR

git-svn-id: trunk@65020 -
This commit is contained in:
wp 2021-04-18 08:44:59 +00:00
parent 37a8b37c8f
commit 21890d5c7b
3 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,6 @@ object TitleFootEditor: TTitleFootEditor
OKButton.OnClick = OKButtonClick
HelpButton.Name = 'HelpButton'
HelpButton.Caption = 'Apply to &all'
HelpButton.DefaultCaption = False
CloseButton.Name = 'CloseButton'
CloseButton.DefaultCaption = True
CancelButton.Name = 'CancelButton'

View File

@ -56,6 +56,7 @@ implementation
{$R *.lfm}
uses
TATypes,
ceUtils;
type
@ -124,7 +125,7 @@ end;
function TTitleFootEditor.GetChart: TChart;
begin
Result := TChartTitleAccess(FTitle).GetOwner as TChart;
Result := (FTitle.GetOwner as TChart);
end;
procedure TTitleFootEditor.OKButtonClick(Sender: TObject);
@ -136,7 +137,7 @@ procedure TTitleFootEditor.Prepare(ATitle: TChartTitle; ACaption: String = '');
begin
FTitle := ATitle;
if FSavedTitle = nil then
FSavedTitle := TChartTitle.Create(TChart(TChartTitleAccess(FTitle).GetOwner));
FSavedTitle := TChartTitle.Create(GetChart);
FSavedTitle.Assign(FTitle);
if ACaption <> '' then

View File

@ -83,11 +83,11 @@ type
procedure SetVisible(AValue: Boolean);
procedure StyleChanged(Sender: TObject); virtual;
protected
function GetOwner: TPersistent; override;
public
constructor Create(AOwner: TCustomChart);
public
procedure Assign(ASource: TPersistent); override;
function GetOwner: TPersistent; override;
procedure SetOwner(AOwner: TCustomChart);
property Visible: Boolean read FVisible write SetVisible;
end;