sw/source/core/inc/flyfrms.hxx   |    4 +++-
 sw/source/core/layout/flycnt.cxx |    8 +++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit bef6c5ca4edf55e64284d9dd264ba9a76476adab
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Thu Jan 26 11:10:25 2023 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Thu Jan 26 11:39:58 2023 +0000

    sw: inherit SwFlyAtContentFrame from SwFlowFrame
    
    Checking how e.g. section frames are split in SwFrame::GetNextLeaf(), we
    call into SwFrame::GetNextSctLeaf() which then calls a dedicated
    SwSectionFrame ctor that connects the master with its follow.
    
    Add infrastructure to be able to do the same for fly at-content frames.
    (At-fly anchored and as-char anchored frames are not relevant for the
    broader multi-page floating table picture. Also, SwFrame::GetLeaf()
    wants to work with a non-abstract type, so allocating SwFlyFrame there
    would make no sense, so inherit SwFlyAtContentFrame and not SwFlyFrame
    from SwFlowFrame.)
    
    This is meant to be a minimal change, that can be unconditional, seeing
    that the only dynamic_cast to SwFlowFrame in RestoreContent() only does
    something if the frame has a follow, which is never the case at the
    moment.
    
    Towards an initial layout for multi-page fly frames.
    
    Change-Id: I8ea930bed4bbddb96b181796ab893e810ba9dcd4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146160
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    Tested-by: Jenkins

diff --git a/sw/source/core/inc/flyfrms.hxx b/sw/source/core/inc/flyfrms.hxx
index cf79bf2fe92b..063ce72610c7 100644
--- a/sw/source/core/inc/flyfrms.hxx
+++ b/sw/source/core/inc/flyfrms.hxx
@@ -22,6 +22,7 @@
 #include <sal/config.h>
 
 #include "flyfrm.hxx"
+#include "flowfrm.hxx"
 
 class SwNoTextFrame;
 
@@ -156,7 +157,7 @@ public:
 };
 
 // Flys that are bound to Content but not in Content
-class SwFlyAtContentFrame final: public SwFlyFreeFrame
+class SwFlyAtContentFrame final: public SwFlyFreeFrame, public SwFlowFrame
 {
     virtual void MakeAll(vcl::RenderContext* pRenderContext) override;
 
@@ -171,6 +172,7 @@ class SwFlyAtContentFrame final: public SwFlyFreeFrame
     virtual void RegisterAtCorrectPage() override;
     virtual void RegisterAtPage(SwPageFrame &) override;
     virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
+    bool ShouldBwdMoved(SwLayoutFrame* pNewUpper, bool& rReformat) override;
 
 public:
     // #i28701#
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 8ba6655cd7de..c24a3a1e908a 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -74,7 +74,8 @@ SwTwips lcl_GetTopForObjPos(const SwContentFrame* pCnt, const 
bool bVert, const
 }
 
 SwFlyAtContentFrame::SwFlyAtContentFrame( SwFlyFrameFormat *pFormat, SwFrame* 
pSib, SwFrame *pAnch ) :
-    SwFlyFreeFrame( pFormat, pSib, pAnch )
+    SwFlyFreeFrame( pFormat, pSib, pAnch ),
+    SwFlowFrame(static_cast<SwFrame&>(*this))
 {
     m_bAtCnt = true;
     m_bAutoPosition = (RndStdIds::FLY_AT_CHAR == 
pFormat->GetAnchor().GetAnchorId());
@@ -1518,4 +1519,9 @@ bool SwFlyAtContentFrame::InvalidationAllowed( const 
InvalidationType _nInvalid
     return bAllowed;
 }
 
+bool SwFlyAtContentFrame::ShouldBwdMoved(SwLayoutFrame* /*pNewUpper*/, bool& 
/*rReformat*/)
+{
+    return false;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to