From 9827413548210941eea1805a0ff653b07ccd164a Mon Sep 17 00:00:00 2001 From: Aron Budea Date: Mon, 23 Mar 2026 12:59:56 +1030 Subject: [PATCH] sw: don't export true value for cantSplit element to OOXML Not necessary, Word doesn't export it, and OOXML validator complains about the test doc if val attribute is present with true value: {"Description":"The attribute 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:val' has invalid value 'true'. The Enumeration constraint failed.", "Path":{"Namespaces":{},"XPath": "/w:document[1]/w:body[1]/w:tbl[2]/w:tr[1]/w:trPr[1]/w:cantSplit[1]", "PartUri":"/word/document.xml"}, "Id":"Sch_AttributeValueDataTypeDetailed","ErrorType":"Schema"} Change-Id: I964320ea2ef6b48795224ac14545a2eaf4a3b5bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202396 Tested-by: Jenkins Reviewed-by: Aron Budea --- sw/qa/extras/ooxmlexport/ooxmlexport3.cxx | 3 ++- sw/source/filter/ww8/docxtableexport.cxx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx index 0d4d3f0202e7..2427657744bb 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -953,7 +953,8 @@ CPPUNIT_TEST_FIXTURE(Test, testcantSplit) // writing during export was causing problem that all the cell data used to come on same page xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr/w:trPr/w:cantSplit",0); - assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[2]/w:tr/w:trPr/w:cantSplit","val",u"true"); + // this is how true is represented, otherwise OOXML validator complains: + assertXPathNoAttribute(pXmlDoc, "/w:document/w:body/w:tbl[2]/w:tr/w:trPr/w:cantSplit", "val"); } CPPUNIT_TEST_FIXTURE(Test, testDontSplitTable) diff --git a/sw/source/filter/ww8/docxtableexport.cxx b/sw/source/filter/ww8/docxtableexport.cxx index c9ce5f68a6b2..8e718b1c161f 100644 --- a/sw/source/filter/ww8/docxtableexport.cxx +++ b/sw/source/filter/ww8/docxtableexport.cxx @@ -806,7 +806,7 @@ void DocxAttributeOutput::TableCanSplit( // if rSplittable is true then no need to write // as default row prop is allow row to break across page. if (!rSplittable.GetValue()) - m_pSerializer->singleElementNS(XML_w, XML_cantSplit, FSNS(XML_w, XML_val), "true"); + m_pSerializer->singleElementNS(XML_w, XML_cantSplit); } void DocxAttributeOutput::TableBidi(