Fix issue #1150: "List index out of bounds" when autofitting any header column

This commit is contained in:
Ansgar Becker
2009-05-22 17:43:35 +00:00
parent eb6515c692
commit 61693a8fcc

View File

@@ -5976,6 +5976,11 @@ begin
// Some list-headers have a contextmenu which should popup then.
if HitInfo.Button = mbRight then
Exit;
// Beginning with VT's r181, this proc is also called when doubleclicking-to-autofit
// Seems buggy in VT as this suddenly calls it with Column=-1 in those cases.
// See also issue #1150
if HitInfo.Column = NoColumn then
Exit;
if Sender.SortColumn <> HitInfo.Column then
Sender.SortColumn := HitInfo.Column