diff --git a/src/msw/headerctrl.cpp b/src/msw/headerctrl.cpp index db539f43ed..d02cd7c7da 100644 --- a/src/msw/headerctrl.cpp +++ b/src/msw/headerctrl.cpp @@ -317,35 +317,28 @@ void wxHeaderCtrl::DoInsertItem(const wxHeaderColumn& col, unsigned int idx) if ( HasFlag(wxHD_BITMAP_ON_RIGHT) ) hdi.fmt |= HDF_BITMAP_ON_RIGHT; - if ( bmp.IsOk() ) + const int bmpWidth = bmp.GetWidth(), + bmpHeight = bmp.GetHeight(); + + if ( !m_imageList ) { - const int bmpWidth = bmp.GetWidth(), - bmpHeight = bmp.GetHeight(); - - if ( !m_imageList ) - { - m_imageList = new wxImageList(bmpWidth, bmpHeight); - (void) // suppress mingw32 warning about unused computed value - Header_SetImageList(GetHwnd(), GetHimagelistOf(m_imageList)); - } - else // already have an image list - { - // check that all bitmaps we use have the same size - int imageWidth, - imageHeight; - m_imageList->GetSize(0, imageWidth, imageHeight); - - wxASSERT_MSG( imageWidth == bmpWidth && imageHeight == bmpHeight, - "all column bitmaps must have the same size" ); - } - - m_imageList->Add(bmp); - hdi.iImage = m_imageList->GetImageCount() - 1; + m_imageList = new wxImageList(bmpWidth, bmpHeight); + (void) // suppress mingw32 warning about unused computed value + Header_SetImageList(GetHwnd(), GetHimagelistOf(m_imageList)); } - else // no bitmap but we still need to update the item + else // already have an image list { - hdi.iImage = I_IMAGENONE; + // check that all bitmaps we use have the same size + int imageWidth, + imageHeight; + m_imageList->GetSize(0, imageWidth, imageHeight); + + wxASSERT_MSG( imageWidth == bmpWidth && imageHeight == bmpHeight, + "all column bitmaps must have the same size" ); } + + m_imageList->Add(bmp); + hdi.iImage = m_imageList->GetImageCount() - 1; } if ( col.GetAlignment() != wxALIGN_NOT ) diff --git a/src/unix/joystick.cpp b/src/unix/joystick.cpp index 6a1df033ac..c537b11efd 100644 --- a/src/unix/joystick.cpp +++ b/src/unix/joystick.cpp @@ -141,14 +141,6 @@ void* wxJoystickThread::Entry() if ((j_evt.type & JS_EVENT_AXIS) && (j_evt.number < wxJS_MAX_AXES)) { - // Ignore invalid axis. - if ( j_evt.number >= wxJS_MAX_AXES ) - { - wxLogDebug(wxS("Invalid axis index %d in joystick message."), - j_evt.number); - continue; - } - if ( (m_axe[j_evt.number] + m_threshold < j_evt.value) || (m_axe[j_evt.number] - m_threshold > j_evt.value) ) {