[Libreoffice-commits] core.git: sw/qa sw/source

Louis Meyrat (via logerrit) logerrit at kemper.freedesktop.org
Sun Jan 19 22:30:38 UTC 2020


 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 8be3ae254f5b2ff76d9861ad4b9b5b5de5d14bb4
Author:     Louis Meyrat <louis.meyrat at gmail.com>
AuthorDate: Sun Jan 12 17:26:09 2020 +0100
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Sun Jan 19 23:30:00 2020 +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 <mike.kaganski at collabora.com>

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 1835b92bec49..922cb9183adc 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -307,6 +307,13 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf77796, "tdf77796.docx")
     assertXPath(pXml, "/w:document/w:body/w:tbl/w:tblPr/w:tblCellMar/w:end", "w", "108");
 }
 
+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_OOXMLIMPORT_TEST(testContSectBreakHeaderFooter, "cont-sect-break-header-footer.docx")
 {
     // Load a document with a continuous section break on page 2.
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 25b22b8df5ed..172205b11b50 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3771,6 +3771,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();


More information about the Libreoffice-commits mailing list