From 6cf902b407f7391faa393dbedc8abf6e049eb145 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Wed, 9 Sep 2015 22:38:42 -0700 Subject: [PATCH] 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 5905857dbaa87d425af0b899e28de9a3072f4f0a) --- src/msw/listbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index aa1a3ef367..2b6254b9d3 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -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);