зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
a34c4349b6
Коммит
984ff8c25a
|
@ -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__ */
|
||||
|
|
Загрузка…
Ссылка в новой задаче