From f8e1a62f944e5358fe498008b4ff8701f1e190a0 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 23 Aug 2023 08:34:01 +0200 Subject: tdf#77760 sw floattable: add support for footnotes, layout Once the footnote was inserted to the document model, the layout was also missing (footnote portion, footnote frame). One problem is that the footnote portion was empty instead of the footnote counter, because SwTextFormatter::NewFootnotePortion() returned early in the fly case. The other problem was the missing footnote frame, but once the footnote portion was created correctly, the matching footnote frame was also created. File filters (ODT, DOCX) still needs more work. Change-Id: If71c44962f604f23fdcfccfe80b0d97787fd99d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155961 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- sw/source/core/layout/ftnfrm.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'sw/source') diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 00c5db65a27d..b2edab893023 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -41,6 +41,7 @@ #include #include #include +#include #define ENDNOTE 0x80000000 @@ -888,7 +889,15 @@ SwLayoutFrame *SwFrame::GetPrevFootnoteLeaf( MakePageType eMakeFootnote ) bool SwFrame::IsFootnoteAllowed() const { - if ( !IsInDocBody() ) + bool bSplitFly = false; + const SwFlyFrame* pFlyFrame = FindFlyFrame(); + if (pFlyFrame) + { + // This is a fly. Check if it's a split fly, which is OK to host a footnote. + bSplitFly = pFlyFrame->IsFlySplitAllowed(); + } + + if (!IsInDocBody() && !bSplitFly) return false; if ( IsInTab() ) -- cgit