Ask Your Question

Header locked Within but cannot lock Header itself

asked 2019-06-11 15:36:07 +0200

BenDev gravatar image

updated 2020-08-03 23:57:41 +0200

Alex Kemp gravatar image

Hi, I'm facing an issue on managing user restriction for action on a document. This issue seems to be specific to LibreOffice as it's about a pop-up menu on the header that apparently only exists on LibreOffice. I've found topics on the pop-up menu on the forum, but in most cases it was about the pros and cons of this element. Not really matching the question related to my context.

About the context: I've got a custom Header that is injected into a header section that is locked by password to avoid any user modification (or deletion). It works well on that point when it's about the section as the section is in "Read-only mode".

The problem is that in LibreOffice, when the user select the header area, a pop-up menu is displayed (see attached image). This menu allows the user to modify the header, and more problematical in my case to directly delete it!

So the user can easily delete the entire header whereas he's not allowed to modify what's inside. I didn't find for now any way to make this pop-up menu not displaying or to desactivate the sub-menu it contents to be sure that the user won't do anything on the header (it's kind the same for the footer by the way...)

Thanks in advance for any clue or solution for this issue...

image description

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2019-06-11 15:54:10 +0200

RGB-es gravatar image

Starting with version 6.2, it's possible to disable that menu on Insert → Header and Footer → Use header/Footer menu.

edit flag offensive delete link more


Thanks for this answer...but this option is not related to the document but to the LO user configuration. So if the document is deployed on many computers, the option could be already set to On or off.

A check on a recorded macro way to switch the option on or off gives:

rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("")

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:UseHeaderFooterMenu", "", 0, Array()

But it's a one way action that doesn't check if the option is already set to On or Off. So now I need to check for some code to do this in clean way.

BenDev gravatar imageBenDev ( 2019-06-11 16:22:16 +0200 )edit

No one else for any clue on this?

BenDev gravatar imageBenDev ( 2019-06-14 16:27:38 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-06-11 15:36:07 +0200

Seen: 100 times

Last updated: Jun 11 '19