sw/source/filter/ww8/docxattributeoutput.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
New commits: commit a43482e27644e45bd13d6eed3f550e3843cc1e58 Author: Noel Grandin <[email protected]> AuthorDate: Wed Oct 29 12:23:39 2025 +0200 Commit: Miklos Vajna <[email protected]> CommitDate: Fri Oct 31 10:31:10 2025 +0100 mso-test: fix order of w:pStyle and w:rPr elements When loading and then saving the document from forum-mso-en-10184.docx, the ordering of elements under w:pPr was wrong in two different ways. Change-Id: Ia99b759a871d5d324ec4c6689de3eb5dcf9c4f9b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193142 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 2d6ed151da8d..664634b01107 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1447,14 +1447,14 @@ void DocxAttributeOutput::StartParagraphProperties() m_pSerializer->startElementNS(XML_w, XML_pPr); m_bOpenedParaPr = true; + InitCollectedParagraphProperties(); + // and output the section break now (if it appeared) if (m_pSectionInfo && m_rExport.m_nTextTyp == TXT_MAINTEXT) { m_rExport.SectionProperties( *m_pSectionInfo ); m_pSectionInfo.reset(); } - - InitCollectedParagraphProperties(); } void DocxAttributeOutput::InitCollectedParagraphProperties() @@ -1624,9 +1624,6 @@ void DocxAttributeOutput::EndParagraphProperties(const SfxItemSet& rParagraphMar PopulateFrameProperties(&rFrameFormat, aSize); } - // Merge the marks for the ordered elements - m_pSerializer->mergeTopMarks(Tag_InitCollectedParagraphProperties); - // Write 'Paragraph Mark' properties m_pSerializer->startElementNS(XML_w, XML_rPr); // mark() before paragraph mark properties child elements. @@ -1713,6 +1710,9 @@ void DocxAttributeOutput::EndParagraphProperties(const SfxItemSet& rParagraphMar m_aFramePr.SetUseFrameTextDirection(true); } + // Merge the marks for the ordered elements + m_pSerializer->mergeTopMarks(Tag_InitCollectedParagraphProperties); + m_pSerializer->endElementNS( XML_w, XML_pPr ); if (m_rExport.m_bHasBailsMetaData)
