From e6e8f45051b99f39cadd250098d54300d55b3e3a Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sat, 20 Apr 2019 16:32:37 +0200 Subject: [PATCH] Fix setting wxPG_PROP_STRING_PASSWORD attribute For built-in attributes (like wxPG_PROP_STRING_PASSWORD) wxPGProperty::DoSetAttribute() should return true to give the option (controlled by wxPG_EX_WRITEONLY_BUILTIN_ATTRIBUTES style) to prevent the attribute from being stored into property's attribute storage. --- interface/wx/propgrid/property.h | 5 +++-- src/propgrid/props.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/interface/wx/propgrid/property.h b/interface/wx/propgrid/property.h index 6af7f8ba80..9fea077579 100644 --- a/interface/wx/propgrid/property.h +++ b/interface/wx/propgrid/property.h @@ -100,8 +100,9 @@ struct wxPGPaintData */ #define wxPG_FLOAT_PRECISION wxS("Precision") -/** The text will be echoed as asterisks (wxTE_PASSWORD will be passed - to textctrl etc.). +/** Built-in attribute of type @c bool. Default value is @false, + When set tu @true, the text will be echoed as asterisks (wxTE_PASSWORD + will be passed to textctrl etc.). */ #define wxPG_STRING_PASSWORD wxS("Password") diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index bc48687991..7c6a523bca 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -145,9 +145,9 @@ bool wxStringProperty::DoSetAttribute( const wxString& name, wxVariant& value ) m_flags &= ~(wxPG_PROP_PASSWORD); if ( value.GetLong() ) m_flags |= wxPG_PROP_PASSWORD; RecreateEditor(); - return false; + return true; } - return true; + return false; } // -----------------------------------------------------------------------