LCL: Fix invalid typecast on TCustomDBGrid-based grids. Issue #33053, patch from Michal Gawrycki.

git-svn-id: trunk@57427 -
This commit is contained in:
juha 2018-03-01 14:54:10 +00:00
parent a377818801
commit 3070f417a7
2 changed files with 3 additions and 3 deletions

View File

@ -361,8 +361,8 @@ end;
function TDBGridColumnsPropertyEditorForm.GetDataSet: TDataSet;
begin
if (FOwnerPersistent as TDBGrid).DataSource=nil then Exit(nil);
Result:=TDBGrid(FOwnerPersistent).DataSource.DataSet;
if (FOwnerPersistent as TCustomDBGrid).DataSource=nil then Exit(nil);
Result:=TCustomDBGrid(FOwnerPersistent).DataSource.DataSet;
end;
procedure TDBGridColumnsPropertyEditorForm.SelectInObjectInspector;

View File

@ -485,7 +485,6 @@ type
property Columns: TDBGridColumns read GetColumns write SetColumns;
property GridStatus: TDBGridStatus read FGridStatus write FGridStatus;
property Datalink: TComponentDataLink read FDatalink;
property DataSource: TDataSource read GetDataSource write SetDataSource;
property Options: TDBGridOptions read FOptions write SetOptions default
[dgColumnResize, dgColumnMove, dgTitles, dgIndicator, dgRowLines,
dgColLines, dgConfirmDelete, dgCancelOnExit, dgTabs, dgEditing,
@ -534,6 +533,7 @@ type
property SelectedFieldRect: TRect read GetSelectedFieldRect;
property LastColumn: TColumn read GetLastColumn;
property FirstColumn: TColumn read GetFirstColumn;
property DataSource: TDataSource read GetDataSource write SetDataSource;
end;
TDBGrid=class(TCustomDBGrid)