You've already forked lazarus-ccr
fpspreadsheet: Prevent adding field defs for unsupported field types.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8099 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -509,6 +509,9 @@ function TsWorksheetDataset.AddFieldDef(
|
|||||||
AName: String; ADataType: TFieldType; ASize: Integer = 0; AColIndex: Integer = -1;
|
AName: String; ADataType: TFieldType; ASize: Integer = 0; AColIndex: Integer = -1;
|
||||||
ACodePage: TSystemCodePage = CP_UTF8): TsFieldDef;
|
ACodePage: TSystemCodePage = CP_UTF8): TsFieldDef;
|
||||||
begin
|
begin
|
||||||
|
if not (ADataType in ftSupported) then
|
||||||
|
DatabaseError('Field type not supported.');
|
||||||
|
|
||||||
if AColIndex = -1 then
|
if AColIndex = -1 then
|
||||||
AColIndex := FieldDefs.Count;
|
AColIndex := FieldDefs.Count;
|
||||||
Result := TsFieldDef.Create(TsFieldDefs(FieldDefs),
|
Result := TsFieldDef.Create(TsFieldDefs(FieldDefs),
|
||||||
|
Reference in New Issue
Block a user