struct wxInternalDataSort
{
wxListCtrlCompare user_fn;
- long data;
+ wxIntPtr data;
};
int CALLBACK wxInternalDataCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
- struct wxInternalDataSort *internalData = (struct wxInternalDataSort *) lParamSort;
+ wxInternalDataSort * const internalData = (wxInternalDataSort *) lParamSort;
wxListItemInternalData *data1 = (wxListItemInternalData *) lParam1;
wxListItemInternalData *data2 = (wxListItemInternalData *) lParam2;
}
-bool wxListCtrl::SortItems(wxListCtrlCompare fn, long data)
+bool wxListCtrl::SortItems(wxListCtrlCompare fn, wxIntPtr data)
{
- struct wxInternalDataSort internalData;
+ wxInternalDataSort internalData;
internalData.user_fn = fn;
internalData.data = data;
const wxListItem& info,
LV_ITEM& lvItem)
{
+ wxASSERT_MSG( 0 <= info.m_col && info.m_col < ctrl->GetColumnCount(),
+ "wxListCtrl column index out of bounds" );
+
lvItem.iItem = (int) info.m_itemId;
lvItem.iImage = info.m_image;