cocoa: do not call DrawItem for readonly dropdown if no item is not selected. #21791

git-svn-id: trunk@60950 -
This commit is contained in:
dmitry 2019-04-13 04:41:54 +00:00
parent 1dc66309d3
commit 8b19c6735e

View File

@ -1463,7 +1463,9 @@ begin
inherited drawRect(dirtyRect);
// if ownerDrawn style, then need to call "DrawItem" event
if isOwnerDrawn and Assigned(callback) then
if isOwnerDrawn and Assigned(callback)
and (lastSelectedItemIndex>=0) and (lastSelectedItemIndex<list.Count)
then
begin
ctx := TCocoaContext.Create(NSGraphicsContext.currentContext);
try