sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 5 ----- sw/source/filter/ww8/docxattributeoutput.cxx | 5 +++-- 2 files changed, 3 insertions(+), 7 deletions(-)
New commits: commit 1bc98666e33c608d81c75fedcd51bba3745a32ed Author: Noel Grandin <[email protected]> AuthorDate: Wed Jan 14 19:02:11 2026 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Fri Jan 16 09:10:43 2026 +0100 officeotron: tabIndex=-1 is invalid since the value is constrained by the spec to be unsigned. Change-Id: I9b40b6fc9634cbe5c0e848ba15c9ce7918b2f067 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197291 Tested-by: Jenkins Reviewed-by: Michael Stahl <[email protected]> diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 9d11d309a074..3a42e7e3890d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -427,14 +427,10 @@ 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); @@ -457,7 +453,6 @@ 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 1125d04eb89d..067c0e8a8043 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2716,8 +2716,9 @@ 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()); - m_pSerializer->singleElementNS(XML_w, XML_tabIndex, FSNS(XML_w, XML_val), - OString::number(nTabIndex)); + if (nTabIndex != -1) + m_pSerializer->singleElementNS(XML_w, XML_tabIndex, FSNS(XML_w, XML_val), + OString::number(nTabIndex)); } if (m_pContentControl->GetPicture())
