diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2023-09-12 08:42:31 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-09-12 09:35:12 +0200 |
commit | 2887e6b8edbb4fdb093515a3a68269ed40e42116 (patch) | |
tree | da72089fffc9a7147162b41738642682541edbe8 /sw/source/filter/ww8/docxattributeoutput.cxx | |
parent | af11de36dc30df8f3f66cee7be836b6250bae4f5 (diff) |
sw floattable, nesting: fix DOCX export
There were two problems here:
1) DocxAttributeOutput::StartParagraph() didn't try to export an inner
floating table as a floating table, resulting in writing a shape that
can't span over multiple pages.
Dropping the !pTextNodeInfo check should be OK, we'll just now
clear the m_aFloatingTablesOfParagraph list at the end of the outer
table.
2) Once we tried to export the inner fly, the actual table/row/cell
start was missing, because m_tableReference.m_nTableDepth wasn't
reset, so DocxAttributeOutput::StartParagraph() didn't know it has to
emit a table definition before the first para of the table.
Fix this by stashing away the table state before the inner fly's
export and restoring it after the inner fly export, similar to how this
is done in e.g. DocxExport::WriteHeaderFooter().
This is related to tdf#55160.
Change-Id: Ib860283d32e392e2906aa12bc9eb61b5af5ca8de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156833
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/source/filter/ww8/docxattributeoutput.cxx')
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index c2a55ff8bfc7..4b51f52c6796 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -421,6 +421,9 @@ void DocxAttributeOutput::WriteFloatingTable(ww8::Frame const* pParentFrame) //Save data here and restore when out of scope ExportDataSaveRestore aDataGuard(GetExport(), nStt, nEnd, pParentFrame); + // Stash away info about the current table, so m_tableReference is clean. + DocxTableExportContext aTableExportContext(*this); + // set a floatingTableFrame AND unset parent frame, // otherwise exporter thinks we are still in a frame m_rExport.SetFloatingTableFrame(pParentFrame); @@ -502,7 +505,7 @@ sal_Int32 DocxAttributeOutput::StartParagraph(ww8::WW8TableNodeInfo::Pointer_t p // look ahead for floating tables that were put into a frame during import // floating tables in shapes are not supported: exclude this case - if (!pTextNodeInfo && !m_rExport.SdrExporter().IsDMLAndVMLDrawingOpen()) + if (!m_rExport.SdrExporter().IsDMLAndVMLDrawingOpen()) { checkAndWriteFloatingTables(*this); } |