sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 2 -- sw/source/filter/ww8/docxattributeoutput.cxx | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-)
New commits: commit c93b6a8583cc224d67b23cafe5bb9aa33b178693 Author: Noel Grandin <[email protected]> AuthorDate: Wed Jan 14 19:02:11 2026 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Fri Jan 16 17:05:53 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]> (cherry picked from commit 1bc98666e33c608d81c75fedcd51bba3745a32ed) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197422 Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 20d2f2f8f016..c437f6ab7e94 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -424,7 +424,6 @@ 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); @@ -451,7 +450,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 dc7c104e2c58..fc3ac7aae7b8 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2724,8 +2724,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())
