Don't try to get a key code from event character when there are no characters. Eliminates many "GetGeckoKeyCodeFromChar" warnings printed to console. b=485578 sr=roc

This commit is contained in:
Josh Aas 2009-03-29 17:38:37 -07:00
parent 9c5052b1c6
commit 84e62061c8

View File

@ -4331,9 +4331,6 @@ static PRUint32 ConvertMacToGeckoKeyCode(UInt32 keyCode, nsKeyEvent* aKeyEvent,
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
PRUint32 geckoKeyCode = 0;
PRUnichar charCode = 0;
if ([characters length])
charCode = [characters characterAtIndex:0];
switch (keyCode)
{
@ -4415,7 +4412,8 @@ static PRUint32 ConvertMacToGeckoKeyCode(UInt32 keyCode, nsKeyEvent* aKeyEvent,
default:
// if we haven't gotten the key code already, look at the char code
geckoKeyCode = GetGeckoKeyCodeFromChar(charCode);
if ([characters length])
geckoKeyCode = GetGeckoKeyCodeFromChar([characters characterAtIndex:0]);
}
return geckoKeyCode;