sw/qa/extras/ooxmlexport/data/tdf128290.odt |binary sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 7 +++++++ sw/source/filter/ww8/docxattributeoutput.cxx | 4 ++++ 3 files changed, 11 insertions(+)
New commits: commit 005952a5ec6737c8cb34a29d373e252a00c84916 Author: Louis Meyrat <[email protected]> AuthorDate: Sun Jan 12 17:26:09 2020 +0100 Commit: Michael Stahl <[email protected]> CommitDate: Tue Nov 9 15:34:42 2021 +0100 tdf#128290 add tblLayout element to docx export This will disable the automatic table width feature of MS Word, which does not exist in LO. Now, tables in LO-generated docx have the same column width in MS Word Change-Id: I955c8e5667376475e7c41e3b74d88e3513fec561 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86671 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> (cherry picked from commit 8be3ae254f5b2ff76d9861ad4b9b5b5de5d14bb4) diff --git a/sw/qa/extras/ooxmlexport/data/tdf128290.odt b/sw/qa/extras/ooxmlexport/data/tdf128290.odt new file mode 100644 index 000000000000..81ea0c6773aa Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf128290.odt differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index 18a22bbdd30c..4531e95f2e06 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -446,6 +446,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf120394, "tdf120394.docx") } } +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128290, "tdf128290.odt") +{ + xmlDocPtr pXml = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pXml); + assertXPath(pXml, "/w:document/w:body/w:tbl/w:tblPr/w:tblLayout", "type", "fixed"); +} + DECLARE_OOXMLEXPORT_TEST(testHyphenationAuto, "hyphenation.odt") { // Explicitly set hyphenation=auto on document level diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 0eb2a733ac33..d76fff47197f 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -3821,6 +3821,10 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t FSNS( XML_w, XML_w ), OString::number(nPageSize), FSNS( XML_w, XML_type ), widthType ); + // Disable layout autofit, as it does not exist in LibreOffice yet + m_pSerializer->singleElementNS( XML_w, XML_tblLayout, + FSNS( XML_w, XML_type ), "fixed" ); + // Look for the table style property in the table grab bag std::map<OUString, css::uno::Any> aGrabBag = pTableFormat->GetAttrSet().GetItem<SfxGrabBagItem>(RES_FRMATR_GRABBAG)->GetGrabBag();
