Override ClearColumns() in wxDataViewListCtrl.
Without this, the associated store's columns would be out of sync, causing asserts next time a column is appended. Fixes #14952. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75259 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
7622a167fd
commit
429085a3e7
@ -972,6 +972,7 @@ public:
|
||||
void InsertItem( unsigned int row, const wxVector<wxVariant> &values, wxUIntPtr data = 0 );
|
||||
void DeleteItem( unsigned int pos );
|
||||
void DeleteAllItems();
|
||||
void ClearColumns();
|
||||
|
||||
unsigned int GetItemCount() const;
|
||||
|
||||
@ -1040,6 +1041,7 @@ public:
|
||||
virtual bool PrependColumn( wxDataViewColumn *col );
|
||||
virtual bool InsertColumn( unsigned int pos, wxDataViewColumn *col );
|
||||
virtual bool AppendColumn( wxDataViewColumn *col );
|
||||
virtual bool ClearColumns();
|
||||
|
||||
wxDataViewColumn *AppendTextColumn( const wxString &label,
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||
|
@ -1790,6 +1790,11 @@ void wxDataViewListStore::DeleteAllItems()
|
||||
Reset( 0 );
|
||||
}
|
||||
|
||||
void wxDataViewListStore::ClearColumns()
|
||||
{
|
||||
m_cols.clear();
|
||||
}
|
||||
|
||||
void wxDataViewListStore::SetItemData( const wxDataViewItem& item, wxUIntPtr data )
|
||||
{
|
||||
wxDataViewListStoreLine* line = m_data[GetRow(item)];
|
||||
@ -1893,6 +1898,12 @@ bool wxDataViewListCtrl::AppendColumn( wxDataViewColumn *col )
|
||||
return AppendColumn( col, "string" );
|
||||
}
|
||||
|
||||
bool wxDataViewListCtrl::ClearColumns()
|
||||
{
|
||||
GetStore()->ClearColumns();
|
||||
return wxDataViewCtrl::ClearColumns();
|
||||
}
|
||||
|
||||
wxDataViewColumn *wxDataViewListCtrl::AppendTextColumn( const wxString &label,
|
||||
wxDataViewCellMode mode, int width, wxAlignment align, int flags )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user