From ac3fae6d999b13eb90eef065e37b7bab8e942e3c Mon Sep 17 00:00:00 2001 From: bart <9132501-flyingsheep@users.noreply.gitlab.com> Date: Wed, 17 Feb 2021 17:35:57 +0000 Subject: [PATCH] TValueListEditor: raise an exception when setting RowCount < FixedRows. git-svn-id: trunk@64605 - --- lcl/valedit.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lcl/valedit.pas b/lcl/valedit.pas index 29257e6ca0..9e52151997 100644 --- a/lcl/valedit.pas +++ b/lcl/valedit.pas @@ -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