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

Home » U++ Library support » U++ Library : Other (not classified elsewhere) » BUG: EditKeys
BUG: EditKeys [message #23542] Thu, 29 October 2009 17:32 Go to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Using key group names with spaces causes RestoreKeys to fail. One symptom of this is that if the user clicks 'Cancel' on the EditKeys dialog then the key settings revert to application defaults.

My fix is to alter the processing of group names in Restore keys by using a ReadGroupName function (previously it used ReadId(), so stopped at spaces):
String ReadGroupName(CParser &p) {
	const char *start = p.GetPtr();
	const char *ptr = start;
	while (*ptr && *ptr != ';') {
		p.GetChar();
		++ptr;
	}
	return String(start, ptr - start);
}	

void RestoreKeys(const String& data)
{
	SetDefaultKeys();
	CParser p(data);
	try {
		while(!p.IsEof()) {
			try {
				p.PassChar('-');
				String group = ReadGroupName(p);
				p.PassChar(';');

etc...

You can probably find a more elegant way though Smile
 
Read Message
Read Message
Previous Topic: ColumnList BUG FIXED !!! dragging last element makes disappear all other items
Next Topic: BUG: Key states incorrectly cleared on Ubuntu
Goto Forum:
  


Current Time: Thu Jul 02 10:51:59 GMT+2 2026

Total time taken to generate the page: 0.00462 seconds