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

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 22 07:35:14 UTC 2021


 sw/source/core/inc/layact.hxx    |    5 -----
 sw/source/core/inc/tabfrm.hxx    |   10 ----------
 sw/source/core/layout/layact.cxx |   20 +-------------------
 sw/source/core/layout/tabfrm.cxx |    6 ++----
 4 files changed, 3 insertions(+), 38 deletions(-)

New commits:
commit 0f026c6e7186ef57e5806348a320f8383dfb7dc7
Author:     Michael Stahl <michael.stahl at allotropia.de>
AuthorDate: Wed Jun 16 15:34:40 2021 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Tue Jun 22 09:34:39 2021 +0200

    Revert "tdf#116501 fix freezing at embedded text tables"
    
    This reverts commit 91b2239783dc716bd71ce7962bfd7e341dfe4175.
    
    This breaks documents that have many nested tables.
    
    For example Eclipse BIRT generates reports with tables nested 8 levels
    deep, they run into the counter in no time and, ironically, one goes
    into a layout loop because of this counter.
    
    Change-Id: I7451d01787903bbc60b305da3dc72f8259175e97
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117472
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
    (cherry picked from commit ee042a371e98cdcc59848f0b953f1ce545e18e31)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117601
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx
index 71484e00da5f..6680949b3eff 100644
--- a/sw/source/core/inc/layact.hxx
+++ b/sw/source/core/inc/layact.hxx
@@ -97,11 +97,6 @@ class SwLayAction
     // OD 14.04.2003 #106346# - new flag for content formatting on interrupt.
     bool    mbFormatContentOnInterrupt;
 
-    // for loop control by disabling in-row splitting within embedded tables
-    const SwPageFrame  *m_pCurPage;
-    sal_uInt16 m_nTabLevel;  // embedding level
-    sal_uInt32 m_nCallCount; // calling FormatLayoutTab on the same page
-
     void PaintContent( const SwContentFrame *, const SwPageFrame *,
                      const SwRect &rOldRect, tools::Long nOldBottom );
     bool PaintWithoutFlys( const SwRect &, const SwContentFrame *,
diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx
index d0eb807297a1..7e302473a421 100644
--- a/sw/source/core/inc/tabfrm.hxx
+++ b/sw/source/core/inc/tabfrm.hxx
@@ -84,8 +84,6 @@ class SwTabFrame: public SwLayoutFrame, public SwFlowFrame
 
     bool m_bInRecalcLowerRow : 1;
 
-    bool m_bSplitRowDisabled : 1;          // loop control
-
     /**
      * Split() splits the Frame at the specified position: a Follow is
      * created and constructed and inserted directly after this.
@@ -177,14 +175,6 @@ public:
     {
         m_bInRecalcLowerRow = bNew;
     }
-    bool IsSplitRowDisabled() const
-    {
-        return m_bSplitRowDisabled;
-    }
-    void SetSplitRowDisabled()
-    {
-        m_bSplitRowDisabled = true;
-    }
 
     // #i26945#
     bool IsConsiderObjsForMinCellHeight() const
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index c613507a5142..87b76cc6b4ca 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -262,10 +262,7 @@ SwLayAction::SwLayAction( SwRootFrame *pRt, SwViewShellImp *pI ) :
     m_nStartTicks( std::clock() ),
     m_nInputType( VclInputFlags::NONE ),
     m_nEndPage( USHRT_MAX ),
-    m_nCheckPageNum( USHRT_MAX ),
-    m_pCurPage( nullptr ),
-    m_nTabLevel( 0 ),
-    m_nCallCount( 0 )
+    m_nCheckPageNum( USHRT_MAX )
 {
     m_bPaintExtraData = ::IsExtraData( m_pImp->GetShell()->GetDoc() );
     m_bPaint = m_bComplete = m_bWaitAllowed = m_bCheckPages = true;
@@ -293,7 +290,6 @@ void SwLayAction::Reset()
     m_bPaint = m_bComplete = m_bWaitAllowed = m_bCheckPages = true;
     m_bInput = m_bAgain = m_bNextCycle = m_bCalcLayout = m_bIdle = m_bReschedule =
     m_bUpdateExpFields = m_bBrowseActionStop = false;
-    m_pCurPage = nullptr;
 }
 
 bool SwLayAction::RemoveEmptyBrowserPages()
@@ -1184,12 +1180,6 @@ bool SwLayAction::IsShortCut( SwPageFrame *&prPage )
 // introduce support for vertical layout
 bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrame *pLay, bool bAddRect )
 {
-    // save page for loop control
-    if( pLay->IsPageFrame() && static_cast<SwPageFrame*>(pLay) != m_pCurPage )
-    {
-        m_nCallCount = 0;
-        m_pCurPage = static_cast<SwPageFrame*>(pLay);
-    }
     OSL_ENSURE( !IsAgain(), "Attention to the invalid page." );
     if ( IsAgain() )
         return false;
@@ -1371,13 +1361,6 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrame *pLa
         {
             if ( pLow->IsTabFrame() )
             {
-                // loop control for embedded tables
-                if ( m_nTabLevel > 0 && ++m_nCallCount > 50 ) {
-                    static_cast<SwTabFrame*>(pLow)->SetSplitRowDisabled();
-                }
-
-                ++m_nTabLevel;
-
                 // Remember what was the next of the lower. Formatting may move it to the previous
                 // page, in which case it looses its next.
                 pNext = pLow->GetNext();
@@ -1394,7 +1377,6 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrame *pLa
                 }
 
                 bTabChanged |= FormatLayoutTab( static_cast<SwTabFrame*>(pLow), bAddRect );
-                --m_nTabLevel;
             }
             // Skip the ones already registered for deletion
             else if( !pLow->IsSctFrame() || static_cast<SwSectionFrame*>(pLow)->GetSection() )
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 13ba152f12fe..05069534af8d 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -84,7 +84,6 @@ SwTabFrame::SwTabFrame( SwTable &rTab, SwFrame* pSib )
     , m_bConsiderObjsForMinCellHeight(true)
     , m_bObjsDoesFit(true)
     , m_bInRecalcLowerRow(false)
-    , m_bSplitRowDisabled(false)
 {
     mbFixSize = false;     //Don't fall for import filter again.
     mnFrameType = SwFrameType::Tab;
@@ -123,7 +122,6 @@ SwTabFrame::SwTabFrame( SwTabFrame &rTab )
     , m_bConsiderObjsForMinCellHeight(true)
     , m_bObjsDoesFit(true)
     , m_bInRecalcLowerRow(false)
-    , m_bSplitRowDisabled(false)
 {
     mbFixSize = false;     //Don't fall for import filter again.
     mnFrameType = SwFrameType::Tab;
@@ -1056,8 +1054,8 @@ bool SwTabFrame::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowK
     //                   table, or it will be set to false under certain
     //                   conditions that are not suitable for splitting
     //                   the row.
-    bool bSplitRowAllowed = !IsSplitRowDisabled();
-    if ( bSplitRowAllowed && !pRow->IsRowSplitAllowed() )
+    bool bSplitRowAllowed = true;
+    if (!pRow->IsRowSplitAllowed())
     {
         // A row larger than the entire page ought to be allowed to split regardless of setting,
         // otherwise it has hidden content and that makes no sense


More information about the Libreoffice-commits mailing list