U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » LineEdit, EditFields, DocEdit » [SECURITY] Drag-n-drop enabled in password fields
[SECURITY] Drag-n-drop enabled in password fields [message #29103] Tue, 05 October 2010 10:43 Go to previous message
Shire is currently offline  Shire
Messages: 41
Registered: September 2006
Location: Russia, Yamal peninsula
Member
In password fields drag and drop text is enabled by default. When dragging text, password shows in sample picture.
This must be disabled by additional check in
void EditField::LeftDrag(Point p, dword flags)
{
+	if(password) return;


Also EditField::GetCursor() can be rewritten for proper selection:
int  EditField::GetCursor(int posx)
{
	posx -= 2;
	if(posx <= 0) return 0;

	FontInfo fi = font.Info();
	int count = text.GetLength();
	if(password)
		return min((posx + fi['*'] / 2) / fi['*'], count);

	int x = 0;
	const wchar *s = text;
	int i = 0;
	while(i < count)
	{
		int witdh = fi[*s];
		if(posx < x + witdh / 2)
			break;
		x += witdh;
		s++; i++;
	}
	return i;
}


Some methods (GetTextCx(), Paints()) have argument 'password'. For what?
 
Read Message
Read Message
Previous Topic: [FEATURE] Horizontal scroll on Shift+mouse wheel
Next Topic: recent MinMax Refresh fix not GCC compilable
Goto Forum:
  


Current Time: Sun Apr 26 23:01:42 GMT+2 2026

Total time taken to generate the page: 0.00538 seconds