From d08b801d2cd9b130312e09cf8ae0679e30a32b53 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 20 Feb 2014 13:06:33 +0000 Subject: [PATCH] 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 --- src/common/datavcmn.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index fd7412117a..9d68261fe0 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -1885,17 +1885,17 @@ bool wxDataViewListCtrl::InsertColumn( unsigned int pos, wxDataViewColumn *colum bool wxDataViewListCtrl::PrependColumn( wxDataViewColumn *col ) { - return PrependColumn( col, "string" ); + return PrependColumn( col, col->GetRenderer()->GetVariantType() ); } 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 ) { - return AppendColumn( col, "string" ); + return AppendColumn( col, col->GetRenderer()->GetVariantType() ); } bool wxDataViewListCtrl::ClearColumns()