X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/051b7b264fd113b531097e5b762ccf850609e657..b39badac119fe944152cd1408a90b82e710ea598:/src/generic/listctrl.cpp diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index bcf799a00b..09354910b6 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -4027,7 +4027,7 @@ void wxListMainWindow::InsertItem( wxListItem &item ) wxListLineData *line = new wxListLineData(this); line->SetItem( item.m_col, item ); - if ( item.m_mask & wxLIST_MASK_IMAGE ) + if ( item.m_mask & wxLIST_MASK_IMAGE && item.GetImage() != -1) { // Reset the buffered height if it's not big enough for the new image. if (m_small_image_list) @@ -4866,7 +4866,9 @@ long wxGenericListCtrl::InsertItem( long index, const wxString &label, int image wxListItem info; info.m_text = label; info.m_image = imageIndex; - info.m_mask = wxLIST_MASK_TEXT | wxLIST_MASK_IMAGE; + info.m_mask = wxLIST_MASK_TEXT; + if (imageIndex > -1) + info.m_mask |= wxLIST_MASK_IMAGE; info.m_itemId = index; return InsertItem( info ); }