diff --git a/mozilla/content/events/src/nsDOMKeyboardEvent.cpp b/mozilla/content/events/src/nsDOMKeyboardEvent.cpp index 314e1940884..f1a38754d06 100644 --- a/mozilla/content/events/src/nsDOMKeyboardEvent.cpp +++ b/mozilla/content/events/src/nsDOMKeyboardEvent.cpp @@ -105,9 +105,7 @@ nsDOMKeyboardEvent::GetCharCode(PRUint32* aCharCode) switch (mEvent->message) { case NS_KEY_UP: case NS_KEY_DOWN: -#if defined(NS_DEBUG) && defined(DEBUG_brade) - printf("GetCharCode used for wrong key event; should use onkeypress.\n"); -#endif + NS_WARNING("GetCharCode used for wrong key event; should use onkeypress."); *aCharCode = 0; break; case NS_KEY_PRESS: diff --git a/mozilla/content/xbl/src/nsXBLPrototypeHandler.cpp b/mozilla/content/xbl/src/nsXBLPrototypeHandler.cpp index e74e2e795ac..12515d404df 100644 --- a/mozilla/content/xbl/src/nsXBLPrototypeHandler.cpp +++ b/mozilla/content/xbl/src/nsXBLPrototypeHandler.cpp @@ -559,8 +559,11 @@ nsXBLPrototypeHandler::KeyEventMatched(nsIDOMKeyEvent* aKeyEvent) // Get the keycode or charcode of the key event. PRUint32 code; - if (mMisc) + + if (mMisc) { aKeyEvent->GetCharCode(&code); + code = ToLowerCase(PRUnichar(code)); + } else aKeyEvent->GetKeyCode(&code); @@ -576,7 +579,7 @@ nsXBLPrototypeHandler::MouseEventMatched(nsIDOMMouseEvent* aMouseEvent) if (mDetail == -1 && mMisc == 0 && (mKeyMask & cAllModifiers) == 0) return PR_TRUE; // No filters set up. It's generic. - unsigned short button; + PRUint16 button; aMouseEvent->GetButton(&button); if (mDetail != -1 && (button != mDetail)) return PR_FALSE; @@ -843,7 +846,7 @@ nsXBLPrototypeHandler::ConstructPrototype(nsIContent* aKeyElement, mKeyMask = cAllModifiers; char* str = ToNewCString(modifiers); char* newStr; - char* token = nsCRT::strtok( str, ", ", &newStr ); + char* token = nsCRT::strtok( str, ", \t", &newStr ); while( token != NULL ) { if (PL_strcmp(token, "shift") == 0) mKeyMask |= cShift | cShiftMask; @@ -860,7 +863,7 @@ nsXBLPrototypeHandler::ConstructPrototype(nsIContent* aKeyElement, else if (PL_strcmp(token, "any") == 0) mKeyMask &= ~(mKeyMask << 4); - token = nsCRT::strtok( newStr, ", ", &newStr ); + token = nsCRT::strtok( newStr, ", \t", &newStr ); } nsMemory::Free(str); @@ -878,12 +881,7 @@ nsXBLPrototypeHandler::ConstructPrototype(nsIContent* aKeyElement, if (!key.IsEmpty()) { if (mKeyMask == 0) mKeyMask = cAllModifiers; - if (!(mKeyMask & cShift)) - mKeyMask &= ~cShiftMask; - if ((mKeyMask & cShift) != 0) - ToUpperCase(key); - else - ToLowerCase(key); + ToLowerCase(key); // We have a charcode. mMisc = 1; diff --git a/mozilla/extensions/typeaheadfind/src/nsTypeAheadFind.cpp b/mozilla/extensions/typeaheadfind/src/nsTypeAheadFind.cpp index 336e81de90f..30df7aaa24f 100644 --- a/mozilla/extensions/typeaheadfind/src/nsTypeAheadFind.cpp +++ b/mozilla/extensions/typeaheadfind/src/nsTypeAheadFind.cpp @@ -876,7 +876,7 @@ nsTypeAheadFind::HandleChar(PRUnichar aChar) return NS_ERROR_FAILURE; } - aChar = ToLowerCase(NS_STATIC_CAST(PRUnichar, aChar)); + aChar = ToLowerCase(aChar); PRInt32 bufferLength = mTypeAheadBuffer.Length(); mIsFirstVisiblePreferred = PR_FALSE; diff --git a/mozilla/layout/forms/nsListControlFrame.cpp b/mozilla/layout/forms/nsListControlFrame.cpp index de658a34093..a4437af2d08 100644 --- a/mozilla/layout/forms/nsListControlFrame.cpp +++ b/mozilla/layout/forms/nsListControlFrame.cpp @@ -96,10 +96,7 @@ // Constants const nscoord kMaxDropDownRows = 20; // This matches the setting for 4.x browsers -const PRInt32 kDefaultMultiselectHeight = 4; // This is compatible with 4.x browsers const PRInt32 kNothingSelected = -1; -const PRInt32 kMaxZ = 0x7fffffff; //XXX: Shouldn't there be a define somewhere for MaxInt for PRInt32 -const PRInt32 kNoSizeSpecified = -1; nsListControlFrame * nsListControlFrame::mFocused = nsnull; @@ -3101,8 +3098,8 @@ nsListControlFrame::KeyPress(nsIDOMEvent* aKeyEvent) keyEvent->GetKeyCode(&keycode); keyEvent->GetCharCode(&charcode); #ifdef DO_REFLOW_DEBUG - if (code >= 32) { - REFLOW_DEBUG_MSG3("KeyCode: %c %d\n", code, code); + if (charcode >= 32) { + REFLOW_DEBUG_MSG3("KeyCode: %c %d\n", charcode, charcode); } #endif diff --git a/mozilla/layout/xul/base/src/nsMenuListener.cpp b/mozilla/layout/xul/base/src/nsMenuListener.cpp index 55bd6c4c574..94537edc784 100644 --- a/mozilla/layout/xul/base/src/nsMenuListener.cpp +++ b/mozilla/layout/xul/base/src/nsMenuListener.cpp @@ -214,7 +214,6 @@ nsMenuListener::KeyPress(nsIDOMEvent* aKeyEvent) // Do shortcut navigation. // A letter was pressed. We want to see if a shortcut gets matched. If // so, we'll know the menu got activated. - keyEvent->GetCharCode(&theChar); mMenuParent->ShortcutNavigation(keyEvent, handled); } }