summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2024-01-30 08:51:20 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2024-02-01 10:12:41 +0100
commitd19f051dd4244bdfb58458d4287305b59c2915c6 (patch)
tree8433c5e4184916630a2b72edb06781506fa5b359 /writerfilter/source/dmapper
parent2920c56159320965e81de99b11fb1ca5dd42c8d5 (diff)
tdf#159107 sw floattable: prefer inline table in footnote with change tracking
Writer doesn't really support tables in footnotes, see the warning at the top of SwFlowFrame::MoveFwd(). Still, there is some initial support for them, since commit 11c51eefe8c3210cef2b5850f401ba67a401d01 (tdf#95806 tdf#125877 tdf#141172 DOCX: fix tables in footnotes, 2021-03-28). Similarly, redlines really just track insertion and deletion, but some initial support for table operations were added in commit eebe4747d2d13545004937bb0267ccfc8ab9d63f (tdf#144270 sw: manage tracked table (row) deletion/insertion, 2022-01-12). The combination of these is a bit fragile, but the bugdoc happened to be imported as an inline table (in a footnote, with recording changes) before commit d477fa8ac1b0d3ee81427217bbb5950278ab16db (sw floattable: unconditionally map <w:tblpPr> to SwFormatFlySplit, 2023-03-17). Fix the problem by explicitly importing floating tables as inline in the footnote + redline case to restore the working use-case. DOCX import of this combination can be enabled again once Writer layout works for the produced model. Change-Id: I9cd0a1fabb9807f5117cb5a36ec8597d6646eece Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162733 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins (cherry picked from commit af15f8b7f346898677f1eee6521a6be1ff63eb56) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162716 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'writerfilter/source/dmapper')
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableHandler.cxx7
-rw-r--r--writerfilter/source/dmapper/SettingsTable.cxx2
-rw-r--r--writerfilter/source/dmapper/SettingsTable.hxx2
3 files changed, 10 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 2092ba4096ae..e63d1cf9615f 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -1599,7 +1599,12 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel)
// m_xText points to the body text, get the current xText from m_rDMapper_Impl, in case e.g. we would be in a header.
uno::Reference<text::XTextAppendAndConvert> xTextAppendAndConvert(m_rDMapper_Impl.GetTopTextAppend(), uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> xFrameAnchor;
- if (xTextAppendAndConvert.is())
+
+ // Writer layout has problems with redlines on floating table rows in footnotes, avoid
+ // them.
+ bool bInFootnote = m_rDMapper_Impl.IsInFootOrEndnote();
+ bool bRecordChanges = m_rDMapper_Impl.GetSettingsTable()->GetRecordChanges();
+ if (xTextAppendAndConvert.is() && !(bInFootnote && bRecordChanges))
{
std::deque<css::uno::Any> aFramedRedlines = m_rDMapper_Impl.m_aStoredRedlines[StoredRedlines::FRAME];
std::vector<sal_Int32> redPos, redLen;
diff --git a/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilter/source/dmapper/SettingsTable.cxx
index 43ef02f68134..b16846420682 100644
--- a/writerfilter/source/dmapper/SettingsTable.cxx
+++ b/writerfilter/source/dmapper/SettingsTable.cxx
@@ -778,6 +778,8 @@ bool SettingsTable::GetNoLeading() const
bool SettingsTable::GetGutterAtTop() const { return m_pImpl->m_bGutterAtTop; }
+bool SettingsTable::GetRecordChanges() const { return m_pImpl->m_bRecordChanges; }
+
}//namespace dmapper
} //namespace writerfilter
diff --git a/writerfilter/source/dmapper/SettingsTable.hxx b/writerfilter/source/dmapper/SettingsTable.hxx
index a0af31bed6bb..471d15b7a999 100644
--- a/writerfilter/source/dmapper/SettingsTable.hxx
+++ b/writerfilter/source/dmapper/SettingsTable.hxx
@@ -97,6 +97,8 @@ public:
const OUString& GetCurrentDatabaseDataSource() const;
bool GetGutterAtTop() const;
+ bool GetRecordChanges() const;
+
private:
// Properties
virtual void lcl_attribute(Id Name, Value& val) override;