diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-11-18 10:15:17 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-11-18 10:15:17 +0200 |
commit | 698b3b878fa2b67bb99be46dc0eef71ea170129f (patch) | |
tree | 6f3e94f795e58b126bcb4a665dad5126a92c6fc0 /src | |
parent | df01cca8ddbcbaf2208bac4feee911bec5c77def (diff) | |
download | fpGUI-698b3b878fa2b67bb99be46dc0eef71ea170129f.tar.xz |
grids: A massive speed improvement in destroying a grid with large amounts of columns.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/fpg_customgrid.pas | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/fpg_customgrid.pas b/src/gui/fpg_customgrid.pas index 4f38f12a..83d35aa7 100644 --- a/src/gui/fpg_customgrid.pas +++ b/src/gui/fpg_customgrid.pas @@ -62,7 +62,7 @@ type TfpgCustomGrid = class(TfpgBaseGrid) protected FRowCount: Integer; - FColumns: TList; + FColumns: TFPList; procedure HandleSetFocus; override; procedure SetTextColor(const AValue: TfpgColor); override; function GetColumns(AIndex: integer): TfpgGridColumn; virtual; @@ -304,20 +304,20 @@ end; constructor TfpgCustomGrid.Create(AOwner: TComponent); begin - FColumns := TList.Create; + FColumns := TFPList.Create; inherited Create(AOwner); ColumnCount := 0; RowCount := 0; end; destructor TfpgCustomGrid.Destroy; +var + i: integer; begin - while FColumns.Count > 0 do + for i := FColumns.Count-1 downto 0 do begin - TfpgGridColumn(FColumns.Items[0]).Free; - FColumns.Delete(0); + TfpgGridColumn(FColumns.Items[i]).Free; end; - FColumns.Free; inherited Destroy; end; |