Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 next 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?
Re: [SECURITY] Drag-n-drop enabled in password fields [message #29214 is a reply to message #29103] Mon, 11 October 2010 10:07 Go to previous message
mirek is currently offline  mirek
Messages: 13442
Registered: November 2005
Ultimate Member
Thank you, applied.

Mirek
Previous Topic: [FEATURE] Horizontal scroll on Shift+mouse wheel
Next Topic: recent MinMax Refresh fix not GCC compilable
Goto Forum:
  


Current Time: Fri Oct 22 20:22:09 CEST 2021

Total time taken to generate the page: 0.01575 seconds