diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2023-03-22 08:28:34 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-03-24 07:04:47 +0000 |
commit | 38d07cfa9ef66c15ca1919b356614e628203de77 (patch) | |
tree | 04a7cc7681eae9fd30377b63908098d0a8fd982c /writerfilter | |
parent | 13957c49b939d29c0005c578e6c5e8dd76bd5722 (diff) |
sw floattable: fix inner floating table inside normal outer table from DOCX
The problem was that CppunitTest_sw_ooxmlexport9's testTdf79329 has a
normal outer table and a floating inner table; the inner table was
already not floating (so that's not a new problem), but
SW_FORCE_FLY_SPLIT=1 even failed the text-to-table conversion for the
outer table, so we just had 1 table, not 2 tables.
The problem seems to be that the start/end positions for the outer table
cell get invalidated by the inner table-to-frame conversion, so the
outer table conversion will fail as well.
Fix the problem by limiting the table-to-frame conversion for toplevel
tables: this avoids the failing text-to-table conversion in the
SW_FORCE_FLY_SPLIT=1 case.
At some stage I should revisit this, since the DOC import has working
floating tables for the inner case, for now just make sure that the DOCX
import result has two tables, as before.
(cherry picked from commit a1b935ca1bb6d48241e73e7206a367fe2b51f948)
Change-Id: I39aa00e46c12a32117c334cb97e1cc0270b77651
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149374
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 1c1682608962..d19f1750c4df 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -1619,9 +1619,10 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel, bool bTab // Only execute the conversion if the table is not anchored at // the start of an outer table cell, that's not yet // implemented. - // Tables starting at cell start are not a problem if we don't delay via - // m_aPendingFloatingTables. - if (xTextAppendAndConvert.is() && (!bTableStartsAtCellStart || IsFlySplitAllowed())) + // Multi-page floating tables works if an outer/toplevel table is floating, but not + // when an inner table would float. + bool bToplevelSplitFly = IsFlySplitAllowed() && nestedTableLevel <= 1; + if (xTextAppendAndConvert.is() && (!bTableStartsAtCellStart || bToplevelSplitFly)) { std::deque<css::uno::Any> aFramedRedlines = m_rDMapper_Impl.m_aStoredRedlines[StoredRedlines::FRAME]; std::vector<sal_Int32> redPos, redLen; |