]> git.saurik.com Git - wxWidgets.git/commitdiff
Return non-const pointer from wxDataViewRendererBase::GetView().
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 22 Aug 2011 15:31:36 +0000 (15:31 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 22 Aug 2011 15:31:36 +0000 (15:31 +0000)
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
src/common/datavcmn.cpp

index 612e87d455aabbcfaa4603af113e2b837f9edb1b..1d77b0911453f7edc441321c0d07255e52dfdb69 100644 (file)
@@ -173,8 +173,9 @@ protected:
     wxWeakRef<wxWindow>     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)
index 059b7df1b3f5ab6ab87e24807ca5a9b0fa48a710..b7ee97b28e21a64cc21db08f56081e2f6342c863 100644 (file)
@@ -673,7 +673,7 @@ wxDataViewRendererBase::~wxDataViewRendererBase()
 {
 }
 
-const wxDataViewCtrl* wxDataViewRendererBase::GetView() const
+wxDataViewCtrl* wxDataViewRendererBase::GetView() const
 {
     return const_cast<wxDataViewRendererBase*>(this)->GetOwner()->GetOwner();
 }