LCL: TListView: store column widths on handle destruction. Issue #32922

git-svn-id: trunk@56910 -
This commit is contained in:
ondrej 2018-01-01 20:58:03 +00:00
parent 44d4157a28
commit be6ec02cd2
3 changed files with 10 additions and 0 deletions

View File

@ -1234,6 +1234,7 @@ type
function GetItem(const AIndex: Integer): TListColumn;
procedure WSCreateColumns;
procedure SetItem(const AIndex: Integer; const AValue: TListColumn);
procedure DoFinalizeWnd;
protected
function GetOwner: TPersistent; override;
public

View File

@ -1154,6 +1154,7 @@ begin
FViewOriginCache := TWSCustomListViewClass(WidgetSetClass).GetViewOrigin(Self);
if not OwnerData then
FListItems.DoFinalizeWnd;
Columns.DoFinalizeWnd;
inherited FinalizeWnd;
end;

View File

@ -62,6 +62,14 @@ begin
EndUpdate;
end;
procedure TListColumns.DoFinalizeWnd;
var
I: Integer;
begin
for I := 0 to Count-1 do
Items[I].GetWidth; // store real width from WS into FWidth
end;
procedure TListColumns.Update(Item: TCollectionItem);
begin
if (Item = nil) and FNeedsUpdate then