diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 628575ecc0..a451b9a33a 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -3554,18 +3554,13 @@ bool wxWindowMSW::MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *itemStruct) #if wxUSE_CONTROLS && !defined(__WXUNIVERSAL__) - wxControl *item = wxDynamicCast - ( - FindItem(id), #if wxUSE_OWNER_DRAWN - wxControl + wxControl *item = wxDynamicCast(FindItem(id), wxControl); #else // !wxUSE_OWNER_DRAWN - // we may still have owner-drawn buttons internally - // because we have to make them owner-drawn to support - // colour change - wxButton + // we may still have owner-drawn buttons internally because we have to make + // them owner-drawn to support colour change + wxControl *item = wxDynamicCast(FindItem(id), wxButton); #endif // USE_OWNER_DRAWN - ); if ( item ) {