Use correct column type when adding columns to wxDataViewListCtrl.
Using base class methods such as AppendBitmapColumn() resulted in wxDataViewListCtrl::AppendColumn() being called but this function always assumed the column was of "string" variant type -- which was, of course, false for bitmap columns and so resulted in heap corruption (thanks to the wonderfully type unsafe code using wxVariant) and a crash. Get the correct type to use from the column itself now to fix this. Closes #16008. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75947 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1885,17 +1885,17 @@ bool wxDataViewListCtrl::InsertColumn( unsigned int pos, wxDataViewColumn *colum
|
|||||||
|
|
||||||
bool wxDataViewListCtrl::PrependColumn( wxDataViewColumn *col )
|
bool wxDataViewListCtrl::PrependColumn( wxDataViewColumn *col )
|
||||||
{
|
{
|
||||||
return PrependColumn( col, "string" );
|
return PrependColumn( col, col->GetRenderer()->GetVariantType() );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDataViewListCtrl::InsertColumn( unsigned int pos, wxDataViewColumn *col )
|
bool wxDataViewListCtrl::InsertColumn( unsigned int pos, wxDataViewColumn *col )
|
||||||
{
|
{
|
||||||
return InsertColumn( pos, col, "string" );
|
return InsertColumn( pos, col, col->GetRenderer()->GetVariantType() );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDataViewListCtrl::AppendColumn( wxDataViewColumn *col )
|
bool wxDataViewListCtrl::AppendColumn( wxDataViewColumn *col )
|
||||||
{
|
{
|
||||||
return AppendColumn( col, "string" );
|
return AppendColumn( col, col->GetRenderer()->GetVariantType() );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDataViewListCtrl::ClearColumns()
|
bool wxDataViewListCtrl::ClearColumns()
|
||||||
|
Reference in New Issue
Block a user