Issue 96287

Summary: Disabling any menu command via API disables menu item Tools > Macros > Organize Macros
Product: General Reporter: Giuseppe Castagno (aka beppec56) <giuseppe.castagno>
Component: uiAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: carsten.driesner, elish, issues, rainerbielefeld_ooo_qa
Version: OOo 3.0   
Target Milestone: ---   
Hardware: PC   
OS: All   
URL: https://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Disable_Commands
Issue Type: DEFECT Latest Confirmation in: 4.1.0-dev
Developer Difficulty: ---
Attachments:
Description Flags
Extension to be used for testing
none
Extension for testing, see comment above
none
patch for discussion. See dev@framework.openoffice.org.
none
menu comparison before-after none

Description Giuseppe Castagno (aka beppec56) 2008-11-17 18:20:29 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
Comment 1 Giuseppe Castagno (aka beppec56) 2008-11-17 18:24:53 UTC
Created attachment 58061 [details]
Extension to be used for testing
Comment 2 carsten.driesner 2008-11-25 16:48:27 UTC
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.
Comment 3 Giuseppe Castagno (aka beppec56) 2008-11-28 12:55:25 UTC
@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.
Comment 4 Giuseppe Castagno (aka beppec56) 2008-11-29 15:17:01 UTC
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.
Comment 5 Giuseppe Castagno (aka beppec56) 2008-11-29 15:19:34 UTC
Created attachment 58385 [details]
Extension for testing, see comment above
Comment 6 Giuseppe Castagno (aka beppec56) 2008-11-30 08:35:45 UTC
Created attachment 58394 [details]
patch for discussion. See dev@framework.openoffice.org.
Comment 7 Edwin Sharp 2014-02-06 09:42:51 UTC
Confirmed with
AOO410m1(Build:9750)  -  Rev. 1562493
Rev.1562493
Win 7
Comment 8 Edwin Sharp 2014-02-06 09:43:36 UTC
Created attachment 82513 [details]
menu comparison before-after