Share

wxPropertyGrid

Tracker: Bugs

5 wxPG_PROP_PASSWORD string corrupted when editing - ID: 1830210
Last Update: Comment added ( jmsalli )

If you edit a string property that has the wxPG_PROP_PASSWORD attribute
then all the characters in your string would be converted to '*'s (with the
exception of any you'd added during the editing).

The problem can be fixed by making a change to
wxPGTextCtrlEditor::CreateControls (in propgrid.cpp):

wxWindow* wxPGTextCtrlEditor::CreateCntrols(....)
{
wxString text;

<**snip**>

int flags = 0;
if ( (property->GetFlags() & wxPG_PROP_PASSWORD) &&
property->IsKindOf(WX_PG_CLASSINFO(wxStringProperty)) )
{
// THE FOLLOWING LINE ADDED
text =
property->GetValueAsString(property->HasFlag(wxPG_PROP_READONLY)?0:wxPG_FUL
L_VALUE);
flags |= wxTE_PASSWORD
}

<**snip**>

return wnd;
}

Basically in the case of a password field we want to pass wxPG_FULL_VALUE
to GetValueAsString so we can get the real string and not the '*'ed one.
The real string will be protected in the wxTextCtrl through the use of the
wxTE_PASSWORD attribute.


Nicholas John ( nickjohn ) - 2007-11-12 05:48

5

Closed

Fixed

Jaakko Salli

None

Must fix

Public


Comment ( 1 )

Date: 2007-11-12 17:39
Sender: jmsalliProject Admin



Thanks! Anyhow, I used an alternate fix, modifying
wxStringPropertyClass::GetValueAsString() directly, changing argFlags test
to (argFlags & (wxPG_FULL_VALUE|wxPG_EDITABLE_VALUE)).

Changes now in development snapshot and SVN.

Jaakko



Attached File

No Files Currently Attached

Changes ( 4 )

Field Old Value Date By
status_id Open 2007-11-12 17:39 jmsalli
resolution_id None 2007-11-12 17:39 jmsalli
assigned_to nobody 2007-11-12 17:39 jmsalli
close_date - 2007-11-12 17:39 jmsalli