Apache OpenOffice (AOO) Bugzilla – Issue 51960
Variable fields are not displayed correctly when 'show' is placed on the first paragraph
Last modified: 2017-05-20 11:22:39 UTC
Help->About gives version 1.9.113 Variables are not displayed correctly when 'set' and 'show' are split between header and body. Reproducible: Create an empty document and enable header. Click in the header. Ctrl-F2 to show Fields doalog. Click on the 'Variables' tab of the dialog. Click Type 'Set Variable', Format 'Text' Enter 'foo' for Name and 'fooval' for Value. Click Insert. Repeat to create a 'set' for variable 'bar' in the header. Click on the body of the document. In the Fields dialog, click Type 'Show variable', Selection 'foo', click Insert. A field called foo is inserted but the value is blank. Expected the value to be as set in the header. Repeat for bar, the value is also blank. Additional info: It's possible to set a third variable in the body, and after that in the document it is once more possible to show the values of the variables that were set in the header. If the 'show's are deleted then there comes a point where all the 'show's of the variables set in the header become blank suddenly. It's also possible to set variables in the body of the document, but 'show' in the header does not work, or may work only for the first instance of 'show'. Background: I have been trying to create a document template that uses variables to allow setting document title, number, issue etc. in one place only. The behaviour of the variables is thwarting this. I have done a fair bit of experimentation but not found a working combination of set and show that spans the header and body.
Reassigned to ES.
Your description referes to 2 different problems. 1) a known limitation: when you insert a Show varible field at the very first paragraph of the document, the Set variable, placed in the header cannot be read. 2) "It's also possible to set variables in the body of the document, but 'show' in the header does not work, or may work only for the first instance of 'show'." Varables in a document work like variables in a program: they can only be used *after* the point they have been defined. So if you Set a variable in the body of page 1, it won't Show in header of page 1 but starting with the header of page 2. Example: -------- Header Page 1 Start ----------------- Show Foo: won't show -------- Header Page 1 Stop ----------------- Show Foo: won't show *Set Foo Show Foo: will show -------- Header Page 2 Start ----------------- Show Foo: will show -------- Header Page 2 Stop -----------------
ES->OS: can we fix 1)?
Thanks for the explanation. Is there a practical workaround, for example having a 'page -1' which contains variable settings but isn't printed? What is the best way to use variables, given that they will appear in headers/footers and body? Although it's logical to have definition before exposition, would it be more useful to have properties applied to the 'set', such that the value could be effective: a) globally (which would allow use before definition) b) after 'this page' c) from 'this page' onwards depending on the choice of the author? For most of my intended use I would use (a), eg. a single global definition for a document number, issue, date, author, security classification, etc.
Reset assigne to the default "issues@openoffice.apache.org".