Description: Start Writer and create a new document from the default template. Insert a page count field (Insert > Field > Page Count). Notice the field shows 1. Below this field, type "foo" followed by an endnote (Insert > Footnote and Endnote > Endnote). Type some text for the endnote itself (for example, "bar"). Return to your "foo". Notice that you have 2 pages now, but the page count field above "foo" still shows 1. Below "foo", insert another page count field. Notice it shows 2. So in other words here is what you will end up ``` 1 foo<superscript i> 2 ``` This is bad. Both counters should update automatically. Press F9 to update all fields. Now you have ``` 2 foo<superscript i> 2 ``` You may think pressing F9 resolves the issue partly, but actually it doesn't. For example, save this document and close it. Then open it again. Bam! You have ``` 1 foo<superscript i> 2 ``` again. ---------------------------- The real life case: I have a template for technical writing with the following protected section in the very beginning of the first page: ``` document title: <here is the field for title> page count: <here is the field for page count> aggigned template: <here is the field for assigned template> ``` Each time I open a document with endnotes, the page count field shows me the wrong number of pages. Steps to Reproduce: see above Actual Results: see above Expected Results: see above Reproducible: Always User Profile Reset: No Additional Info: see above
Confirmed on LibO 7.2.0.4 https://gerrit.libreoffice.org/gitweb?p=core.git;a=log;h=ce769e3009755dcf0082844e386f5dca4c8ecb2f in Ubuntu Linux 20. The page count field updates automatically when you add pages in the "normal" area, but not when you add an endnotes section. You have to do Tools - Update - Fields (or F9) to force the page count to update in some other way. Once updated, it will automatically update when you add so many endnotes that the text wraps to a second endnotes page. I'm not sure if this would count as a bug. I don't know how much auto-updating for such cases would cost in terms of time spent checking if the page count needs to be updated. Not auto-updating the ToC makes sense to me - it'd probably mean that Writer would have to check at virtually every new paragraph whether it's a paragraph that has to be added to the ToC. But it's definitely something that may give some users a headache. Do we want that?
> I'm not sure if this would count as a bug. [...] The main problem is that even if you update a field by pressing F9 and save your document, the field will revert to its un-updated state once you open the document again. There is no such an issue with ToC. Once you updated it, you can safely close the document and open it again. Updating ToC is boring at times, but it works reliably and predictabely. In case of page count the issue is different and is much worse.
(In reply to John from comment #2) > > I'm not sure if this would count as a bug. [...] > > The main problem is that even if you update a field by pressing F9 and save > your document, the field will revert to its un-updated state once you open > the document again. > > There is no such an issue with ToC. Once you updated it, you can safely > close the document and open it again. Updating ToC is boring at times, but > it works reliably and predictabely. > > In case of page count the issue is different and is much worse. After saving the field value is still correct. Do you save in docx format?
Created attachment 175126 [details] test file
(In reply to Peter Roelofsen from comment #3) No, I save it as ODT. I have just attached a test file. I hope with the test file it will be easier to understand what I mean.
Confirmed with 7.1.6.2 under Fedora Linux 34 When I reopen the test file (.odt) the first page count is wrong, the second one is correct. I wouldn't mind manually updating the fields (as I usually do) as long as the restored values (when opening the file) are consistent.
Status: UNCONFIRMED Am I the single person here who thinks this is a bug?
That Page Count doesn't update on insert doesn't seem like a bug. It would be resource intensive. But that Page Count opens wrong after F9 and save and close, seems like a bug.
Repro in recent master build: Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: ef3b7b7118c854d8ca67cc2249b6c08ddc1885eb CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3 Locale: en-AU (en_AU.UTF-8); UI: en-US Calc: threaded
This bug is still present and reproducible. Tested using: Version: 24.2.2.2 (X86_64) / LibreOffice Community Build ID: d56cc158d8a96260b836f100ef4b4ef25d6f1a01 CPU threads: 16; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win Locale: en-US (en_US); UI: en-US Calc: CL threaded and Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: bc7501d30ab9a3a5edec66d2f0022177f85d6127 CPU threads: 16; OS: Windows 10 (10.0 build 19045); UI render: Skia/Vulkan; VCL: win Locale: en-US (en_US); UI: en-US Calc: CL threaded