sw/source/core/inc/layact.hxx                   |    2 +-
 sw/source/core/layout/layact.cxx                |   14 +++++++++-----
 sw/source/core/layout/objectformattertxtfrm.cxx |    2 +-
 sw/source/core/layout/pagechg.cxx               |    2 +-
 4 files changed, 12 insertions(+), 8 deletions(-)

New commits:
commit a485769c98a92dfa1da1be60d2f85a2343b1ca42
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Jul 15 14:13:35 2021 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Tue Nov 16 10:44:31 2021 +0100

    Only change SwLayAction::m_bAgain via SetAgain
    
    no logic change intended
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118983
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    (cherry picked from commit 3a5383892e1f0e22558cd56cb77d56a09c515b7a)
    
    Change-Id: Ib0174f8040faa3efde7b9c5ba9b062bac5a35da3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125240
    Tested-by: Michael Stahl <michael.st...@allotropia.de>
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx
index c212b40f1516..37fc4a9aae9e 100644
--- a/sw/source/core/inc/layact.hxx
+++ b/sw/source/core/inc/layact.hxx
@@ -148,7 +148,7 @@ public:
     void SetReschedule  ( bool bNew )   { m_bReschedule = bNew; }
     void SetWaitAllowed ( bool bNew )   { m_bWaitAllowed = bNew; }
 
-    void SetAgain()         { m_bAgain = true; }
+    void SetAgain(bool bAgain) { m_bAgain = bAgain; }
     void SetUpdateExpFields() {m_bUpdateExpFields = true; }
 
     inline void SetCheckPageNum( sal_uInt16 nNew );
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index e5267fff5fb7..d677bccbdb22 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -284,11 +284,12 @@ bool SwLayAction::IsInterrupt()
 
 void SwLayAction::Reset()
 {
+    SetAgain(false);
     m_pOptTab = nullptr;
     m_nStartTicks = std::clock();
     m_nEndPage = m_nPreInvaPage = m_nCheckPageNum = USHRT_MAX;
     m_bPaint = m_bComplete = m_bWaitAllowed = m_bCheckPages = true;
-    m_bInterrupt = m_bAgain = m_bNextCycle = m_bCalcLayout = m_bReschedule =
+    m_bInterrupt = m_bNextCycle = m_bCalcLayout = m_bReschedule =
     m_bUpdateExpFields = m_bBrowseActionStop = false;
     m_pCurPage = nullptr;
 }
@@ -346,12 +347,15 @@ void SwLayAction::Action(OutputDevice* pRenderContext)
         SetCheckPages( false );
 
     InternalAction(pRenderContext);
-    m_bAgain |= RemoveEmptyBrowserPages();
+    if (RemoveEmptyBrowserPages())
+        SetAgain(true);
     while ( IsAgain() )
     {
-        m_bAgain = m_bNextCycle = false;
+        SetAgain(false);
+        m_bNextCycle = false;
         InternalAction(pRenderContext);
-        m_bAgain |= RemoveEmptyBrowserPages();
+        if (RemoveEmptyBrowserPages())
+            SetAgain(true);
     }
     m_pRoot->DeleteEmptySct();
 
@@ -643,7 +647,7 @@ void SwLayAction::InternalAction(OutputDevice* 
pRenderContext)
             {
                 bool bOld = IsAgain();
                 m_pRoot->RemoveSuperfluous();
-                m_bAgain = bOld;
+                SetAgain(bOld);
             }
             if ( IsAgain() )
             {
diff --git a/sw/source/core/layout/objectformattertxtfrm.cxx 
b/sw/source/core/layout/objectformattertxtfrm.cxx
index 2a072d5f97a5..45608c13c651 100644
--- a/sw/source/core/layout/objectformattertxtfrm.cxx
+++ b/sw/source/core/layout/objectformattertxtfrm.cxx
@@ -307,7 +307,7 @@ bool SwObjectFormatterTextFrame::DoFormatObjs()
         {
             // notify layout action, thus is can restart the layout process on
             // a previous page.
-            GetLayAction()->SetAgain();
+            GetLayAction()->SetAgain(true);
         }
         else
         {
diff --git a/sw/source/core/layout/pagechg.cxx 
b/sw/source/core/layout/pagechg.cxx
index 02d8ec499e3f..75eacea7c95a 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -284,7 +284,7 @@ void SwPageFrame::DestroyImpl()
             SwViewShellImp *pImp = pSh->Imp();
             pImp->SetFirstVisPageInvalid();
             if ( pImp->IsAction() )
-                pImp->GetLayAction().SetAgain();
+                pImp->GetLayAction().SetAgain(true);
             // #i9719# - retouche area of page
             // including border and shadow area.
             const bool bRightSidebar = (SidebarPosition() == 
sw::sidebarwindows::SidebarPosition::RIGHT);

Reply via email to