diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2023-08-23 08:34:01 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-08-23 09:38:27 +0200 |
commit | f8e1a62f944e5358fe498008b4ff8701f1e190a0 (patch) | |
tree | 2bcb3f2b8daead78ffbee8688fec4fc0e8f813f0 /sw/source | |
parent | eb217182a5c44de748218fea009a245254f30b95 (diff) |
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 <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/layout/ftnfrm.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
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 <osl/diagnose.h> #include <sal/log.hxx> #include <IDocumentSettingAccess.hxx> +#include <flyfrm.hxx> #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() ) |