From: Vadim Zeitlin Date: Fri, 21 May 2010 11:46:13 +0000 (+0000) Subject: Fix cast from pointer to int in wxDataViewCtrl. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/74035a191ba1bbb5210289a3fc0a30e3595ede0a Fix cast from pointer to int in wxDataViewCtrl. This fixes compilation in 64 bit. Closes #12073. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64369 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index e2db524fd8..d52cef435d 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -111,7 +111,7 @@ public: wxDataViewCtrl* GetOwner() { return m_owner; } GtkWxTreeModel* GetGtkModel() { return m_gtk_model; } - // item can be deleted already in the model + // item can be deleted already in the model int GetIndexOf( const wxDataViewItem &parent, const wxDataViewItem &item ); protected: @@ -1419,7 +1419,7 @@ bool wxGtkDataViewModelNotifier::ItemDeleted( const wxDataViewItem &parent, cons int index = m_owner->GtkGetInternal()->GetIndexOf( parent, item ); gtk_tree_path_append_index( path, index ); #endif - + gtk_tree_model_row_deleted( GTK_TREE_MODEL(m_wxgtk_model), path ); gtk_tree_path_free (path); @@ -3532,7 +3532,7 @@ GtkTreePath *wxDataViewCtrlInternal::get_path( GtkTreeIter *iter ) // iter is root, add nothing if (!iter->user_data) return retval; - + // user_data is just the index +1 int i = ( (wxUIntPtr) iter->user_data ) -1; gtk_tree_path_append_index (retval, i); @@ -3626,7 +3626,7 @@ gboolean wxDataViewCtrlInternal::iter_children( GtkTreeIter *iter, GtkTreeIter * return TRUE; } - + wxDataViewItem item; if (parent) item = wxDataViewItem( (void*) parent->user_data ); @@ -3777,13 +3777,12 @@ gboolean wxDataViewCtrlInternal::iter_parent( GtkTreeIter *iter, GtkTreeIter *ch } } -// item can be deleted already in the model +// item can be deleted already in the model int wxDataViewCtrlInternal::GetIndexOf( const wxDataViewItem &parent, const wxDataViewItem &item ) { if (m_wx_model->IsVirtualListModel()) { - int index = ((int)(item.GetID())) - 1; - return index; + return wxPtrToUInt(item.GetID()) - 1; } else {