LCL: Prevent crash in TValueListEditor when resizing a parent form. Issue #24827, patch from Cyrax

git-svn-id: trunk@42319 -
This commit is contained in:
juha 2013-08-04 12:02:35 +00:00
parent 8b13c332d2
commit f40d0f314f

View File

@ -1076,14 +1076,17 @@ procedure TValueListEditor.AdjustColumnWidths;
// If key column is fixed in width then adjust only the second column,
// otherwise adjust both columns propertionally.
var
CW, AWidth: Integer;
CW, AWidth, BWidth: Integer;
begin
CW := ClientWidth;
if (doKeyColFixed in DisplayOptions) then
begin
//AutoSizeColumn(0);
If ColWidths[0] > CW Then
ColWidths[0] := CW - 1;
If ColWidths[0] > CW Then Begin
BWidth := CW - 1;
If BWidth > 0 Then
ColWidths[0] := BWidth;
end;
AWidth := CW - ColWidths[0];
If AWidth > 0 Then
ColWidths[1] := AWidth;