From 53844108dd1c7e24d1754ddc1df7a9b3e086ff66 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 7 Apr 2022 23:22:55 +0100 Subject: [PATCH] Make wxWindowDisabler ctors explicit Implicitly converting a bool or a wxWindow pointer to this class makes no sense and shouldn't be allowed, so don't allow it. --- include/wx/utils.h | 4 ++-- interface/wx/utils.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/wx/utils.h b/include/wx/utils.h index f87b92cf50..b522ec1f51 100644 --- a/include/wx/utils.h +++ b/include/wx/utils.h @@ -730,10 +730,10 @@ class WXDLLIMPEXP_CORE wxWindowDisabler public: // this ctor conditionally disables all windows: if the argument is false, // it doesn't do anything - wxWindowDisabler(bool disable = true); + explicit wxWindowDisabler(bool disable = true); // ctor disables all windows except winToSkip - wxWindowDisabler(wxWindow *winToSkip); + explicit wxWindowDisabler(wxWindow *winToSkip); // dtor enables back all windows disabled by the ctor ~wxWindowDisabler(); diff --git a/interface/wx/utils.h b/interface/wx/utils.h index e1fd9c37cf..4d4c01920e 100644 --- a/interface/wx/utils.h +++ b/interface/wx/utils.h @@ -84,7 +84,7 @@ public: @since 2.9.0 */ - wxWindowDisabler(bool disable = true); + explicit wxWindowDisabler(bool disable = true); /** Disables all top level windows of the applications with the exception @@ -98,7 +98,7 @@ public: or wxFRAME_NO_TASKBAR style when creating the window that will remain enabled. */ - wxWindowDisabler(wxWindow* winToSkip); + explicit wxWindowDisabler(wxWindow* winToSkip); /** Reenables the windows disabled by the constructor.