From 236a34ef3e930b22ddfc48ad0eb858ebba0a14b9 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Fri, 10 Oct 2008 10:02:35 +0000 Subject: [PATCH] Fix crash again git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56210 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/dataview.h | 3 --- src/generic/datavgen.cpp | 8 ++++++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/wx/generic/dataview.h b/include/wx/generic/dataview.h index 8296c5eef8..de5b225581 100644 --- a/include/wx/generic/dataview.h +++ b/include/wx/generic/dataview.h @@ -389,8 +389,6 @@ class WXDLLIMPEXP_ADV wxDataViewCtrl: public wxDataViewCtrlBase, public: wxDataViewCtrl() : wxScrollHelperNative(this) { - //No sorting column at start, I think - m_sortingColumn = NULL; Init(); } @@ -400,7 +398,6 @@ public: const wxValidator& validator = wxDefaultValidator ) : wxScrollHelperNative(this) { - m_sortingColumn = NULL; Create(parent, id, pos, size, style, validator ); } diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 794a94a966..fb301b760d 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -4093,6 +4093,10 @@ void wxDataViewCtrl::Init() { m_cols.DeleteContents(true); m_notifier = NULL; + + // No sorting column at start + m_sortingColumn = NULL; + m_headerArea = NULL; } bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, @@ -4102,14 +4106,14 @@ bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, if ( (style & wxBORDER_MASK) == 0) style |= wxBORDER_SUNKEN; + Init(); + if (!wxControl::Create( parent, id, pos, size, style | wxScrolledWindowStyle, validator)) return false; SetInitialSize(size); - Init(); - #ifdef __WXMAC__ MacSetClipChildren( true ); #endif -- 2.45.2