From 9dbd3b4946990c8b7d4c13e78d34f14ff42c2793 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 9 Feb 2020 20:31:58 +0100 Subject: [PATCH] Use ctor with default argument instead of providing specialized ctor We can use 2-parameter ctor with default NULL value for second parameter instead of providing a special 1-paramater ctor. --- include/wx/propgrid/editors.h | 19 +++++++------------ interface/wx/propgrid/editors.h | 8 ++------ 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/include/wx/propgrid/editors.h b/include/wx/propgrid/editors.h index 9746bbc01a..83e21b8da1 100644 --- a/include/wx/propgrid/editors.h +++ b/include/wx/propgrid/editors.h @@ -27,21 +27,16 @@ class WXDLLIMPEXP_FWD_PROPGRID wxPropertyGrid; class wxPGWindowList { public: - void SetSecondary( wxWindow* secondary ) { m_secondary = secondary; } + wxPGWindowList(wxWindow* primary, wxWindow* secondary = NULL) + : m_primary(primary) + , m_secondary(secondary) + { + } + + void SetSecondary(wxWindow* secondary) { m_secondary = secondary; } wxWindow* m_primary; wxWindow* m_secondary; - - wxPGWindowList( wxWindow* a ) - { - m_primary = a; - m_secondary = NULL; - } - wxPGWindowList( wxWindow* a, wxWindow* b ) - { - m_primary = a; - m_secondary = b; - } }; // ----------------------------------------------------------------------- diff --git a/interface/wx/propgrid/editors.h b/interface/wx/propgrid/editors.h index 25629fd2b4..269a8961bf 100644 --- a/interface/wx/propgrid/editors.h +++ b/interface/wx/propgrid/editors.h @@ -14,13 +14,9 @@ class wxPGWindowList { public: - void SetSecondary( wxWindow* secondary ); + wxPGWindowList(wxWindow* primary, wxWindow* secondary = NULL); - wxWindow* m_primary; - wxWindow* m_secondary; - - wxPGWindowList( wxWindow* a ); - wxPGWindowList( wxWindow* a, wxWindow* b ); + void SetSecondary(wxWindow* secondary); };