Apache OpenOffice (AOO) Bugzilla – Issue 96287
Disabling any menu command via API disables menu item Tools > Macros > Organize Macros
Last modified: 2014-04-11 17:18:23 UTC
Test check carried out in Debian GNU/Linux and Windows. To be sure I removed the user local OOo configuration before testing. To reproduce: 1. prepare a text document with whatever text you like 2. save the file and check the following menu items: 2.1.Tools > Digital Signatures... 2.2.Tools > Macros > Organize Macros All the 2 items should be there 3. Now install the attached minimal extension, it should only disable the menu command 2.1 above. Install the extension using Tools > Extension Manager... browse to the extension and confirm. At this time item 2.1 disappeared from menu, as it should be, whereas item 2.2 is still in place. Now close the office, as well as quickstarter if it's running, restart the office. Open the document saved at point 2 above and check the menu items 2.1, 2.2 above. They all disappeared, but only 2.1 should have gone, item 2.2 in my opinion shouldn't have. Or is my extension embedded configuration file (DisableCommands.xcu) doing something wrong? To reenable the menu items, simply remove the extension and restart the office and quickstarter. I wrote the DisableCommands.xcu configuration file inside the extension following what I learned in this page: http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Disable_Commands
Created attachment 58061 [details] Extension to be used for testing
cd: Added myself to CC. This issue is correctly assigned to the framework project. The "Disable Commands" feature is part of the framework project. I will try to confirm your issue.
@cd: thanks, First a more precise information: in #desc1 I didn't explain correctly the menu item at 2.1: it's Tools > Macros > Digital Signatures...; not the one reported there. Sorry for that. In the meantime I modified slightly the extension to check with another command (InsertAVMedia, menu item: Insert > Movie and Sound). This command has no problem, so it seems confined to the the Macro submenu. I'll try to investigate the matter further into the code, in case I have trouble in understanding the program flow, I'll ask in the dev@framework.openoffice.org list.
After some more testing I found that the issue is general, it applies when any command is disabled, so changed summary to a more correct one. Issue can be checked with the attached minimal extension, that will disable the Tools > Customize... menu item. The extension implements what it's explained in the Developer's Guide (http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Disable_Commands) Using a running OOo 3.0 with no opened documents, check if Tools > Customize... is enabled, the Tools > Macros > Organize Macros should be there as well. Install the attached extension, check again Tools > Customize... it should be gone. Check Tools > Macros > Organize Macros it's still there (correct so far). Now open an empty text document, close it and check again Tools > Macros > Organize Macros : it disappeared whereas it shouldn't have. To restore things back, remove the installed “CommandDisableToolsCustomize†extension, check again Tools > Customize...: it should be there, whereas Tools > Macros > Organize Macros still wasn't enabled whereas it should be enabled. Open an empty document, close it and check again Tools > Macros > Organize Macros : it returned. The issue seems confined to dynamic menus bound to menu bar, it shows up when menus are recreated due to change of frame. I'll try to investigate further and to build a patch for discussion.
Created attachment 58385 [details] Extension for testing, see comment above
Created attachment 58394 [details] patch for discussion. See dev@framework.openoffice.org.
Confirmed with AOO410m1(Build:9750) - Rev. 1562493 Rev.1562493 Win 7
Created attachment 82513 [details] menu comparison before-after