TValueListEditor: raise an exception when setting RowCount < FixedRows.

git-svn-id: trunk@64605 -
This commit is contained in:
bart 2021-02-17 17:35:57 +00:00
parent 9baf8fe81d
commit ac3fae6d99

View File

@ -6,7 +6,8 @@ interface
uses
ContNrs, SysUtils, Classes, Variants,
LazUtf8, Controls, StdCtrls, Grids, LResources, Dialogs, LCLType, Laz2_XMLCfg;
LazUtf8, Controls, StdCtrls, Grids, LResources, Dialogs, LCLType, Laz2_XMLCfg,
LCLStrConsts;
type
@ -1541,6 +1542,8 @@ begin
//debugln('TValueListEditor.SetRowCount: AValue=',DbgS(AValue));
OldValue := inherited RowCount;
if OldValue = AValue then Exit;
if FixedRows > AValue then
Raise EGridException.Create(rsFixedRowsTooBig);
NewCount := AValue - FixedRows;
if (NewCount > Strings.Count) then
begin