From fcc961b3797ebe4475536e2e8e229ddc9197f3a3 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sat, 20 Apr 2019 16:36:23 +0200 Subject: [PATCH] Reset the flag only if it is necessary --- src/propgrid/props.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index 7c6a523bca..fe276bf866 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -142,8 +142,10 @@ bool wxStringProperty::DoSetAttribute( const wxString& name, wxVariant& value ) { if ( name == wxPG_STRING_PASSWORD ) { - m_flags &= ~(wxPG_PROP_PASSWORD); - if ( value.GetLong() ) m_flags |= wxPG_PROP_PASSWORD; + if ( value.GetLong() ) + m_flags |= wxPG_PROP_PASSWORD; + else + m_flags &= ~(wxPG_PROP_PASSWORD); RecreateEditor(); return true; }