diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2023-01-26 11:10:25 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-02-24 11:05:48 +0100 |
commit | fe5bdabefca7aafa31374c27e2eb667f970e87c9 (patch) | |
tree | c79c078911ca918a876822c2dcd56e3c7a12c0de | |
parent | 5deee74dfba49ef904da995f164f38b6ce06319b (diff) |
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.
(cherry picked from commit bef6c5ca4edf55e64284d9dd264ba9a76476adab)
Change-Id: I8ea930bed4bbddb96b181796ab893e810ba9dcd4
-rw-r--r-- | sw/source/core/inc/flyfrms.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/layout/flycnt.cxx | 8 |
2 files changed, 10 insertions, 2 deletions
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: */ |