From 5ee75e51de2f36b8d88f40bb50bf3445679229eb Mon Sep 17 00:00:00 2001 From: "saari%netscape.com" Date: Sat, 12 Feb 2000 05:52:24 +0000 Subject: [PATCH] Fixing delete key regression. r=hyatt --- rdf/content/src/nsXULKeyListener.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/rdf/content/src/nsXULKeyListener.cpp b/rdf/content/src/nsXULKeyListener.cpp index 37e07b399f81..e962de70bcd6 100644 --- a/rdf/content/src/nsXULKeyListener.cpp +++ b/rdf/content/src/nsXULKeyListener.cpp @@ -1328,17 +1328,15 @@ nsXULKeyListenerImpl::HandleEventUsingKeyset(nsIDOMElement* aKeysetElement, nsID aKeyEvent->GetCharCode(&theChar); } //printf("Found key [%s] \n", keyName.ToNewCString()); // this leaks - - nsAutoString code; // either keycode or charcode PRBool gotCharCode = PR_FALSE; PRBool gotKeyCode = PR_FALSE; if ( keyName.IsEmpty() ) { - keyElement->GetAttribute(nsAutoString("charcode"), code); - if(code.IsEmpty()) { - keyElement->GetAttribute(nsAutoString("keycode"), code); - if(code.IsEmpty()) { + keyElement->GetAttribute(nsAutoString("charcode"), keyName); + if(keyName.IsEmpty()) { + keyElement->GetAttribute(nsAutoString("keycode"), keyName); + if(keyName.IsEmpty()) { // HACK for temporary compatibility if(aEventType == eKeyPress) aKeyEvent->GetCharCode(&theChar); @@ -1357,6 +1355,9 @@ nsXULKeyListenerImpl::HandleEventUsingKeyset(nsIDOMElement* aKeysetElement, nsID } } + if(keyName.IsEmpty()) + break; + char tempChar[2]; tempChar[0] = theChar; tempChar[1] = 0; @@ -1368,9 +1369,9 @@ nsXULKeyListenerImpl::HandleEventUsingKeyset(nsIDOMElement* aKeysetElement, nsID PRBool isMatching; if(gotCharCode){ - isMatching = IsMatchingCharCode(tempChar2, code); + isMatching = IsMatchingCharCode(tempChar2, keyName); } else if(gotKeyCode){ - isMatching = IsMatchingKeyCode(theChar, code); + isMatching = IsMatchingKeyCode(theChar, keyName); } // HACK for backward compatibility