sw/qa/extras/ooxmlexport/ooxmlexport17.cxx   |    5 +++++
 sw/source/filter/ww8/docxattributeoutput.cxx |    5 ++---
 2 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 21bba2556bb5b0476546142109045ba11107d61b
Author:     Noel Grandin <[email protected]>
AuthorDate: Thu Jan 22 10:04:24 2026 +0100
Commit:     Noel Grandin <[email protected]>
CommitDate: Thu Jan 22 16:21:06 2026 +0100

    Revert "officeotron: tabIndex=-1 is invalid"
    
    This reverts commit 1bc98666e33c608d81c75fedcd51bba3745a32ed.
    
    It appears that the tabIndex==-1 is us deliberately disobeying the
    spec so that we can round-trip a value that MSOffice does not
    really care about.
    
    See
      commit 52d5f2e247e6b0a638fc0ec83f5dbc1cca30d1cd
      Author: Justin Luth <[email protected]>
      Date:   Wed Jan 25 16:29:55 2023 -0500
      tdf#151548 sw content controls: preserve tabIndex val="-1"
    
    Change-Id: I1383386ebc3d4d3f47ba427f33aa22215f10ac8e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197794
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
index bbb5aaffa922..0471d49e16f6 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
@@ -427,10 +427,14 @@ CPPUNIT_TEST_FIXTURE(Test, testDateContentControlExport)
     xContentControlProps->setPropertyValue(u"Alias"_ustr, 
uno::Any(u"myalias"_ustr));
     xContentControlProps->setPropertyValue(u"Tag"_ustr, 
uno::Any(u"mytag"_ustr));
     xContentControlProps->setPropertyValue(u"Id"_ustr, 
uno::Any(static_cast<sal_Int32>(123)));
+    xContentControlProps->setPropertyValue(u"TabIndex"_ustr, 
uno::Any(sal_uInt32(4294967295))); // -1
     xContentControlProps->setPropertyValue(u"Lock"_ustr, 
uno::Any(u"sdtLocked"_ustr));
 
     xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true);
 
+    // FIXME: validation error in OOXML export: Errors: 2
+    skipValidation();
+
     // When exporting to DOCX:
     save(TestFilter::DOCX);
 
@@ -453,6 +457,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDateContentControlExport)
     assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:alias", "val", u"myalias");
     assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:tag", "val", u"mytag");
     assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:id", "val", u"123");
+    assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:tabIndex", "val", u"-1");
     assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:lock", "val", u"sdtLocked");
 }
 
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index b8497eb475d9..c9a136b3402c 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2722,9 +2722,8 @@ void DocxAttributeOutput::WriteContentControlStart()
     {
         // 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());
-        if (nTabIndex != -1)
-            m_pSerializer->singleElementNS(XML_w, XML_tabIndex, FSNS(XML_w, 
XML_val),
-                                           OString::number(nTabIndex));
+        m_pSerializer->singleElementNS(XML_w, XML_tabIndex, FSNS(XML_w, 
XML_val),
+                                       OString::number(nTabIndex));
     }
 
     if (m_pContentControl->GetPicture())

Reply via email to