sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx |   12 ------
 sw/source/filter/ww8/docxattributeoutput.cxx  |   47 +++++++++++++-------------
 2 files changed, 24 insertions(+), 35 deletions(-)

New commits:
commit 217c6988c52d8bbd5a97aa777efdc40d1f0ed305
Author:     Noel Grandin <[email protected]>
AuthorDate: Fri Nov 28 13:53:54 2025 +0200
Commit:     Michael Stahl <[email protected]>
CommitDate: Mon Dec 1 17:55:55 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]>

diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index 3aea158b3126..50b54cbdaff0 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
@@ -1092,9 +1092,6 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf142464_ampm)
 
 CPPUNIT_TEST_FIXTURE(Test, testSdtDatePicker)
 {
-    // FIXME: validation error in OOXML export
-    skipValidation();
-
     // Check that roundtrip for date picker field does not lose essential data
     createSwDoc("test_sdt_datepicker.docx");
     save(TestFilter::DOCX);
@@ -1120,9 +1117,6 @@ CPPUNIT_TEST_FIXTURE(Test, testSdtDatePicker)
 
 CPPUNIT_TEST_FIXTURE(Test, testContentControlGrabBag)
 {
-    // FIXME: validation error in OOXML export
-    skipValidation();
-
     // Given a document with a <w:sdt> tag:
     createSwDoc("content-control-grab-bag.docx");
 
@@ -1134,9 +1128,6 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlGrabBag)
 
 CPPUNIT_TEST_FIXTURE(Test, testContentControlShape)
 {
-    // FIXME: validation error in OOXML export
-    skipValidation();
-
     // Given a document with a <w:sdt> tag:
     createSwDoc("content-control-shape.docx");
 
@@ -1148,9 +1139,6 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlShape)
 
 CPPUNIT_TEST_FIXTURE(Test, testTdf104823)
 {
-    // FIXME: validation error in OOXML export
-    skipValidation();
-
     // Test how we can roundtrip sdt plain text with databindings support
     createSwDoc("tdf104823.docx");
 
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 1efbdb39c06b..612a1cae6b61 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2629,21 +2629,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())
     {
@@ -2675,25 +2660,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);

Reply via email to