sw/source/core/layout/fly.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 6f14c818ad25e7fb1feb65ab8072e2a9918398d6
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Thu Feb 1 15:11:03 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Tue Feb 6 20:35:19 2024 +0100

    tdf#159015 sw: layout: fix infinite loop in ::CalcContent()
    
    SwObjectFormatter::FormatObj() will just return if IsAgain() is set, so
    the while loop here won't make any progress.
    
    (regression from commit 191babee4f0ec643b80e96b0cd98c2d04ff96e4e)
    
    Change-Id: I1c194b148760ae05cf4dee1d5729be28e87d6ba0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162880
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 13865c4da30a3a2a5ab8efbd568c47952d3ffcee)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162894
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index ba57cd6b4cdf..db50a42de053 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -43,6 +43,7 @@
 #include <svx/svdoashp.hxx>
 #include <svx/svdpage.hxx>
 #include <layouter.hxx>
+#include <layact.hxx>
 #include <pagefrm.hxx>
 #include <rootfrm.hxx>
 #include <viewimp.hxx>
@@ -1741,6 +1742,10 @@ void CalcContent( SwLayoutFrame *pLay, bool bNoColl )
                         if (!SwObjectFormatter::FormatObj(*pAnchoredObj, 
pAnchorFrame, pAnchorPageFrame,
                                 rShell.Imp()->IsAction() ? 
&rShell.Imp()->GetLayAction() : nullptr))
                         {
+                            if (rShell.Imp()->IsAction() && 
rShell.Imp()->GetLayAction().IsAgain())
+                            {   // tdf#159015 will always fail, don't loop
+                                return;
+                            }
                             bRestartLayoutProcess = true;
                             break;
                         }

Reply via email to