sw/source/filter/ww8/docxattributeoutput.cxx | 47 +++++++++++++-------------- 1 file changed, 24 insertions(+), 23 deletions(-)
New commits: commit f00042c7dc7743d3fb8524af1af7d9d194c55e44 Author: Noel Grandin <[email protected]> AuthorDate: Fri Nov 28 13:53:54 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Tue Dec 2 08:35:43 2025 +0100 officeotron: wrong ordering of elements under sdtPr Change-Id: I302a7796f3794148d6c72ecb2295f291bdf807ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194782 Tested-by: Jenkins Reviewed-by: Michael Stahl <[email protected]> (cherry picked from commit 217c6988c52d8bbd5a97aa777efdc40d1f0ed305) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194896 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Noel Grandin <[email protected]> diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 1ef484fcf7e6..436158bf3c58 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2637,21 +2637,6 @@ void DocxAttributeOutput::WriteContentControlStart() m_pSerializer->startElementNS(XML_w, XML_sdt); m_pSerializer->startElementNS(XML_w, XML_sdtPr); - if (!m_pContentControl->GetPlaceholderDocPart().isEmpty()) - { - m_pSerializer->startElementNS(XML_w, XML_placeholder); - m_pSerializer->singleElementNS(XML_w, XML_docPart, FSNS(XML_w, XML_val), - m_pContentControl->GetPlaceholderDocPart()); - m_pSerializer->endElementNS(XML_w, XML_placeholder); - } - - if (!m_pContentControl->GetDataBindingPrefixMappings().isEmpty() || !m_pContentControl->GetDataBindingXpath().isEmpty() || !m_pContentControl->GetDataBindingStoreItemID().isEmpty()) - { - m_pSerializer->singleElementNS( XML_w, XML_dataBinding, - FSNS(XML_w, XML_prefixMappings), m_pContentControl->GetDataBindingPrefixMappings(), - FSNS(XML_w, XML_xpath), m_pContentControl->GetDataBindingXpath(), - FSNS(XML_w, XML_storeItemID), m_pContentControl->GetDataBindingStoreItemID()); - } if (!m_pContentControl->GetColor().isEmpty()) { @@ -2683,25 +2668,41 @@ void DocxAttributeOutput::WriteContentControlStart() OString::number(m_pContentControl->GetId())); } - if (m_pContentControl->GetTabIndex()) - { - // write the unsigned value as if it were signed since that is all we can import - const sal_Int32 nTabIndex = static_cast<sal_Int32>(m_pContentControl->GetTabIndex()); - m_pSerializer->singleElementNS(XML_w, XML_tabIndex, FSNS(XML_w, XML_val), - OString::number(nTabIndex)); - } - if (!m_pContentControl->GetLock().isEmpty()) { m_pSerializer->singleElementNS(XML_w, XML_lock, FSNS(XML_w, XML_val), m_pContentControl->GetLock()); } + if (!m_pContentControl->GetPlaceholderDocPart().isEmpty()) + { + m_pSerializer->startElementNS(XML_w, XML_placeholder); + m_pSerializer->singleElementNS(XML_w, XML_docPart, FSNS(XML_w, XML_val), + m_pContentControl->GetPlaceholderDocPart()); + m_pSerializer->endElementNS(XML_w, XML_placeholder); + } + if (m_pContentControl->GetShowingPlaceHolder()) { m_pSerializer->singleElementNS(XML_w, XML_showingPlcHdr); } + if (!m_pContentControl->GetDataBindingPrefixMappings().isEmpty() || !m_pContentControl->GetDataBindingXpath().isEmpty() || !m_pContentControl->GetDataBindingStoreItemID().isEmpty()) + { + m_pSerializer->singleElementNS( XML_w, XML_dataBinding, + FSNS(XML_w, XML_prefixMappings), m_pContentControl->GetDataBindingPrefixMappings(), + FSNS(XML_w, XML_xpath), m_pContentControl->GetDataBindingXpath(), + FSNS(XML_w, XML_storeItemID), m_pContentControl->GetDataBindingStoreItemID()); + } + + if (m_pContentControl->GetTabIndex()) + { + // write the unsigned value as if it were signed since that is all we can import + const sal_Int32 nTabIndex = static_cast<sal_Int32>(m_pContentControl->GetTabIndex()); + m_pSerializer->singleElementNS(XML_w, XML_tabIndex, FSNS(XML_w, XML_val), + OString::number(nTabIndex)); + } + if (m_pContentControl->GetPicture()) { m_pSerializer->singleElementNS(XML_w, XML_picture);
