summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-12-07 20:00:32 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-12-08 00:28:09 +0100
commit95cbc7e6afe36f01cc4d2a8d7ab54d8facb39208 (patch)
tree99fefc2b758e85ab035615cdee8362088aaad813
parentfa5ccf18cd9f48fc6df3f827dfdd908ee253300a (diff)
sw: layout: SwFlyNotify should invalidate a content or tab frame
The problem happens during layout for a temporary mail merge document, but that is probably incidental. (The SwRootFrame is the 2nd one out of 3 being createed, the one for the target document.) The problem is that a text frame with a fly moves backward, and ~SwFlyNotify() invalidates the position of the next frame, but the next frame is a section frame, and this does not encourage the text frame inside the section frame to move backward at a later time, which leads to general user unhappiness. So invalidate the lower of the section frame too. Change-Id: I14fa20a279979c029c468f5c6f2e5ecad4ccd240 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107360 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit c797fc768152a57f6cc7fb9dd447138e4b0629ee) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107312 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--sw/source/core/layout/frmtool.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index ab7799a350a7..7ec3e914ca85 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -671,9 +671,16 @@ SwFlyNotify::~SwFlyNotify()
if ( pFly->IsFlyAtContentFrame() )
{
SwFrame *pNxt = pFly->AnchorFrame()->FindNext();
- if ( pNxt )
+ while (pNxt)
{
pNxt->InvalidatePos();
+ if (!pNxt->IsSctFrame())
+ {
+ break;
+ }
+ // invalidating pos of a section frame doesn't have much
+ // effect, so try again with its lower
+ pNxt = static_cast<SwSectionFrame*>(pNxt)->Lower();
}
}