If -1 is passed to InsertItem for the imageIndex then don't set wxLIST_MASK_IMAGE

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68495 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2011-08-02 20:23:42 +00:00
parent 6c797d8fd1
commit ec3f5752a0
2 changed files with 7 additions and 3 deletions

View File

@@ -1727,7 +1727,9 @@ long wxListCtrl::InsertItem(long index, const wxString& label, int imageIndex)
wxListItem info;
info.m_image = imageIndex;
info.m_text = label;
info.m_mask = wxLIST_MASK_IMAGE | wxLIST_MASK_TEXT;
info.m_mask = wxLIST_MASK_TEXT;
if (imageIndex > -1)
info.m_mask |= wxLIST_MASK_IMAGE;
info.m_itemId = index;
return InsertItem(info);
}