X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5fb4b6cd65d39b21c3015b6dd54fcecb777e4edd..17beda75ef9780ebef5044e41889a9b598dcf186:/src/common/datavcmn.cpp diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index 1ac5c1d16f..69301bc8a1 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -1768,7 +1768,7 @@ void wxDataViewListStore::DeleteAllItems() void wxDataViewListStore::SetItemData( const wxDataViewItem& item, wxUIntPtr data ) { - wxDataViewListStoreLine* line = m_data[wxPtrToUInt( item.GetID() ) - 1]; + wxDataViewListStoreLine* line = m_data[GetRow(item)]; if (!line) return; line->SetData( data ); @@ -1776,8 +1776,8 @@ void wxDataViewListStore::SetItemData( const wxDataViewItem& item, wxUIntPtr dat wxUIntPtr wxDataViewListStore::GetItemData( const wxDataViewItem& item ) const { - wxDataViewListStoreLine* line = m_data[wxPtrToUInt( item.GetID() ) - 1]; - if (!line) return NULL; + wxDataViewListStoreLine* line = m_data[GetRow(item)]; + if (!line) return static_cast(NULL); return line->GetData(); } @@ -2184,10 +2184,7 @@ void wxDataViewTreeStore::DeleteItem( const wxDataViewItem& item ) wxDataViewTreeStoreContainerNode *parent_node = FindContainerNode( parent_item ); if (!parent_node) return; - wxDataViewTreeStoreContainerNode *node = FindContainerNode( item ); - if (!node) return; - - parent_node->GetChildren().DeleteObject( node ); + parent_node->GetChildren().DeleteObject( FindNode(item) ); } void wxDataViewTreeStore::DeleteChildren( const wxDataViewItem& item )