Created attachment 191752 [details] Comparsion MSO vs LibreOffice 24.8 master Steps to reproduce: 1. Open attachment 98490 [details] from bug 78304 -> The first page is duplicated Reproduced in Version: 24.2.0.0.beta1+ (X86_64) / LibreOffice Community Build ID: 0034d2ab9382da86340738137218791a4ccc9c90 CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: gtk3 Locale: fr-FR (es_ES.UTF-8); UI: en-US Calc: threaded [Bug found by office-interoperability-tools]
Regression introduced by: author Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> 2023-11-28 13:46:21 +0900 committer Tomaž Vajngerl <quikee@gmail.com> 2023-12-01 08:26:38 +0100 commit 4b0fa253a4540f5461397815d290586f9ddabe61 (patch) tree c58c59871244dc75e538caeea40658303da00b8b parent 93357349ff1998b41ea1ebedf09dc1cc5da316f7 (diff) tdf#136472 adjust ooxml import to handle first header/footer Bisected with: bibisect-linux64-24.2
It is not that the first page is duplicated. The first page's content primarily comes from a large, textual image attached to the header. What is duplicated is that the header for page 1 is also now copied to the first-page header on page 2. (Page 2's style now has a different "first page header" - which is correct, but it should be an empty header.)
Created attachment 195193 [details] 159013_inheritHeader.docx: inheriting first page styles LO has never done this properly yet, although definitely quikee's patch has changed things. It affect this document as well.
Created attachment 195194 [details] 159013_inheritHeader_mso2010.pdf: how it looks in the authoring program
I expect the problem is in copyHeaderFooterTextProperty. UNO is too stupid to allow us to copy the "First" text (because a separate "first" is not enabled on this previous (source) page style, so it just copies the text of "default"). We probably need to define a DomainMapper XText as xFirst and update that any time a new first is defined: copying from that instead of copying it from the previous style.
Yes, my strategy to fix this is to add some UNO properties (or change the existing ones) where the XText can be set strictly to the page it is meant to - no matter what is enabled or not. When implementing this I was fighting this all the time and it took quite some time to get it working correctly for the current tests, but even that was not completely correct. The code is also not the best because of this. Having better control what is set without relying on the order how it is set would make everything much easier. Now I just need to get a bit less busy as I currently am to find time for this...
proposed fix at https://gerrit.libreoffice.org/c/core/+/170259
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/eaca93b19ebf91e495c0985f304bfa6687c55c8d tdf#159013 writerfilter: link to the correct first-page header It will be available in 25.2.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.
Justin Luth committed a patch related to this issue. It has been pushed to "libreoffice-24-8": https://git.libreoffice.org/core/commit/ed8f1f850605f9b39c1643014a982405d86b5a78 tdf#159013 writerfilter: link to the correct first-page header It will be available in 24.8.0.2. 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.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/671290e8054366997e512572b2e4e38efbf95f80 Revert "tdf#159013 writerfilter: link to the correct first-page header" It will be available in 25.2.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.
Justin Luth committed a patch related to this issue. It has been pushed to "libreoffice-24-8": https://git.libreoffice.org/core/commit/e7615e464ea6fe7f0a87fb5acd61daf65e7d55a7 Revert "tdf#159013 writerfilter: link to the correct first-page header" It will be available in 24.8.0.2. 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.
See attachment 195276 [details] from bug 158977 and make sure any fix works with that document also.