Updating a Template deletes text from dependent document

Probably my error, but, in WRITER :

  1. Created a new user Template (OpenDocument Text Template), which does not contain a header (i.e header text). Template is saved in the default library.
  2. Created a new document based on that Template. The document contains a header (with text), that uses the “header” style.
  3. If I make any change to the Template (eg, change a colour, not necessarily to the “header” style), reopen the document click on the “Update Styles” button, the document header text is deleted. Surely the product is not deisgned to work like that?

Version: (x64)
Build ID: 23edc44b61b830b7d749943e020e96f5a7df63bf
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win;
Locale: en-AU (en_AU); UI-Language: en-US
Calc: threaded

Please edit your question to clarify:

  • style? paragraph or page? Only page style may enable a header
  • dependent in the title - only paragraph styles may depend on another one, but how did you create the style? Selecting an existing one and right-click New? Have you checked in Organizer it is really dependent?
  • create a document? Is it a different one from the doc containing the new style? If so, standard behaviour because styles are stored where created (unless you put the styles in a template)
  • change to the style? Is the style internal to the edited document?
  • reopen and refresh? What does refresh mean in this context?

And, as usual, mention OS and LO version.

Sorry about that - my mind was away in the clouds. Hopefully, the question is clear now. Thanks for the quick reply.

From what I understand, yu add a header in the text document.

Headers are properties of page styles. If the page style for that part of the document has the same name as one defined in the template (and usually, this is what is intended to be able to control page layout from the template), when you update styles on document loading, all styles revert to the template state, including the page styles.

I assume you “neglected” the importance of page styles or, more likely, your document structure is so simple that you use only Default Style page style which is always present, by definition.

Part of the fix is to enable header in Default Style template page style. This will keep the header area in the text document. Text will revert to template contents, but that’s halfway at least.

Depending on your header text, you can be immune to template changes if header text can be computed from document properties, such as date, chapter title, or File>Properties fields. This computation can be put in the template itself as fields inserted in the header. The value of the document fields is inserted when it reopens.

If your text if fully manual, there is no automatic solution.

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

Thanks for your quick and detailed answer. Although I don’t particularly like the way it is implemented, you’re only the messenger and the product works the way the product works. Mind you, I think I also now understand the techical issues surrounding the issue and cannot off the top of my head think of a better way.

Your suggestion about constructing a header from fields etc was useful and I may be able to use that to construct a solution of sorts.

Once again, thanks for the quick responses.