Description: Calc disables header/footer when open an under office version 1.3 saved document with an older version Steps to Reproduce: 1. Open Calc (Version > 7.2.5.2) 2. Type into A1 cell any data, like 1111 3. Make sure Header and Footer checkboxes are enabled in Format-Page dialog on its tabs 4. Save file as ODS and close it 5. Open the file with an older program version like 6.4.7.2 (default Ubuntu 20.04) 6. Look at header and Footer tabs in Format-Page dialog => the both options are disabled Actual Results: Calc disables header/footer when open a spreadsheet in an older software version Expected Results: Calc shows header/footer state when reopen with any software version Reproducible: Always User Profile Reset: No Additional Info: Document saved under: Version: 7.2.5.2.0+ / LibreOffice Community Build ID: 711f8d38e9451cd2fd39b6963d2a3fc166f04cb1 CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded and Version: 7.3.0.3 / LibreOffice Community Build ID: f4d11761603c82fae6474d6e0e1cb32d39b86e4b CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded but not in 7.1.0.3 => regression Spreedshed open under: Version: 6.4.7.2 Build-ID: 1:6.4.7-0ubuntu0.20.04.2 CPU-Threads: 8; BS: Linux 5.4; UI-Render: Standard; VCL: gtk3; Gebietsschema: de-DE (en_US.UTF-8); UI-Sprache: de-DE Calc: threaded Related Bug: Bug 144940 https://bugs.documentfoundation.org/show_bug.cgi?id=144940
A quick analyze of the difference of a document which works (version 1.2) and one which doesn't work (version 1.3) shows that the only main difference concerning the header and footer of these documents are the lines <office:master-styles> <style:master-page style:name="Default" style:page-layout-name="Mpm1"> [...] <style:header-first style:display="false"/> [...] <style:footer-first style:display="false"/> [...] </style:master-page> </office:master-styles> So if I remove this header-first and the footer-first style, everything works as it should. Hope that helps to solve the issue.
(In reply to Wittich from comment #1) > A quick analyze of the difference of a document which works (version 1.2) > and one which doesn't work (version 1.3) shows that the only main difference > concerning the header and footer of these documents are the lines > > <office:master-styles> > <style:master-page style:name="Default" style:page-layout-name="Mpm1"> > [...] > <style:header-first style:display="false"/> > [...] > <style:footer-first style:display="false"/> > [...] > </style:master-page> > </office:master-styles> > > So if I remove this header-first and the footer-first style, everything > works as it should. > > Hope that helps to solve the issue. Here is a way to fix corrupted files so that they show the header/footer correctly with an old calc installation: 1. unzip -p file.ods styles.xml > styles.xml 2. sed -i -r 's/<style\:(footer|header)\-first style\:display="false"\/>//g2' styles.xml 3. zip file.ods styles.xml This works for me as I get regularly ODS which are saved as office version 1.3 and I lose the header and footer at the moment.
I don't reproduce. Tried with saving in LO 7.4+ in Windows as 1.3 extended and opening LO 6.4 in Linux and Windows. HF are enabled .
I can reproduce it also on a Windows 10 system: Version: 6.2.5.2 (x64) Build ID: 1ec314fa52f458adc18c4f025c545a4e8b22c159 CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; Locale: en-US (en_DE); UI-Language: en-GB Calc: threaded Not only the HF is disabled but, if I reactivate it, the content is "lost". I will attach a test file.
Created attachment 178018 [details] Test file created with LO 7.2 Test file has an activated HF with a custom content: - Header Center area: Test Sheet 1 - Footer Center area: Test Footer
I reproduce with that sample. Not clear why not from scratch.
(In reply to Timur from comment #6) > I reproduce with that sample. Not clear why not from scratch. Can you compare the styles.xml from my sample with your file? Just rename the *.ods file into *.zip then you can have a look into it (I used xmllint to format the file pretty/readable: `cat styles.xml | xmllint --format - > styles2.xml`). Also, you wrote that you created the file with LO 7.4+, I have only reproduced it with 7.2 and 7.3.
I reproduced by making ODS with empty H/F in Linux with 7.2 latest and reopening in same 7.2, not sure what's important. Also repro by opening ODS from 7.4+ in 7.2, so it wasn't old versions only. No repro by opening ODS from 7.4+ in 7.4, so not current versions. Problem seems to be only with empty H/F. Meaning that I confirm the report but don't consider it a bug, there's no damage. I mark WontFix. Please test more. If you reproduce a bug with H/F that have some content, please set Unconfiormed.
Created attachment 178047 [details] Test in LO 7.4+ opens OK Seems like there may be 2 issues: - opening ODS with empty H/F in older LO makes them disabled, which makes no damage and is WontFix - opening attached ODS, not all, in older LO looses H/F, which is a problem, but not clear what exactly makes it - and it doesn't exist with new LO. Here is ODS from master 7.4+.
Created attachment 178071 [details] Test file created with LO 7.3 with first and rest H/F actived As I wrote above, you can fix the second issue with removing the header-first and footer-first style... so that got me thinking what is this option *-first, so with LO 7.2* you have this option "Same content on first page" when you uncheck it you can enter two different H/F. One called H/F (first) and one H/F (rest). Now if you fill out both the first and the rest it works in LO 6.4. So if I got this right, LO 6.4 read the first as main H/F as it doesn't know about a second H/F (rest). No clue how to fix this... For me, works at the moment the following commands as a fix: file='147141 test 74 13e.ods' unzip -p "$file" styles.xml > styles.xml sed -i -r 's/<style\:(footer|header)\-first style\:display="false"\/>//g2' styles.xml unzip -p "$file" styles.xml > styles.xml Et voilà!
I search a little on the OASIS Open page and as far I understand the OpenDocument schema 1.2 and 1.3 the h/f-first style is only valid in office version 1.3. From this standpoint, LO 6.4 and before don't have correctly implemented OpenDocument 1.2. I guess there is no fix as long it's not fixed in LO 6.4. Here are the details from 1.3 schema: > The <style:header-first> element represents the content of a header for a first page, if different from the left/right page in a <style:master-page> element. > > The term "first page" means the first page to which the page style is applied, regardless of any numbering. If a different page style is applied in between two applications of a page style that has the <style:header-first> element, each of the applications of the page style has its own first page. Source: https://docs.oasis-open.org/office/OpenDocument/v1.3/cs01/part3-schema/OpenDocument-v1.3-cs01-part3-schema.html#a_16_10__style_header_ In the 1.2 schema, this style element doesn't exits: https://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#a16_10_style_header_
hi Regina, please see if you can.
Any updates, further thoughts on this topic?
... still running at least once a month over that issue!
The proper way out it seems would be to save the *first only when saving to >=1.3 but not <1.3 (1.2 or 1.2-extended).
Or maybe 1.2-extended would be ok when using the lo-ext namespace.
With the fix following, for reading with LO versions <7.2.5 ODF 1.2 needs to be written. Versions >=7.2.5 that have the fix of bug 144940 understand both ODF 1.3 and ODF 1.2-extended. But if those versions also need to write for earlier versions then versions having this fix here will have to write ODF 1.2 already because 7.2.x and 7.3.x versions without this fix do not write ODF 1.2 correctly if the file already contained the *-first elements.
Eike Rathke committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/71081a2a79a7b5a1eefec60fc687c533a95d190d Resolves: tdf#147141 style:header-first/footer-first only ODF 1.3|1.2-extended It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Pending review https://gerrit.libreoffice.org/c/core/+/142140 for 7-4
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-7-4": https://git.libreoffice.org/core/commit/b6ed0378b4ae893c7631f36d754497a1162244b5 Resolves: tdf#147141 style:header-first/footer-first only ODF 1.3|1.2-extended It will be available in 7.4.3. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.