Pages of the blog

26 November, 2016

Protecting Content in LibreOffice Writer form unpremeditated changes

On last week Mike Kaganski (one form Russian developers) asks me to correct a few things in the Help. In the fact, the speech was about addition a few strings in an article about protection of contents in LibreOffice Writer. But, when I started to work with the article, I understood that the article must be completely rewritten. I pushed the patch to gerryt. And I hope that the article will be available already in the Help of 5.3 version. In the blog, I would like to give additional explanations and at the same time to tell about some things which was not appropriate for the Help, in my opinion.

Please note that this protection does not safe the document from unauthorized access to data. This protection can prevent only accidental changes of contents. The contents is not encrypted, it is available in an open format in the file. In any case, even you use a password for protection of sections, it can be overcome by means of LibreOffice Writer resources very easy.

Section Protecting in LibreOffice Writer from accidental changes

Any section in the document LibreOffice Writer can be protected from accidental editing with using a password, and without it. How I understand, the ability to use a password have made for compatibility with MS Office Word.

To enable protection of section

First of all, it needs to select the section that you want to protect. And today, there are two dialogs in LibreOffice Writer, one for creating, and other for editing sections. These dialogs are almost the same, but they serve different purposes. (Why not join them, I do not know. This is a question for the design team.) If the section does not exist, select the text (or not select, if it will insert), go to Insert – Section... in the main menu... If the section already exists, go to Format - Section... in the main menu and select a section. In the second case, you can also use the Navigator, right-click on the desired section and then choose Edit… in context menu.

As I said above, the protection can be with a password and without. If you want the protection without a password, just choose the Protect in the Write Protection section of the dialog window. If you want to protect with a password, you need to choose the Protect, then the With password. This opens a window where you will be prompted to enter and confirm the password, and a warning about the password which should be at least 5 characters.
For the record, earlier a password could be one character, but our developers decided to increase protection. Why, I do not know, it is likely to be compatible. A Password can be overcome into a few mouse clicks, it does not matter 1 or 35 characters ... but I'll explain later.

Modification of section protection

Go to Format – Section... in the main menu and select the section, or you can use the Navigator, right-clicking on the desired section and choose Edit... in the context menu ... And further:
  1. If the protection has no password, but you want to set up it, choose the With password, and in the window that appears, enter and confirm the password (at least 5 characters).
  2. If the password is, and you want to remove it, uncheck the With password, and in the window that appears, type the current password.
  3. If the protected has a password, and you want to change the password, click the Password… button. And in the window that appears, type the current password, and the next window, enter and confirm a new one.

To disable protection of section

Go to Format – Section... in the main menu and select the section, or you can use the Navigator, right-clicking on the desired section and choose Edit... in the context menu ... And further:
  1. If the protection has no password, uncheck the Protect.
  2. If the protection has password, uncheck the Protect, and in the window that appears, type the current password
As you can see, all the functionality is very simple, just two different windows can confuse.

Protection of table cells in LibreOffice Writer from accidental changes

LibreOffice Writer allows us to protect a one cell or several cells and whole table. In contrast to sections, the cells and tables can be protected by a password.

To enable protection of cells and a table

Turning of protection to one, several cells or whole table is made identical except for selection of the necessary object. If you protect an cell, you can put the cursor in the cell or select this cell. If multiple cells need to be protected, they should to be selected. And if a whole table is needed to be protected, you should select the whole table. Further, go to Table — Protect Cell in main menu.

To disable protection of cells and a table

Turning off of protection in LibreOffice Writer can be made also identically, but tables have additional method. Select cells from which the protection needs to be disabled. For one cell you can put the curdor in the cell. Further, go to Table — Unprotect Cells in main menu.
For the whole table can be used Navigator. Right-click on the needed tables in Navigator and go to Table — Unprotect in context menu.
There is a feature which allows cursor to put in protected cells. This feature is enabled by default. To enable or disable the future you can in Options... Go to Tool – Options... – Wrter – Formatting Aids and choose/uncheck Enable Cursor in the Protected Arias section.

Protection of Indexes and Tables of Contents from accidental changes

In LibreOffice Writer Table of contents, Bibliography, tables and illustrations lists are automatically created, and have the protection against accidental changes by default. And I think that is right, because 99.9% of cases, we do not have to change anything in it. But the protection can also be disabled. This can be made in three ways, from the context menu of the right mouse button, in the Navigator or in the main menu.

To disable of Indexes and Tables of Contents

Above, I talked about the feature Enable Cursor. If you want use the context or main menu and this feature is disabled, you need to enable one.

  1. Right-click on the Table of contents/index and choose Edit index in context menu. Uncheck the Protected against manual changes to the tab Type in the opened window.
  2. Right-click on the desired table of contents or index in the Navigator, and uncheck the Pointers – Read Only in the context menu.
  3. Put on the cursor to the desired index and go to Insert – Table of contents and Indexes – Table of Contents, Indexes and Bibliography in the main menu. Type drop-down list is blocked in this case, but to uncheck the Protected against manual changes to the Type tab is possible.

To enable of Indexes and Tables of Contents

To enable protection, you should do the same as described above, but instead of unchecking, you should choose the Protected against manual changes.

Protect the whole document in LibreOffice Writer from accidental changes

You can protect at once the whole document the change in LibreOffice Writer. It works with files which have .doc, .docx, .odt, .ott as name suffix. Note that it works for templates. :)
To enable protection against changes of the whole document, go to Tools – Options… the main menu and in the window, select the Writer - Compatibility, and then choose the Protect Form. To disable the protection, it should be unchecked.

I would like to note that this function is a property of the document. But neither the Save icon on the toolbar or status icon in the status bar of Writer does not indicate that the document was changed, and requires saving. So, be careful.
As I understand, this feature has been designed to be compatible with MS Word. There was a button on the toolbar to protect the document. And still there are documents .doc with such protection.

Ignoring of protection against accidental changes

And now I'll tell you about the most interesting thing. But I don’t recommend to use it without acute need. In LibreOffice Writer there is a check box, which makes pointless the whole "protection" described above as pointless. It is for this reason, in all sections specified that protection is only against accidental changes. Go to Tools - Options... and in the opened window, select the section Writer - Formatting Aids and see the check box Ignore protection in under the Protected Areas. This check box, such accessible and easy, inactivates the all protections above, including protection of sections with a password. 5 mouse clicks and nothing works. :) Ignoring of the protection isn’t a document property, but it is application setting. That is putting it in, all documents will ignore protection from accidental change, including in the Index and Tables of Contents. That is not good, because, as the practice shows, it is easier than ever to ruin that should not ruin.
In 5.3 version, this checkbox was removed from harm's way. Of course, this functionality remains, but the simple method to ruin a document is removed. If you decide to use this functionality, I would like to recommend you to use a separate user profile, because to forget to change the value (or check box) back very easy.
With LibreOffice 5.3, this functionality will be available in the Expert settings. You can find it in the Tools - Options... main menu, and, in the opened window, go to the section LibreOffice - Advanced. At the bottom there is a button Open the expert settings. In the new window that opens, this function can be found in the org.openoffice.Office.Writer - Cursor - Options - IgnoredProtectedAria. If you change its value from false to true, then all areas are protected from accidental editing will be available for editing in this user profile of the LibreOffice, until the value will not change back.

It seems I told all about protection against accidental changes.

Source and additional information


  1. As of LibreOffice 6.2, "Protect the whole document in LibreOffice Writer from accidental changes" is no longer valid.