From dbab29b92575ae27e163a281315f45a11d3b74b1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 22 Aug 2011 15:31:36 +0000 Subject: [PATCH] Return non-const pointer from wxDataViewRendererBase::GetView(). Non-const wxWindow pointers are unfortunately needed quite often in wx API so return a non-const pointer here to allow using it with e.g. wxRendererNative (whose methods all take non-const wxWindow pointers) in the derived classes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68852 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/dvrenderers.h | 5 +++-- src/common/datavcmn.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/wx/dvrenderers.h b/include/wx/dvrenderers.h index 612e87d455..1d77b09114 100644 --- a/include/wx/dvrenderers.h +++ b/include/wx/dvrenderers.h @@ -173,8 +173,9 @@ protected: wxWeakRef m_editorCtrl; wxDataViewItem m_item; // for m_editorCtrl - // internal utility: - const wxDataViewCtrl* GetView() const; + // internal utility, may be used anywhere the window associated with the + // renderer is required + wxDataViewCtrl* GetView() const; protected: DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRendererBase) diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index 059b7df1b3..b7ee97b28e 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -673,7 +673,7 @@ wxDataViewRendererBase::~wxDataViewRendererBase() { } -const wxDataViewCtrl* wxDataViewRendererBase::GetView() const +wxDataViewCtrl* wxDataViewRendererBase::GetView() const { return const_cast(this)->GetOwner()->GetOwner(); } -- 2.45.2