sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 5 +++++ sw/source/filter/ww8/docxattributeoutput.cxx | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-)
New commits: commit a333ebe05eac88c4fcd758b4c2f83605ba7a3859 Author: Noel Grandin <[email protected]> AuthorDate: Thu Jan 22 10:04:24 2026 +0100 Commit: Noel Grandin <[email protected]> CommitDate: Thu Jan 22 18:48:18 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]> (cherry picked from commit 21bba2556bb5b0476546142109045ba11107d61b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197850 Reviewed-by: Michael Stahl <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index c437f6ab7e94..4a226019e384 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -424,10 +424,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(u"Office Open XML Text"_ustr); @@ -450,6 +454,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 e34bba03119e..5c8793911fbf 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2731,9 +2731,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())
