return FALSE;
iter->stamp = m_gtk_model->stamp;
- // user_data is just the index
- iter->user_data = (gpointer) i;
+ // user_data is just the index +1
+ iter->user_data = (gpointer) (i+1);
return TRUE;
}
if (m_wx_model->IsVirtualListModel())
{
- // user_data is just the index
- int i = (wxUIntPtr) iter->user_data;
+ // user_data is just the index +1
+ int i = ( (wxUIntPtr) iter->user_data ) -1;
gtk_tree_path_append_index (retval, i);
}
else
{
wxDataViewIndexListModel *wx_model = (wxDataViewIndexListModel*) m_wx_model;
- int n = (wxUIntPtr) iter->user_data;
+ // user_data is just the index +1
+ int n = ( (wxUIntPtr) iter->user_data ) -1;
if (n == -1)
return FALSE;
if (n >= (int) wx_model->GetLastIndex())
return FALSE;
- iter->user_data = (gpointer) ++n;
+ // user_data is just the index +1 (+2 because we need the next)
+ iter->user_data = (gpointer) (n+2);
}
else
{
return FALSE;
iter->stamp = m_gtk_model->stamp;
- iter->user_data = (gpointer) -1;
+ iter->user_data = (gpointer) 0;
return TRUE;
}
return FALSE;
iter->stamp = m_gtk_model->stamp;
- iter->user_data = (gpointer) n;
+ // user_data is just the index +1
+ iter->user_data = (gpointer) (n-1);
return TRUE;
}