In order to reproduce the bug:
 Create new spreadsheet.
 Insert a bit of text into a cell.
 Save document.
 Change to read-only mode: Edit > Edit Mode
 Change Header: Insert > Headers and Footers… > Tab Header > Insert a bit of text into one of the areas. Then OK.. Expected: A change should not be possible.
 View Preview: File > Print Preview. The change of step 5 is displayed.
One possibility in order to correct this bug may be to grey the menu item “Headers and Footers...”. But I think there are cases where a user likes to view the content of headers and footers in read-only mode. For this use cases the dialogue Headers/Footers should be displayed furthermore, but it should not be possible to make any changes in this dialogue.
Build ID: 4a0ca73c31990568bf20a1c3f0906c3a5770a38e
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3;
Locale: ca-ES (ca_ES.UTF-8); Calc: group threaded
Also reproduced in
Build ID: 3ca42d8d51174010d5e8a32b96e9b4c0b3730a53
Threads 4; Ver: 4.15; Render: default;