Avoid bug in VS 2015 code generation

When using Whole Program Optimization, pItem->OnDrawItem() incorrectly calls the
base class wxOwnerDrawn::OnDrawItem() instead of the appropriate override, for
example wxCheckListBoxItem::OnDrawItem(). The problem can be avoided by not
using an unnecessary cast to wxListBoxItem*.

(cherry picked from commit 5905857dba)
This commit is contained in:
Paul Cornett
2015-09-09 22:38:42 -07:00
parent 8706f0f22c
commit 6cf902b407

View File

@@ -745,7 +745,7 @@ bool wxListBox::MSWOnDraw(WXDRAWITEMSTRUCT *item)
if ( pStruct->itemID == (UINT)-1 )
return false;
wxListBoxItem *pItem = (wxListBoxItem *)m_aItems[pStruct->itemID];
wxOwnerDrawn *pItem = m_aItems[pStruct->itemID];
wxDCTemp dc((WXHDC)pStruct->hDC);