[Libreoffice-commits] core.git: sw/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Mon Dec 7 21:12:24 UTC 2020


 sw/source/core/layout/frmtool.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit c797fc768152a57f6cc7fb9dd447138e4b0629ee
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Mon Dec 7 20:00:32 2020 +0100
Commit:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Mon Dec 7 22:11:46 2020 +0100

    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 at cib.de>

diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index fc70c019dfa2..8590af6aa2a4 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -677,9 +677,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();
             }
         }
 


More information about the Libreoffice-commits mailing list