[Libreoffice-commits] core.git: Branch 'private/swe/libreoffice-5-2+backports' - sw/source

Vasily Melenchuk Vasily.Melenchuk at cib.de
Tue Apr 3 16:24:15 UTC 2018


Rebased ref, commits from common ancestor:
commit 170c8dbf14dc44026ffe85378f0aba890b06e60e
Author: Vasily Melenchuk <Vasily.Melenchuk at cib.de>
Date:   Wed Mar 28 13:30:10 2018 +0300

    Update loop prevention in SwContentFrame::MakeAll
    
    In some cases there is an endless loop with just two states
    switchin one into another. To avoid such freeze now 2 last
    states are kept in loop prevention code.
    
    Reviewed-on: https://gerrit.libreoffice.org/51996
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    
     Conflicts:
            sw/source/core/layout/calcmove.cxx
    
    Change-Id: I64fe8aecd5d972eecc9fde3a96d8729960a1998e

diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index 801a7d582d75..3feed0d31eef 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -1242,11 +1242,17 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
 
     bool bMoveable;
 
+    SwRect aOldFrame_StopFormat, aOldFrame_StopFormat2;
+    SwRect aOldPrt_StopFormat, aOldPrt_StopFormat2;
+
     while ( !mbValidPos || !mbValidSize || !mbValidPrtArea )
     {
         // - loop prevention
-        SwRect aOldFrame_StopFormat( Frame() );
-        SwRect aOldPrt_StopFormat( Prt() );
+        aOldFrame_StopFormat2 = aOldFrame_StopFormat;
+        aOldPrt_StopFormat2 = aOldPrt_StopFormat;
+        aOldFrame_StopFormat = Frame();
+        aOldPrt_StopFormat = Prt();
+
         if ( (bMoveable = IsMoveable()) )
         {
             SwFrame *pPre = GetIndPrev();
@@ -1492,8 +1498,8 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
 
         // - loop prevention
         {
-            if ( aOldFrame_StopFormat == Frame() &&
-                 aOldPrt_StopFormat == Prt() )
+            if ( (aOldFrame_StopFormat == Frame() || aOldFrame_StopFormat2 == Frame() ) &&
+                 (aOldPrt_StopFormat == Prt() || aOldPrt_StopFormat2 == Prt()))
             {
                 ++nConsecutiveFormatsWithoutChange;
             }


More information about the Libreoffice-commits mailing list