From cd922206ba94b6f30b8cf5abb3eed423e43ebc29 Mon Sep 17 00:00:00 2001 From: "smontagu%smontagu.org" Date: Sun, 3 Jul 2005 12:19:26 +0000 Subject: [PATCH] Process non-ASCII access keys correctly. Bug 255696, r+sr=roc, a=asa --- content/events/src/nsEventStateManager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/content/events/src/nsEventStateManager.cpp b/content/events/src/nsEventStateManager.cpp index ba0a6e8a5c47..dfd908604369 100644 --- a/content/events/src/nsEventStateManager.cpp +++ b/content/events/src/nsEventStateManager.cpp @@ -934,7 +934,8 @@ nsEventStateManager::HandleAccessKey(nsPresContext* aPresContext, // Alt or other accesskey modifier is down, we may need to do an accesskey if (mAccessKeys) { // Someone registered an accesskey. Find and activate it. - PRUnichar accKey = nsCRT::ToLower((char)aEvent->charCode); + PRUint32 accKey = (IS_IN_BMP(aEvent->charCode)) ? + ToLowerCase((PRUnichar)aEvent->charCode) : aEvent->charCode; nsVoidKey key(NS_INT32_TO_PTR(accKey)); if (mAccessKeys->Exists(&key)) { @@ -4330,7 +4331,7 @@ nsEventStateManager::RegisterAccessKey(nsIContent* aContent, PRUint32 aKey) } if (aContent) { - PRUnichar accKey = nsCRT::ToLower((char)aKey); + PRUint32 accKey = (IS_IN_BMP(aKey)) ? ToLowerCase((PRUnichar)aKey) : aKey; nsVoidKey key(NS_INT32_TO_PTR(accKey)); @@ -4352,7 +4353,7 @@ nsEventStateManager::UnregisterAccessKey(nsIContent* aContent, PRUint32 aKey) } if (aContent) { - PRUnichar accKey = nsCRT::ToLower((char)aKey); + PRUint32 accKey = (IS_IN_BMP(aKey)) ? ToLowerCase((PRUnichar)aKey) : aKey; nsVoidKey key(NS_INT32_TO_PTR(accKey));