Bug 98145 - No Sheets Menu in the Main menu
Summary: No Sheets Menu in the Main menu
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.1.1.1 rc
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-24 17:24 UTC by ThierryT
Modified: 2016-03-21 00:51 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
No Sheets Menu (14.12 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-02-24 17:24 UTC, ThierryT
Details
Adding user Menu (12.62 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-03-05 18:53 UTC, ThierryT
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ThierryT 2016-02-24 17:24:39 UTC
Created attachment 122958 [details]
No Sheets Menu

I developped an application under LO version 4.4.6.3 with a User Menu (see file enclosed for example with the Test Menu before the Help Menu).

I've installed today :
Version: 5.1.1.1 (x64)
Build ID: c43cb650e9c145b181321ea547d38296db70f36e
CPU Threads: 4; OS Version: Windows 6.29; UI Render: GL; 
Locale : fr-FR (fr_FR)

When I open my application or the file enclosed, the "Sheets" Menu never appears.

I tested also LO version 4.4.7 and version 5.0.x and I had exactly the same problem.
Comment 1 riesslibo 2016-02-24 17:55:15 UTC
Just 4 information: 
I observed such effects with additional menu items in or with "older" documents with LibO 5.1.0.3 on Win7x64 as well. 

It seems to be some dependencys with the user profile, especially with the registrymod-file. 

Additionaly there are some strange effects in the menus itself, for example in old writer documents the menu item for unprotecting cells of a writer table is missing and other menues are sortet different and so on. 

Will observe this effects for a longer period to get some "rules of behaviour" for it and if I got them I will report them here.
Comment 2 Maxim Monastirsky 2016-02-24 18:21:29 UTC
The attached file has customized menubar structure (unzip and check Configurations2/menubar folder), so it's used instead of the application one. This is by design, no bug here. And this customized menu doesn't have the Sheets menu.
Comment 3 ThierryT 2016-02-25 10:54:19 UTC
(In reply to Maxim Monastirsky from comment #2)
> The attached file has customized menubar structure (unzip and check
> Configurations2/menubar folder), so it's used instead of the application
> one. This is by design, no bug here. And this customized menu doesn't have
> the Sheets menu.

How to reproduced this BUG.

Under 4.4.6.3 LO version :
Open the Calc module => new Spreadsheet created and default Menu bar displayed.
Create a macro like in the attached file.
With the Menu Tools>Personalize>Menus.
Click on New button and create a New menu entry. Put it just before the Help Menu Item. Pay attention to insert the new entry in the file not in LibreOffice Calc (see option).
Save the file.
Open this file under LO 5.1.1.1 version.

For my point of view, when you add a new Menu Item in the Main Menu, you have to save in the file only the difference between the default Main Menu entries and the user menu not the complete Main Menu system.
That means, you will also display the Sheets menu in this case.
Comment 4 ThierryT 2016-02-25 16:29:55 UTC
I understand your point of view that it is a customized Main menu.

But how do you guarantee the portability of an application you develop between an older version and a new one if you suppress functionnalities in the new application menus ?
You have to rewrite completely the application ?
Waiting after your comments ?
Comment 5 Maxim Monastirsky 2016-02-25 18:41:54 UTC
(In reply to ThierryT from comment #4)
> But how do you guarantee the portability of an application you develop
> between an older version and a new one if you suppress functionnalities in
> the new application menus ?
That's a good question actually, and for some cases there is indeed no solution, and can't be solution by definition (esp. when there are major changes between versions, like we have in 5.0/5.1 compared to 4.4). And no - saving the diff won't help in many cases (have you ever tried to apply a patch when the surrounding code was changed?).

Actually, this isn't specific to menu customization. Ask extension developers, and they will tell you that sometimes they have to change their code, to work on newer versions.

Anyway, as an application developer, you should better stick to the official APIs for menu manipulation (XUIConfigurationManager, Addon.xcu merging etc.), rather than relying on some "customization" feature. Only doing that will give you some chances to be compatible with several versions.
Comment 6 ThierryT 2016-03-05 18:53:22 UTC
Created attachment 123317 [details]
Adding user Menu
Comment 7 ThierryT 2016-03-05 19:00:49 UTC
I developped a file using the XUIConfigurationManager (see the attached file "Adding user Menu")

The major problem I see is that this new menu is also added to all the new files you will open and it is suppressed only when you close the file "Adding user Menu".

That means if you use the user menu in a new file, you have an error message displaying (this new file has not the correct macros).

I did not find the possibility to apply the new user menu only to the original file.
For my side, it is only possible if you have a customize file.
Comment 8 Maxim Monastirsky 2016-03-05 20:04:32 UTC
(In reply to ThierryT from comment #7)
> The major problem I see is that this new menu is also added to all the new
> files you will open and it is suppressed only when you close the file
> "Adding user Menu".
Instead of:

oFrame.layoutManager.getElement("private:resource/menubar/menubar").setSettings(oSettings)

Try this:

oController = oFrame.getController()
oModel = oController.getModel()
oModelUIManager = oModel.getUIConfigurationManager()
oModelUIManager.insertSettings("private:resource/menubar/menubar", oSettings)

With this, you also don't need to restore the original menu on close.
Comment 9 ThierryT 2016-03-20 15:33:51 UTC
Thanks it works perfectly.