[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Aug 7 13:36:10 UTC 2018


 sw/source/core/layout/frmtool.cxx |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 9959d003d3b266954815f10b9e14068ee170c2eb
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Mon Aug 6 19:03:22 2018 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Tue Aug 7 15:35:44 2018 +0200

    sw: fix ignored frames in AppendAllObjs()
    
    The problem is that AppendAllObjs() doesn't check if MakeFrames()
    actually created frames, it just assumes success.
    
    If there are frames anchored in frames, then it could go through
    the circular_buffer, find a dependent frame before its anchor frame,
    unsuccessfully call MakeFrames(), then call MakeFrames() on the anchor
    frame, and then the vector is empty.
    
    A surprising aspect is that push_back on a boost::circular_buffer will
    silently pop the first element if it's already "full".  Possibly this
    is what caused tdf#112447.
    
    1. insert section
    2. in paragraph in section, insert frame
    3. repeat 2
    4. drag anchor of frame 1 into body of frame 2
    5. edit section, click hide
    6. edit section, un-click hide
    7. only one frame is displayed
    
    (regression from 575e222a1742918be052f2b716ddf57ce0008404 and/or
     ce2fce9a41729774689080c8b5552b60c2e6ee2d)
    
    Change-Id: Ie782252ac388524dfb083f655320a50e95239b24
    Reviewed-on: https://gerrit.libreoffice.org/58676
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 31e66bd07c1082bb375be8aaf7835f019351d9bb)
    Reviewed-on: https://gerrit.libreoffice.org/58679
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 37fc4a808157..1fce3519f635 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1189,18 +1189,24 @@ void AppendAllObjs(const SwFrameFormats* pTable, const SwFrame* pSib)
         if(!isConnected)
         {
             pFormat->MakeFrames();
-            pFirstRequeued = nullptr;
+            pFormat->CallSwClientNotify(sw::GetObjectConnectedHint(isConnected, pRoot));
         }
-        else
+        // do this *before* push_back! the circular_buffer can be "full"!
+        vFormatsToConnect.pop_front();
+        if (!isConnected)
         {
             if(pFirstRequeued == pFormat)
                 // If nothing happens anymore we can stop.
                 break;
             if(!pFirstRequeued)
                 pFirstRequeued = pFormat;
+            assert(!vFormatsToConnect.full());
             vFormatsToConnect.push_back(pFormat);
         }
-        vFormatsToConnect.pop_front();
+        else
+        {
+            pFirstRequeued = nullptr;
+        }
     }
 }
 


More information about the Libreoffice-commits mailing list