Created attachment 198597 [details] bnc519228_odd-breaksB.docx: unit test from sw/qa/core/header_footer When a DOCX/RTF file with alternating even/odd sections is loaded, the process creating the style fails to copy over some of the header/footer properties. This can be seen by the lack of header spacing provided to the odd pages in the unit test submitted during the initial implementation in LO 4.4 commit b32881b6723072c8d1a652ea147d12e75766d504 Author: Luboš Luňák on Sun Aug 17 21:35:48 2014 +0200 fix reading even/odd page breaks from .docx (bnc#519228) Steps to reproduce: 1.) open bnc519228_odd-breaksB.docx Notice the difference in the headers on page 1 and page 2. On page 1 (Converted1 page style), there is no space underneath the header - the body text starts immediately. On page 2 (Default Page style) the header is half an inch tall. Going into the header properties, we see significant differences (from what was supposed to be a "copied" style). Converted1 : spacing = 0; use dynamic spacing = false; Height = 0.5cm (defaults) Default PS : spacing = 1.19cm, use dynamic spacing = true; Height = 0.10cm The problem is that the header has not yet been turned on when those properties attempt to be copied over - so they were just ignored. Bug found by Collabora's mso-test. -------------- code analysis --------------- sw/source/writerfilter/dmapper/PropertyMap.cxx's CloseSectionGroup() - createPageStyle - copy (except staticDenyList) properties of current page style to new - sets the FollowStyle to the current name - *** inserts the new style into LO page styles *** - completeCopyHeaderFooter (which turns on H/F and first/left/right settings) There is something special that must happen when activating the page style by inserting it into the list of usable styles. (Perhaps it is impossible to actually turn on the H/F until that happens?)
A sloppy "just make it work" patch at https://gerrit.libreoffice.org/c/core/+/180417
(In reply to Justin L from comment #0) > sw/source/writerfilter/dmapper/PropertyMap.cxx's CloseSectionGroup() Oops: SectionPropertyMap::CreateEvenOddPageStyleCopy()
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/23a73756211eb198c2e6e46975d564c6274165a2 tdf#164748 writerfilter: fix missing even/odd header properties It will be available in 25.8.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.
(In reply to Justin L from comment #1) > A sloppy "just make it work" patch I fixed it so it isn't sloppy any more.