X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/41abc29aa6d7a44cbf4e01b05d239868e216e4af..77c8efc8c37da6d6a5e2e8022d21d1cd7d76371d:/src/common/datavcmn.cpp diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index ef43faa33b..69301bc8a1 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -1705,6 +1705,11 @@ unsigned int wxDataViewListStore::GetColumnCount() const return m_cols.GetCount(); } +unsigned int wxDataViewListStore::GetItemCount() const +{ + return m_data.size(); +} + wxString wxDataViewListStore::GetColumnType( unsigned int pos ) const { return m_cols[pos]; @@ -1761,6 +1766,22 @@ void wxDataViewListStore::DeleteAllItems() Reset( 0 ); } +void wxDataViewListStore::SetItemData( const wxDataViewItem& item, wxUIntPtr data ) +{ + wxDataViewListStoreLine* line = m_data[GetRow(item)]; + if (!line) return; + + line->SetData( data ); +} + +wxUIntPtr wxDataViewListStore::GetItemData( const wxDataViewItem& item ) const +{ + wxDataViewListStoreLine* line = m_data[GetRow(item)]; + if (!line) return static_cast(NULL); + + return line->GetData(); +} + void wxDataViewListStore::GetValueByRow( wxVariant &value, unsigned int row, unsigned int col ) const { wxDataViewListStoreLine *line = m_data[row]; @@ -2163,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 )