From d0a61a09ec780b547c5649916e2ee48825663639 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 28 Jun 2019 21:52:57 +0200 Subject: [PATCH] Make validation helper functions private in all numeric wxPG properties wxUIntProperty::DoValidation() is already declared as private and the same access level should be applied to DoValidation() in other numeric properties because these functions are helpers intended for internal use only. --- docs/changes.txt | 3 +++ include/wx/propgrid/props.h | 14 ++++++++------ interface/wx/propgrid/props.h | 15 --------------- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index dba5b51d06..f0c27d5995 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -123,6 +123,9 @@ Changes in behaviour which may result in build errors - wxPGProperty ctors are not longer public since this class is intended to be a base class and should not be instantiated directly. +- wxIntProperty::DoValidation() and wxFloatProperty::DoValidation() are + no longer public since they are helpers intended for internal use only. + 3.1.3: (released 2019-??-??) ---------------------------- diff --git a/include/wx/propgrid/props.h b/include/wx/propgrid/props.h index 72d252988f..075228aaa7 100644 --- a/include/wx/propgrid/props.h +++ b/include/wx/propgrid/props.h @@ -212,6 +212,7 @@ public: virtual wxValidator* DoGetValidator() const wxOVERRIDE; virtual wxVariant AddSpinStepValue(long stepScale) const wxOVERRIDE; +private: // Validation helpers. #if wxUSE_LONGLONG static bool DoValidation( const wxNumericProperty* property, @@ -312,18 +313,19 @@ public: virtual bool ValidateValue( wxVariant& value, wxPGValidationInfo& validationInfo ) const wxOVERRIDE; - // Validation helper. - static bool DoValidation( const wxNumericProperty* property, - double& value, - wxPGValidationInfo* pValidationInfo, - int mode = - wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE ); static wxValidator* GetClassValidator(); virtual wxValidator* DoGetValidator () const wxOVERRIDE; virtual wxVariant AddSpinStepValue(long stepScale) const wxOVERRIDE; protected: int m_precision; + +private: + // Validation helper. + static bool DoValidation(const wxNumericProperty* property, + double& value, + wxPGValidationInfo* pValidationInfo, + int mode = wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE); }; // ----------------------------------------------------------------------- diff --git a/interface/wx/propgrid/props.h b/interface/wx/propgrid/props.h index 0bd8dc196c..ffa6499658 100644 --- a/interface/wx/propgrid/props.h +++ b/interface/wx/propgrid/props.h @@ -227,14 +227,6 @@ public: static wxValidator* GetClassValidator(); virtual wxValidator* DoGetValidator() const; virtual wxVariant AddSpinStepValue(long stepScale) const; - - /** Validation helper. - */ - static bool DoValidation( const wxPGProperty* property, - wxLongLong_t& value, - wxPGValidationInfo* pValidationInfo, - int mode = - wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE ); }; @@ -315,13 +307,6 @@ public: virtual bool ValidateValue( wxVariant& value, wxPGValidationInfo& validationInfo ) const; - /** Validation helper. - */ - static bool DoValidation( const wxPGProperty* property, - double& value, - wxPGValidationInfo* pValidationInfo, - int mode = - wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE ); static wxValidator* GetClassValidator(); virtual wxValidator* DoGetValidator () const; virtual wxVariant AddSpinStepValue(long stepScale) const;