sw/source/filter/ww8/docxattributeoutput.cxx | 2 ++ 1 file changed, 2 insertions(+)
New commits: commit 6f13fafca3b63a7a22d54c06c34d139ad0d24f9b Author: Noel Grandin <[email protected]> AuthorDate: Thu Jan 15 14:36:41 2026 +0200 Commit: Michael Stahl <[email protected]> CommitDate: Tue Jan 20 20:36:37 2026 +0100 officeotron: w:r inside w:pPr is invalid we end with the following in word/header1.xml: <w:hdr> <w:p> <w:pPr> <w:pStyle w:val="Header"/> <w:r> <w:br w:type="page"/> </w:r> <w:rPr></w:rPr> </w:pPr> restrict the fix to the case of writing header data, just in case I missed some other case somewhere. Change-Id: I451480a075c55cafd016279d229dbf0698c01265 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197425 Tested-by: Jenkins Reviewed-by: Michael Stahl <[email protected]> (cherry picked from commit 821e808610a9710d4875bff65604f34aacf4a29c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197586 Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index c0861329eb96..b5feedaeeeb9 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -7103,6 +7103,8 @@ void DocxAttributeOutput::PageBreakBefore( bool bBreak ) void DocxAttributeOutput::SectionBreak( sal_uInt8 nC, bool bBreakAfter, const WW8_SepInfo* pSectionInfo, bool bExtraPageBreak) { + if (m_bWritingHeaderFooter && m_bOpenedParaPr) + return; // do not put a run inside <w:hdr>..<w:p>..<w:pPr> switch ( nC ) { case msword::ColumnBreak:
