mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-21 09:49:14 +00:00
bug 246750 Can't read menu/menuitem's "keyboard shortcut" and "accesskey"
r = pkw@us.ibm.com sr= henry.jia@sun.com
This commit is contained in:
parent
d1e2c2e843
commit
6c4ccfab79
@ -157,7 +157,7 @@ getKeyBindingCB(AtkAction *aAction, gint aActionIndex)
|
||||
accWrap->GetMaiInterface(MAI_INTERFACE_ACTION));
|
||||
NS_ENSURE_TRUE(action, nsnull);
|
||||
|
||||
if (action->GetKeyBinding())
|
||||
if (*action->GetKeyBinding())
|
||||
return action->GetKeyBinding();
|
||||
|
||||
//return all KeyBindings including accesskey and shortcut
|
||||
@ -183,7 +183,7 @@ getKeyBindingCB(AtkAction *aAction, gint aActionIndex)
|
||||
rightChar;
|
||||
}
|
||||
else if ((role == ATK_ROLE_MENU) || (role == ATK_ROLE_MENU_ITEM)) {
|
||||
//it is submenu, change from "s" to "s;<Alt>fs"
|
||||
//it is submenu, change from "s" to "s;<Alt>f:s"
|
||||
nsAutoString allKey = accessKey;
|
||||
nsCOMPtr<nsIAccessible> grandParentAcc = parentAccessible;
|
||||
|
||||
@ -194,7 +194,7 @@ getKeyBindingCB(AtkAction *aAction, gint aActionIndex)
|
||||
if (!grandParentKey.IsEmpty()) {
|
||||
nsAutoString rightChar;
|
||||
grandParentKey.Right(rightChar, 1);
|
||||
allKey = rightChar + allKey;
|
||||
allKey = rightChar + NS_LITERAL_STRING(":") + allKey;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIAccessible> tempAcc = grandParentAcc;
|
||||
|
@ -59,12 +59,12 @@ public:
|
||||
void SetName(nsAString &aString) { mName = NS_ConvertUCS2toUTF8(aString); }
|
||||
|
||||
const char *GetKeyBinding() {
|
||||
return NS_ConvertUCS2toUTF8(mKeyBinding).get();
|
||||
return mKeyBinding.get();
|
||||
}
|
||||
void SetKeyBinding(nsAString &aString) { mKeyBinding = aString; }
|
||||
void SetKeyBinding(nsAString &aString) { mKeyBinding = NS_ConvertUCS2toUTF8(aString); }
|
||||
private:
|
||||
nsCString mName;
|
||||
nsString mKeyBinding;
|
||||
nsCString mKeyBinding;
|
||||
};
|
||||
|
||||
#endif /* __MAI_INTERFACE_ACTION_H__ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user