diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2022-12-20 21:04:05 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-02-02 09:49:28 +0000 |
commit | 88a5c26334f392fcddfc5a1e62c3a482fbf72fe6 (patch) | |
tree | 4e9c7758270b7b761d5fd3b561fe07305f223e13 | |
parent | 49701230a9a5e87475237a0392155c4c679a1cb0 (diff) |
tdf#146875 sw: move also at-frame flys off SwPageFrame
The bugdoc contains an at-frame anchored fly on page 77, which is
anchored to an at-page anchored fly.
While layouting page 74, the fly is moved to page 77, and the content on
page 74 invalidated.
Unexpectedly, calling RegisterAtPage on a SwFlyLayFrame does absolutely
nothing, as it calls the base class SwFlyFrame, so the fly stays on page
74.
Thus, page 74 never actually becomes valid, and later pages are never
layouted.
(regression from commit eb85de8e6b61fb3fcb6c03ae0145f7fe5478bccf)
Change-Id: I4fcbed4daf83f9e554de5a877a40b2c2419c0f2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144631
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit abef9ea8aa99561e6f84451acf387abde4ec14ab)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144658
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/core/inc/flyfrms.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/flylay.cxx | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/sw/source/core/inc/flyfrms.hxx b/sw/source/core/inc/flyfrms.hxx index 1f346a9d90e4..cf79bf2fe92b 100644 --- a/sw/source/core/inc/flyfrms.hxx +++ b/sw/source/core/inc/flyfrms.hxx @@ -150,6 +150,8 @@ public: // #i28701# SwFlyLayFrame( SwFlyFrameFormat*, SwFrame*, SwFrame *pAnchor ); + + virtual void RegisterAtPage(SwPageFrame &) override; virtual void SwClientNotify(const SwModify&, const SfxHint&) override; }; diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx index 48b95e15060e..209ca1fcfbf0 100644 --- a/sw/source/core/layout/flylay.cxx +++ b/sw/source/core/layout/flylay.cxx @@ -720,6 +720,19 @@ SwFlyLayFrame::SwFlyLayFrame( SwFlyFrameFormat *pFormat, SwFrame* pSib, SwFrame m_bLayout = true; } +void SwFlyLayFrame::RegisterAtPage(SwPageFrame & rPageFrame) +{ + assert(GetPageFrame() != &rPageFrame); + if (GetPageFrame()) + { + GetPageFrame()->MoveFly( this, &rPageFrame ); + } + else + { + rPageFrame.AppendFlyToPage( this ); + } +} + // #i28701# void SwFlyLayFrame::SwClientNotify(const SwModify& rMod, const SfxHint& rHint) |