sw/source/core/layout/calcmove.cxx |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit dc608751f4bf4c7244d8973bf900bf7b3bd05d91
Author: Vasily Melenchuk <vasily.melenc...@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.
    
    Change-Id: I64fe8aecd5d972eecc9fde3a96d8729960a1998e
    Reviewed-on: https://gerrit.libreoffice.org/51996
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>

diff --git a/sw/source/core/layout/calcmove.cxx 
b/sw/source/core/layout/calcmove.cxx
index af4ab0515fab..87142b7f0e6f 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -1310,11 +1310,17 @@ void SwContentFrame::MakeAll(vcl::RenderContext* 
/*pRenderContext*/)
     SwFrame const* pMoveBwdPre(nullptr);
     bool isMoveBwdPreValid(false);
 
+    SwRect aOldFrame_StopFormat, aOldFrame_StopFormat2;
+    SwRect aOldPrt_StopFormat, aOldPrt_StopFormat2;
+
     while ( !isFrameAreaPositionValid() || !isFrameAreaSizeValid() || 
!isFramePrintAreaValid() )
     {
         // - loop prevention
-        SwRect aOldFrame_StopFormat( getFrameArea() );
-        SwRect aOldPrt_StopFormat( getFramePrintArea() );
+        aOldFrame_StopFormat2 = aOldFrame_StopFormat;
+        aOldPrt_StopFormat2 = aOldPrt_StopFormat;
+        aOldFrame_StopFormat = getFrameArea();
+        aOldPrt_StopFormat = getFramePrintArea();
+
         bool bMoveable = IsMoveable();
         if (bMoveable)
         {
@@ -1581,8 +1587,8 @@ void SwContentFrame::MakeAll(vcl::RenderContext* 
/*pRenderContext*/)
 
         // - loop prevention
         {
-            if ( aOldFrame_StopFormat == getFrameArea() &&
-                 aOldPrt_StopFormat == getFramePrintArea() )
+            if ( (aOldFrame_StopFormat == getFrameArea() || 
aOldFrame_StopFormat2 == getFrameArea() ) &&
+                 (aOldPrt_StopFormat == getFramePrintArea() || 
aOldPrt_StopFormat2 == getFramePrintArea()))
             {
                 ++nConsecutiveFormatsWithoutChange;
             }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to