I want to design a “smart” footer to include varying information within a sequence of pages associated with the same page style.
In the main text flow, I insert here and there a field from
Variables as type Set variable, Select flag (this is the name of the variable, always the same), Format Standard and value 0 or 1.
The footer is made of three paragraphs:
- A “common” one with field Show variable flag Standard to echo the present value
- The second begins with a field from
FunctionsType Hidden paragraph, Condition flag==0 and text “flag <> 0”
- The third one is similar to the second but for condition flag==1 and text “flag <> 1”
Since I have
Filed Names enabled and hidden text/paragraphs visible to debug my test document, I use print view to see the result.
The footer correctly displays the current value of the variable (the last set in the page), however hidden paragraph conditional seems to be computed only once with the value valid at the end of the first page.
My understanding of Writer behaviour is:
- header/footer are computed first time they are needed and stored in a cache of the page style, i.e. at start of first page (header) and at bottom of first page (footer)
- “simple” fields are kept as “insertion action”, like put current page number of current value of variable, including for cross-references
- conditional and hidden text/para/section: the condition is evaluated and related text is inserted; condition is discarded, deemed no longer necessary because “right” text has been selected; consequently this part becomes “static” in the cache and is not recomputed on next pages
Since I can change the value of a variable in the running text, I’d like the header/footer conditional text to remain “dynamic” so that its contents reflects the current value of the variable, not the value it had when the page style was first switched.
Am I missing something? Is this a bug?
Adding a test file: HiddenParaTest.odt
Changed title because issue is specific to header/footer; clarified my understanding of the phenomenon
Filed bug tdf#128041