Spin-off from bug 147667: when mnemonics are not hard-coded it will be assigned automatically. This fails if all letters of a string were used before. For example the Paste Special dialog uses A for Transpose _All and L for Cance_l making the checkbox "All" not accessible. In this case we cannot prevent double allocation and should use any character.
According to bug 154389 comment 4, labels with no explicitly defined accelerator (in source or translated strings) are assigned one of the initial or final letters of its words if they are not already taken in that menu. Rafael, do you have a code pointer for that? Testing in a recent 24.2 master build, here are more example of commands that don't have an accelerator because all letters are taken: - in French UI, Writer > Fichier > Signatures numériques - in French UI, Writer > Formulaire > Ouvrir en mode ébauche; Focalisation automatique sur le contrôle; Contrôles de contenu From bug 154389, an example where "inner" letters are available but not used: - in English-US UI, Calc > cell with comment > context menu > Delete comment: could use O, M or N as they are not used elsewhere in the menu. Already seen in OOo 3.3 with Edit > ImageMap missing an accelerator. For improving the method, I imagine this process: - If accelerator explicit with ~, use it - If not: - (exclude special characters) - use first letter of word if available - if not available: - use any letter in the string that's not already used - if none available: - avoid letters already used by a submenu name (see bug 143184) - prioritise letters used the least Hossein, wondering if this could be an easyHack?
(In reply to Stéphane Guillou (stragu) from comment #1) > Rafael, do you have a code pointer for that? This seems to be the method used to generate mnemonics: MnemonicGenerator::CreateMnemonic() Located in: /core/vcl/source/window/mnemonic.cxx
*** Bug 161011 has been marked as a duplicate of this bug. ***
*** Bug 154389 has been marked as a duplicate of this bug. ***
Hossein, how about making this an easyhack? MnemonicGenerator::CreateMnemonic() iterates somehow over the string and fails in case of Calc Data > Statistics (and other). The solution is probably a one-liner but to figure out the right place a bit tricky due to CJK.