From e11c51eefe8c3210cef2b5850f401ba67a401d01 Mon Sep 17 00:00:00 2001 From: László Németh Date: Fri, 26 Mar 2021 16:28:03 +0100 Subject: tdf#95806 tdf#125877 tdf#141172 DOCX: fix tables in footnotes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and endnotes by converting them to floating tables during the import, and removing floating at the DOCX export. Writer core doesn't support non-floating tables in footnotes and endnotes officially, (flowfrm:cxx: "Tables in footnotes are not truly supported"), so their DOCX import resulted serious problems: – missing table paint (tdf#95806); – table loss during saving to ODT (tdf#125877); – table loss during copying them or their footnotes and endnotes in the document (this resulted the regression of the optimized footnote and endnote import: tdf#141172); – table loss during changing the order of the chapters in the Navigator. Change-Id: Ife8af41936ae3ab003a3a9ad33b98c1d813e9c82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113162 Tested-by: László Németh Reviewed-by: László Németh --- sw/source/filter/ww8/docxattributeoutput.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sw/source/filter') diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 4b9c72829c3b..f4688e5f6a01 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -3982,7 +3982,10 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t m_pSerializer->singleElementNS(XML_w, XML_tblLook, pAttributeList); } - else if (rGrabBagElement.first == "TablePosition" ) + else if (rGrabBagElement.first == "TablePosition" && + // skip empty table position (tables in footnotes converted to + // floating tables temporarily, don't export this) + rGrabBagElement.second != uno::Any() ) { rtl::Reference attrListTablePos = FastSerializerHelper::createAttrList( ); const uno::Sequence aTablePosition = rGrabBagElement.second.get >(); -- cgit v1.2.3