ValEdit: fix crash in ValueListEditor.AdjustColumnWidths.

Patch by Cyrax. Issue #0024779.

git-svn-id: trunk@42205 -
This commit is contained in:
bart 2013-07-25 17:01:20 +00:00
parent 08b51de095
commit 24dd7801d7

View File

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