Changeset 316 for trunk/UItemList.pas


Ignore:
Timestamp:
Jun 19, 2024, 11:53:06 PM (5 months ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UItemList.pas

    r315 r316  
    11unit UItemList;
    22
    3 {$mode delphi}
    4 
    53interface
    64
    75uses
    8   Classes, SysUtils, fgl, DOM, XML, Common, Graphics;
     6  Classes, SysUtils, Generics.Collections, DOM, XML, Common, Graphics;
    97
    108type
     
    3331  { TItemFields }
    3432
    35   TItemFields = class(TFPGObjectList<TItemField>)
     33  TItemFields = class(TObjectList<TItemField>)
    3634    function AddField(Index: Integer; SysName, Name: string; DataType: TDataType): TItemField;
    3735    function SearchByIndex(Index: Integer): TItemField;
     
    7876  { TItemList }
    7977
    80   TItemList = class(TFPGObjectList<TItem>)
     78  TItemList = class(TObjectList<TItem>)
    8179    NewId: Integer;
    8280    class function GetItemClass: TItemClass; virtual;
     
    120118destructor TItemField.Destroy;
    121119begin
    122   EnumStates.Free;
    123   inherited Destroy;
     120  FreeAndNil(EnumStates);
     121  inherited;
    124122end;
    125123
     
    316314    ReferenceList := GetReferenceList(Field.Index);
    317315    if (ReadId > 0) and Assigned(ReferenceList) then
    318       SetValueReference(Field.Index, TItem(ReferenceList.List[ReadId]));
     316      SetValueReference(Field.Index, TItem(ReferenceList[ReadId]));
    319317  end else
    320318    raise Exception.Create(Format(SUnsupportedDataType, [DataTypeStr[Field.DataType]]));
Note: See TracChangeset for help on using the changeset viewer.