LCL: Improve EmptyValue and DisplayEmpty in DB controls. Issue #36035, patch from Zdravko Gabrovski.

git-svn-id: trunk@63052 -
This commit is contained in:
juha 2020-04-23 22:58:48 +00:00
parent 1069149071
commit d6fe30b43c

View File

@ -323,9 +323,7 @@ begin
// Handle Empty Value and Empty Display
if FEmptyValue<>'' then begin
KeyIndex := FControlItems.Add(FDisplayEmpty);
if KeyIndex<>length(FListKeys) then // sanity check
raise Exception.Create('TDBLookup.FetchLookupData: inconsistency');
SetLength(FListKeys, KeyIndex+1); // Add one more
SetLength(FListKeys, ListLinkDataSet.RecordCount+1); // Add one more
FListKeys[KeyIndex] := FEmptyValue;
KeyListCount := 1;
end;