summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-11-18 10:15:17 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-11-18 10:15:17 +0200
commit698b3b878fa2b67bb99be46dc0eef71ea170129f (patch)
tree6f3e94f795e58b126bcb4a665dad5126a92c6fc0 /src
parentdf01cca8ddbcbaf2208bac4feee911bec5c77def (diff)
downloadfpGUI-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.pas12
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;