From d83ee6522b195b9076102eed53cfd18e22ff2cd3 Mon Sep 17 00:00:00 2001 From: jesus Date: Wed, 17 Mar 2010 17:56:27 +0000 Subject: [PATCH] LCL, fix exception on adding first custom column (regresion introduced in r24057 #22775e7a58), issue #16021 git-svn-id: trunk@24070 - --- lcl/grids.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lcl/grids.pas b/lcl/grids.pas index 8a21074255..8de8905f4f 100644 --- a/lcl/grids.pas +++ b/lcl/grids.pas @@ -10035,7 +10035,10 @@ var i: Integer; begin {$ifdef NewCols} - result := Index; + if Index>Count-1 then + result := -1 + else + result := Index; {$else} result := -1; if Index>=0 then