if (action->GetKeyBinding())
if (*action->GetKeyBinding())
getKeyBindingCB(AtkAction *aAction, gint aActionIndex){    nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));    NS_ENSURE_TRUE(accWrap, nsnull);    MaiInterfaceAction *action =        NS_STATIC_CAST(MaiInterfaceAction *,                       accWrap->GetMaiInterface(MAI_INTERFACE_ACTION));    NS_ENSURE_TRUE(action, nsnull);    if (action->GetKeyBinding())        return action->GetKeyBinding();    //return all KeyBindings including accesskey and shortcut        nsAutoString allKeyBinding;    //get accesskey    nsAutoString accessKey;    nsresult rv = accWrap->GetKeyboardShortcut(accessKey);    if (NS_SUCCEEDED(rv) && !accessKey.IsEmpty()) {        nsCOMPtr<nsIAccessible> parentAccessible;        accWrap->GetParent(getter_AddRefs(parentAccessible));        if (parentAccessible) {            PRUint32 role;            parentAccessible->GetRole(&role);            if (role == ATK_ROLE_MENU_BAR) {                //it is topmenu, change from "Alt+f" to "f;<Alt>f"                nsAutoString rightChar;                accessKey.Right(rightChar, 1);                allKeyBinding = rightChar + NS_LITERAL_STRING(";<Alt>") +                                rightChar;            }            else if ((role == ATK_ROLE_MENU) || (role == ATK_ROLE_MENU_ITEM)) {                //it is submenu, change from "s" to "s;<Alt>fs"                nsAutoString allKey = accessKey;                nsCOMPtr<nsIAccessible> grandParentAcc = parentAccessible;                while ((grandParentAcc) && (role != ATK_ROLE_MENU_BAR)) {                    nsAutoString grandParentKey;                    grandParentAcc->GetKeyboardShortcut(grandParentKey);                    if (!grandParentKey.IsEmpty()) {                        nsAutoString rightChar;                        grandParentKey.Right(rightChar, 1);                        allKey = rightChar + allKey;                    }                    nsCOMPtr<nsIAccessible> tempAcc = grandParentAcc;                    tempAcc->GetParent(getter_AddRefs(grandParentAcc));                    if (grandParentAcc)                        grandParentAcc->GetRole(&role);                }                allKeyBinding = accessKey + NS_LITERAL_STRING(";<Alt>") +                                allKey;            }        }        else {            //default process, rarely happens.            nsAutoString rightChar;            accessKey.Right(rightChar, 1);            allKeyBinding = rightChar + NS_LITERAL_STRING(";<Alt>") + rightChar;        }    }    else  //don't have accesskey        allKeyBinding = NS_LITERAL_STRING(";");    //get shortcut    nsAutoString keyBinding, subShortcut;    rv = accWrap->GetKeyBinding(keyBinding);    if (NS_SUCCEEDED(rv) && !keyBinding.IsEmpty()) {        //change the shortcut from "Ctrl+Shift+L" to "<Control><Shift>L"        PRInt32 oldPos, curPos=0;        while ((curPos != -1) && (curPos < (PRInt32)keyBinding.Length())) {            oldPos = curPos;            nsAutoString subString;            curPos = keyBinding.FindChar('+', oldPos);            if (curPos == -1) {                keyBinding.Mid(subString, oldPos, keyBinding.Length() - oldPos);                subShortcut += subString;            }            else {                keyBinding.Mid(subString, oldPos, curPos - oldPos);                      //change "Ctrl" to "Control"                if (subString.EqualsIgnoreCase("ctrl"))                    subString = NS_LITERAL_STRING("Control");                      subShortcut += NS_LITERAL_STRING("<") + subString +                               NS_LITERAL_STRING(">");                curPos++;            }        }    }    allKeyBinding += NS_LITERAL_STRING(";") + subShortcut;    action->SetKeyBinding(allKeyBinding);    return action->GetKeyBinding();}