Fix setting client data when adding items to a sorted wxListBox, broken in r74317
closes #16290 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76605 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
4b6c6a2fbd
commit
0b92a2083d
@ -460,9 +460,13 @@ int wxListBox::DoInsertOneItem(const wxString& item, unsigned int pos)
|
||||
#else
|
||||
int entryCol = 0;
|
||||
#endif
|
||||
gtk_list_store_insert_with_values(m_liststore, NULL, pos, entryCol, entry, -1);
|
||||
GtkTreeIter iter;
|
||||
gtk_list_store_insert_with_values(m_liststore, &iter, pos, entryCol, entry, -1);
|
||||
g_object_unref(entry);
|
||||
|
||||
if (HasFlag(wxLB_SORT))
|
||||
pos = GTKGetIndexFor(iter);
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
|
@ -122,9 +122,10 @@ void ListBoxTestCase::Sort()
|
||||
CPPUNIT_ASSERT_EQUAL("aab", m_list->GetString(4));
|
||||
CPPUNIT_ASSERT_EQUAL("aba", m_list->GetString(5));
|
||||
|
||||
m_list->Append("a");
|
||||
m_list->Append("a", wxUIntToPtr(1));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL("a", m_list->GetString(0));
|
||||
CPPUNIT_ASSERT_EQUAL(wxUIntToPtr(1), m_list->GetClientData(0));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user