Bug 144940 - Calc disables header/footer or loses footer content after saving a spreadsheet ( part 2 )
Summary: Calc disables header/footer or loses footer content after saving a spreadshee...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.2.0.4 release
Hardware: All All
: highest critical
Assignee: Attila Bakos (NISZ)
URL:
Whiteboard: target:7.4.0 target:7.3.0.0.beta2 tar...
Keywords: bibisected, bisected, regression
: 144281 144368 144430 144613 144935 145007 145514 145549 145626 145686 145727 145809 145893 146050 146338 146457 146467 147328 (view as bug list)
Depends on: 144184
Blocks: Calc-Header-Footer
  Show dependency treegraph
 
Reported: 2021-10-05 10:23 UTC by Xisco Faulí
Modified: 2022-02-09 22:36 UTC (History)
39 users (show)

See Also:
Crash report or crash signature:


Attachments
Test case spreadsheet (16.13 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-10-11 15:16 UTC, eomanis
Details
Test case spreadsheet, screenshots how to reproduce (227.81 KB, application/x-7z-compressed)
2021-10-11 15:20 UTC, eomanis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2021-10-05 10:23:35 UTC
+++ This bug was initially created as a clone of Bug #144184 +++

Description:
Calc disables header/footer when saves a spreadsheet

Steps to Reproduce:
1. Open Calc
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
6. Look at header and Footer tabs in Format-Page dialog => the both options are disabled

Actual Results:
Calc disables header/footer when saves a spreadsheet

Expected Results:
Calc saves header/footer state when saves a spreadsheet


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.2.0.4 (x64) / LibreOffice Community
Build ID: 9a9c6381e3f7a62afc1329bd359cc48accb6435b
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Vulkan; VCL: win
Locale: ru-RU (ru_RU); UI: ru-RU
Calc: threaded

but not in 7.1.0.3 => regression
Comment 1 Xisco Faulí 2021-10-05 10:26:47 UTC
Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=b9993369b4011cd8f367e439f5248096827f1efc

author	Daniel Arato (NISZ) <arato.daniel@nisz.hu>	2021-06-08 11:53:42 +0200
committer	László Németh <nemeth@numbertext.org>	2021-06-29 22:50:43 +0200
commit b9993369b4011cd8f367e439f5248096827f1efc (patch)
tree 8eb5b94d9d7676f8b94f47206665842e70d3f154
parent f7567758d2a1024580b18bef4156e59e63ac9f6d (diff)
tdf#121715 XLSX: support custom first page header/footer

Bisected with: 7.2

Adding Cc: to Daniel Arato
Comment 2 Xisco Faulí 2021-10-05 10:27:35 UTC
*** Bug 144935 has been marked as a duplicate of this bug. ***
Comment 3 Xisco Faulí 2021-10-05 10:27:39 UTC
*** Bug 144368 has been marked as a duplicate of this bug. ***
Comment 4 Xisco Faulí 2021-10-05 10:33:42 UTC
*** Bug 144281 has been marked as a duplicate of this bug. ***
Comment 5 Xisco Faulí 2021-10-05 10:33:48 UTC
*** Bug 144430 has been marked as a duplicate of this bug. ***
Comment 6 Xisco Faulí 2021-10-05 10:34:06 UTC
*** Bug 144613 has been marked as a duplicate of this bug. ***
Comment 7 Xisco Faulí 2021-10-06 09:38:53 UTC
I don't know much about the code itself but I found out that bFirstHeader is always False < https://opengrok.libreoffice.org/xref/core/sc/source/filter/xml/XMLTableMasterPageExport.cxx?r=6f04952e#176 >. Doesn't matter if the option 'Same content on first page' is enabled or not
Comment 8 Dániel Arató (NISZ) 2021-10-06 13:03:27 UTC
Based on the reported repros over in #144184, does anyone have a hunch on what the reproducibility of this bug actually depends on?
Comment 9 Mike Kaganski 2021-10-06 13:28:28 UTC
(In reply to Dániel Arató (NISZ) from comment #8)

I have created a screencast there in attachment 175538 [details] - doesn't it help? Or maybe you may record your steps, so that we could try and compare them, to find the differences?
Comment 10 Mike Kaganski 2021-10-08 20:58:47 UTC
*** Bug 145007 has been marked as a duplicate of this bug. ***
Comment 11 Timur 2021-10-09 05:17:36 UTC
In addition to steps from scratch, also sample can be used. 
Open ODS attachment 174988 [details] from bug 144368, confirm F/H turned on (regardless if content changed) and save, on reopen they are turned off.
Comment 12 eomanis 2021-10-11 15:16:32 UTC
Created attachment 175671 [details]
Test case spreadsheet
Comment 13 eomanis 2021-10-11 15:17:47 UTC
Can reproduce on Arch Linux, GNOME Wayland.
See attachment "Test case spreadsheet".

Version: 7.2.1.2 / LibreOffice Community
Build ID: 20(Build:2)
CPU threads: 12; OS: Linux 5.14; UI render: default; VCL: gtk3
Locale: de-DE (en_US.utf8); UI: en-US
7.2.1-2
Calc: threaded
Comment 14 eomanis 2021-10-11 15:20:27 UTC
Created attachment 175672 [details]
Test case spreadsheet, screenshots how to reproduce
Comment 15 Marqeaux 2021-10-14 14:15:13 UTC
I just updated LibreOffice to 7.2.2.2 via the LibreOffice PPA. According to the release notes, this bug should be fixed in 7.2.2.2 rc2. But this is not the case, because the header/footer disabling is still present, unfortunately.

In other words: no change compared to version 7.2.1.4.

Info about the LibreOffice I use:
Version: 7.2.2.2 / LibreOffice Community
Build ID: 20(Build:2)
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: nl-NL (nl_NL.UTF-8); UI: nl-NL
Ubuntu package version: 1:7.2.2~rc2-0ubuntu0.18.04.1~lo1
Calc: threaded
Comment 16 Mike Kaganski 2021-10-14 14:19:33 UTC
(In reply to Marqeaux from comment #15)
> I just updated LibreOffice to 7.2.2.2 via the LibreOffice PPA. According to
> the release notes, this bug should be fixed in 7.2.2.2 rc2.

Release notes can't tell you that *this* bug is fixed. They might mention fixes for bug 144184, which initially started with this problem, but in the course, was changed to track a different thing, which is why *this* one was created, and a developer has *assigned* this bug to them (until you, for unclear reason, unassigned it, changing the status from ASSIGNED to NEW).
Comment 17 Marqeaux 2021-10-14 23:15:26 UTC
Yes, you're right. My mistake. And I should make my comment under bug 144184, because the header/footer issue is still there in LibreOffice 7.2.2.2.

Sorry for the inconvenience. ;-)
Comment 18 edmarcos 2021-11-02 00:59:45 UTC
I just tested it on LibreOffice 7.3 alpha1 on debian sid/experimental and the header and footer error still persists
Comment 19 m_a_riosv 2021-11-03 23:33:38 UTC
*** Bug 145514 has been marked as a duplicate of this bug. ***
Comment 20 Kevin Suo 2021-11-05 11:05:37 UTC
*** Bug 145549 has been marked as a duplicate of this bug. ***
Comment 21 Kevin Suo 2021-11-05 11:12:03 UTC
Just a polite ping to Dániel Arató, please confirm whether you are still working on this one?
Comment 22 Kevin Suo 2021-11-05 11:19:28 UTC
I do not reproduce on current master, but I do reproduce on 7.2. Is it fixed somewhere on master?
Comment 23 Xisco Faulí 2021-11-05 11:55:48 UTC
(In reply to Kevin Suo from comment #22)
> I do not reproduce on current master, but I do reproduce on 7.2. Is it fixed
> somewhere on master?

Still reproducible for me in

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: ca74611acfef50280a2c1f785448d9a09cca5a0d
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 24 Graham Lees 2021-11-09 09:32:43 UTC
as of v7.2.2.2 (OS= Linux ubuntu 20.04.3) this bug persists.

Additional note -

What I have found:

Selecting Format -> Page Style -> Header select Header On then Insert -> Headers and Footers the header created from a previous version persists and on selecting OK the header will print correctly (test by toggling Print Preview).

The condition persists throughout any other sheet selection until that instance is closed (or saved and then closed) when the routine to select a header or footer has to be repeated. Once again, the header created from a previous version persists.
Comment 25 John Allender 2021-11-09 15:33:12 UTC
This bug still exists in version 7.2.2.2 (x64) running under WIN11.
Comment 26 John Allender 2021-11-10 14:31:30 UTC
Note:  When the ODS file is opened with Excel, the header/footer information is accurate and they appear in "Print Preview".  When the same file is opened with Calc, the headers/footers flag is shown as being 'off'.

It would appear that the header/footer flags are being properly stored, but that Calc 'reads' them as being 'off' when opening the file.
Comment 27 John Allender 2021-11-10 14:32:11 UTC Comment hidden (obsolete)
Comment 28 John Allender 2021-11-10 14:41:05 UTC
(In reply to John Allender from comment #27)
> Note:  When the ODS file is opened with OpenOffice Calc, the header/footer information
> is accurate and they appear in "Print Preview".  When the same file is
> opened with Calc, the headers/footers flag is shown as being 'off'.
> 
> It would appear that the header/footer flags are being properly stored, but
> that Calc 'reads' them as being 'off' when opening the file.
Comment 29 John Allender 2021-11-10 14:41:25 UTC Comment hidden (obsolete)
Comment 30 John Allender 2021-11-10 14:50:34 UTC
Please ignore/delete comments 27 and 29.  They are duplicates that I cannot figure out how to delete.  ☺
Comment 31 John Allender 2021-11-10 15:08:27 UTC
Finally:  If the test file is stored in the *.xlsx format, it opens properly with both headers/footers displayed in Libre Calc, MS Excel and OpenOffice Calc.

Please advise when problem with Libre Calc and *.ods formatted files is resolved.
Comment 32 Buovjaga 2021-11-11 09:26:18 UTC
*** Bug 145626 has been marked as a duplicate of this bug. ***
Comment 33 m_a_riosv 2021-11-15 14:46:09 UTC
*** Bug 145686 has been marked as a duplicate of this bug. ***
Comment 34 M.J.G. 2021-11-16 10:54:15 UTC
Some more info on this:

If you take the producer ods and manually remove the two "style:header-first" and the two "style:footer-first" elements from style.xml (and rezip) then the resulting ods loads and works as expected (until you save it again). 

Alternatively, change the two "style:header-first" from false to true and the setting will even survive a store-load cycle. (The same for the footer if you want that, I guess.)

This perfectly matches the commit description of https://cgit.freedesktop.org/libreoffice/core/commit/?id=b9993369b4011cd8f367e439f5248096827f1efc (which is the culprit of bug 144184):

There, the author implements export of the new feature to ods before implementing the import, which in itself is a strange order of things. Apparantly, the import never got implemented (and the loader mistakes "header-first" for "header" or such), or at least not correctly.

Also, where is the UI setting for that display first setting, and where would one set a style for the first page?
Comment 35 Mike Kaganski 2021-11-17 07:48:32 UTC
*** Bug 145727 has been marked as a duplicate of this bug. ***
Comment 36 m_a_riosv 2021-11-21 22:20:05 UTC
*** Bug 145809 has been marked as a duplicate of this bug. ***
Comment 37 Timur 2021-11-22 09:47:04 UTC
I think that regression commit should be reverted in 7.2.
Comment 38 m_a_riosv 2021-11-25 23:49:51 UTC
*** Bug 145893 has been marked as a duplicate of this bug. ***
Comment 39 Kari 2021-11-26 03:10:56 UTC
I opened a CALC spreadsheet which I had save in November 2020 in ODS format using an earlier version of CALC and it opened with headers/footers enabled. This indicates to me that that issue is with the save routines.
Comment 40 Kari 2021-11-26 03:12:56 UTC Comment hidden (obsolete)
Comment 41 Commit Notification 2021-11-26 10:53:01 UTC
Attila Bakos (NISZ) committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5db9b33dadda67c7f97d8c23df17211fae380919

tdf#144940 sc: fix disabled header/footer regression

It will be available in 7.3.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.
Comment 42 Commit Notification 2021-11-26 20:37:05 UTC
Attila Bakos (NISZ) committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/241733d1d91233b2f3bb996fc55302fb55b6c036

tdf#144940 sc: fix disabled header/footer regression

It will be available in 7.3.0.0.beta2.

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.
Comment 43 Commit Notification 2021-11-29 11:36:39 UTC
Attila Bakos (NISZ) committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/5ece740b3672b4204231c995a31ae97c108e7c80

tdf#144940 sc: fix disabled header/footer regression

It will be available in 7.2.4.

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.
Comment 44 Jürgen Mähnß 2021-11-30 16:30:18 UTC
I tested with 7.2.4dev and it works
Comment 45 Ulf Dunkel 2021-11-30 17:18:31 UTC Comment hidden (obsolete)
Comment 46 Xisco Faulí 2021-11-30 17:20:31 UTC Comment hidden (obsolete)
Comment 47 Ulf Dunkel 2021-11-30 17:30:34 UTC
(In reply to Xisco Faulí from comment #46)
> (In reply to Ulf Dunkel from comment #45)
> > > I tested with 7.2.4dev and it works
> > 
> > I am sorry but I cannot confirm that it works with 7.2.4dev
> > (https://git.libreoffice.org/core/+log/
> > 2eefc29b53b01dc07eb62aeb42cd56f178370d1d). I launched that dev version,
> > opened a critical .ods file, switched on header and footer again and saved
> > the file again. Then I relaunched LO 7.2.4dev, reloaded the newly saved file
> > and tried the Print Preview and both header and footer lines are gone again.
> 
> Hello Ulf,
> that build doesn't contain the fix.
> You have to download a more recent daily build from
> https://dev-builds.libreoffice.org/daily/libreoffice-7-2/

Hello Xisco Faulí,
thank you for pointing me to my mistake - you're right. I'm glad this issue has been fixed now.
Comment 48 NISZ LibreOffice Team 2021-12-01 09:28:44 UTC
Verified in:
Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 4ac9032163cf55c160145373e7c41741c9c339ca
CPU threads: 8; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: CL
Comment 49 Mario 2021-12-05 16:53:07 UTC
*** Bug 146050 has been marked as a duplicate of this bug. ***
Comment 50 Christian Lohmaier 2021-12-06 13:30:12 UTC
7.2.4 was a hotfix release, updating target in status-whiteboard
Comment 51 Marqeaux 2021-12-08 21:58:56 UTC
Today I downloaded LibreOffice 7.2.4.1 from the official LibreOffice website (nl.libreoffice.org), and installed it on my laptop from work. I opened a new Calc document and enabled both header and footer. After saving the document, I closed LibreOffice entirely. After restarting LibreOffice  and reopening that same document, it still resulted in a disabled header and footer.

Am I missing something? I'm confused now...

Info about the used LibreOffice:

Version: 7.2.4.1 (x64) / LibreOffice Community
Build ID: 27d75539669ac387bb498e35313b970b7fe9c4f9
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: nl-NL
Calc: threaded
Comment 52 Aron Budea 2021-12-08 22:09:22 UTC
(In reply to Marqeaux from comment #51)
> Am I missing something? I'm confused now...
Please note the comment above, there was an urgent security update with version number 7.2.4, and what would've been 7.2.4 has been pushed back to 7.2.5. The commit notification (comment 43) cannot be changed, however the Whiteboard field is updated to reflect this change.
Comment 53 Rainer Bielefeld Retired 2021-12-21 06:28:19 UTC
*** Bug 146338 has been marked as a duplicate of this bug. ***
Comment 54 Julien Nabet 2021-12-29 17:22:46 UTC
*** Bug 146457 has been marked as a duplicate of this bug. ***
Comment 55 Aron Budea 2021-12-29 17:45:37 UTC
*** Bug 146467 has been marked as a duplicate of this bug. ***
Comment 56 Aron Budea 2022-01-02 16:42:01 UTC
*** Bug 146457 has been marked as a duplicate of this bug. ***
Comment 57 marco 2022-01-04 14:24:16 UTC Comment hidden (obsolete)
Comment 58 Xisco Faulí 2022-01-04 14:35:08 UTC Comment hidden (obsolete)
Comment 59 Wittich 2022-02-02 15:13:52 UTC Comment hidden (obsolete)
Comment 60 Xisco Faulí 2022-02-02 15:26:13 UTC Comment hidden (obsolete)
Comment 61 Wittich 2022-02-02 15:32:25 UTC
(In reply to Wittich from comment #59)
> It seems like the issue is resolved when I reopen a file in 7.2.5.2. 
> 
> But I can still reproduce the problem when I reopen the file which was saved
> under 7.2.5.2 (office version 1.3) in an older version like 6.4.7.2 (office
> version 1.2).

I can reproduce the problem also with the 7.3 beta. There is no backwards capability at the moment to 6.4.

--
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
Comment 62 Wittich 2022-02-02 15:48:23 UTC
(In reply to Xisco Faulí from comment #60)
> Please, create a new report for it

Done Bug 147141 
https://bugs.documentfoundation.org/show_bug.cgi?id=147141
Comment 63 meolar 2022-02-09 22:36:38 UTC
*** Bug 147328 has been marked as a duplicate of this bug. ***