Use wxVector instead of wxList for wxDataViewCtrl columns storage

As wxDataViewColumnList was never public, it should be fine to not
define it any more and use a vector instead.

This makes the code more clear and also marginally more efficient.
This commit is contained in:
Vadim Zeitlin
2018-12-15 14:39:38 +01:00
parent 2340a16d18
commit 8856715d2d
2 changed files with 23 additions and 19 deletions

View File

@@ -12,7 +12,6 @@
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/control.h"
#include "wx/scrolwin.h"
#include "wx/icon.h"
@@ -179,9 +178,6 @@ private:
// wxDataViewCtrl
// ---------------------------------------------------------
WX_DECLARE_LIST_WITH_DECL(wxDataViewColumn, wxDataViewColumnList,
class WXDLLIMPEXP_CORE);
class WXDLLIMPEXP_CORE wxDataViewCtrl : public wxDataViewCtrlBase,
public wxScrollHelper
{
@@ -366,7 +362,9 @@ private:
void InvalidateColBestWidth(int idx);
void UpdateColWidths();
wxDataViewColumnList m_cols;
void DoClearColumns();
wxVector<wxDataViewColumn*> m_cols;
// cached column best widths information, values are for
// respective columns from m_cols and the arrays have same size
struct CachedColWidthInfo