incubator-ooo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ariel Constenla-Haile <>
Subject Re: [code] keyboard accelerators for main menus are no longer working on trunk
Date Thu, 05 Jul 2012 09:56:14 GMT
Hi Oliver,

On Thu, Jul 05, 2012 at 10:05:28AM +0200, Oliver-Rainer Wittmann wrote:
> Hi,
> On 05.07.2012 09:54, Oliver-Rainer Wittmann wrote:
> >Hi,
> >
> >I have recently recognized in my local environment for developing on trunk that
> >the keyboard accelerators for the main menus are no longer working - e.g. in
> >en-US version Alt-F does not open the Menu File, character F is also not
> >underlined.
> >Something seems to be broken on trunk regarding this functionality. It works in
> >AOO 3.4 and on branch AOO34.
> >Unfortunately, I have no glue about the corresponding code.
> >Does somebody else have?
> >
> my best colleagues just informed me that "glue" would not help here
> - it can not be used to "fix broken code" ;-)
> Thus, let me rephrase a little bit:
> I have not a clue about the corresponding code. Does somebody else have?

Automatic mnemonics generation is applied only on the PopupMenus, not
on the MenuBar's top level items, this is done on PopupMenu::ImplExecute
(main/vcl/source/window/menu.cxx) if the Application settings have
auto-mnemonics turned on, and the Menu has this flag set:

if ( Application::GetSettings().GetStyleSettings().GetAutoMnemonic() && !(nMenuFlags

On the other hand, mnemonics can be set manually on the label, using the
"~" character, this is done in resource files (*.src) for context menus
and dialogs; but the MenuBar and its PopupMenus, together with the
Toolbars (and some brand new code) use the preferred way of retrieving
the label from the UNO Command, this labels are store in the AOO
registry, on the files in

Setting the mnemonic manually is error prone and brings several issues
like and all the
issues it blocks.

On the other hand, developers really messed up those
${MODULE}Commands.xcu adding commands where they didn't belong, and
setting mnemonics that ended up repeated in the same menu or different
across the different applications; so while fixing the mess I removed
all "~" from the labels, the reason for this is that a command that is
used with the same label in different modules should be moved to
GenericCommands.xcu, but there were too many cases where the labels were
only differing on the "~" (one of the reason user complained about
inconsistency on the different application modules), and by no means
I was going to check manually command by command (look at the svn log
for the folder, it took me too much work to rearrange the commands where
they belonged); so it was more easy to remove them all and then add them
back (on demand) - this is also a good chance to fix the short cuts

I will add mnemonic generation for the MenuBar top level items (this is
needed for extensions that add new top level PopupMenus to the MenuBar:
for an extension developer, adding a mnemonic manually is error prone,
unless she/he takes care for looking at every translation...).

Any way my conclusion is that for those 12 UNO commands that make the
application MenuBars there is no other way than setting the mnemonic
manually in order to get the same mnemonic in every application
(example: in Writer, with automatic mnemonic generation the label "~Table"
will steal the "~" from "~Tools", as it comes first, and the Tools menu
will have a different shortcut than in the other applications.

Automatic mnemonic generation on the PopupMenus has also some drawbacks,
so it's arguable if setting the mnemonics manually here or not. But as
arguing here tends to be a rather time consuming job and somebody has
actually to do the job/write the code (not simply write mails),
I followed the principle of first doing then asking-on-demand: this is
trunk anyway (and I know what I do - in this case, at least).

I'll add the shortcuts in a while, now that you seem to miss them. Quite
strange nobody notice/asked/complained before, it makes me wonder if
anyone is really using trunk builds (nobody complained about the changes
on the About dialog either ;) ).

Ariel Constenla-Haile
La Plata, Argentina

View raw message