sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 5 ----- sw/source/filter/ww8/docxattributeoutput.cxx | 5 +++-- 2 files changed, 3 insertions(+), 7 deletions(-)
New commits: commit 6fe1af9d2edd438a45bc54e13ba8a01f5dfcc648 Author: Noel Grandin <[email protected]> AuthorDate: Wed Jan 14 19:02:11 2026 +0200 Commit: Xisco Fauli <[email protected]> CommitDate: Mon Jan 19 10:08:11 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]> Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197431 diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 28ed1b321bad..bddf3715c7bd 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 8f8a3c40b52c..1ed6e6d062c7 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())
