diff options
-rw-r--r-- | sw/qa/extras/layout/data/forcepoint75-1.rtf | bin | 0 -> 88740 bytes | |||
-rw-r--r-- | sw/qa/extras/layout/layout.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/inc/flowfrm.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/flowfrm.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/layout/sectfrm.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/layout/tabfrm.cxx | 17 | ||||
-rw-r--r-- | sw/source/core/layout/wsfrm.cxx | 4 |
7 files changed, 47 insertions, 14 deletions
diff --git a/sw/qa/extras/layout/data/forcepoint75-1.rtf b/sw/qa/extras/layout/data/forcepoint75-1.rtf Binary files differnew file mode 100644 index 000000000000..01a52963757d --- /dev/null +++ b/sw/qa/extras/layout/data/forcepoint75-1.rtf diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index f1c167f2b2e2..e2b3006c1b4e 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -55,6 +55,7 @@ public: void testUserFieldTypeLanguage(); void testTdf109137(); void testForcepoint72(); + void testForcepoint75(); void testForcepoint76(); void testTdf118058(); void testTdf117188(); @@ -92,6 +93,7 @@ public: CPPUNIT_TEST(testUserFieldTypeLanguage); CPPUNIT_TEST(testTdf109137); CPPUNIT_TEST(testForcepoint72); + CPPUNIT_TEST(testForcepoint75); CPPUNIT_TEST(testForcepoint76); CPPUNIT_TEST(testTdf118058); CPPUNIT_TEST(testTdf117188); @@ -2547,10 +2549,22 @@ void SwLayoutWriter::testTdf109137() /*nNumberOfNodes=*/1); } -//just care it doesn't crash +//just care it doesn't crash/assert void SwLayoutWriter::testForcepoint72() { createDoc("forcepoint72-1.rtf"); } //just care it doesn't crash/assert +void SwLayoutWriter::testForcepoint75() +{ + try + { + createDoc("forcepoint75-1.rtf"); + } + catch (...) + { + } +} + +//just care it doesn't crash/assert void SwLayoutWriter::testForcepoint76() { createDoc("forcepoint76-1.rtf"); } void SwLayoutWriter::testTdf118058() diff --git a/sw/source/core/inc/flowfrm.hxx b/sw/source/core/inc/flowfrm.hxx index 6f08a70bd39f..ba5930b4c145 100644 --- a/sw/source/core/inc/flowfrm.hxx +++ b/sw/source/core/inc/flowfrm.hxx @@ -229,6 +229,8 @@ public: void SetFlyLock( bool bNew ){ m_bFlyLock = bNew; } bool IsFlyLock() const { return m_bFlyLock; } + bool ForbiddenForFootnoteCntFwd() const; + // Casting of a Frame into a FlowFrame (if it is one, otherwise 0) // These methods need to be customized in subclasses! static SwFlowFrame *CastFlowFrame( SwFrame *pFrame ); diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index e79318a065f3..5e3db880b044 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -1822,6 +1822,11 @@ bool SwFlowFrame::CheckMoveFwd( bool& rbMakePage, bool bKeep, bool bIgnoreMyOwnK return bMovedFwd; } +bool SwFlowFrame::ForbiddenForFootnoteCntFwd() const +{ + return m_rThis.IsTabFrame() || m_rThis.IsInTab(); +} + /// Return value tells us whether the Frame has changed the page. bool SwFlowFrame::MoveFwd( bool bMakePage, bool bPageBreak, bool bMoveAlways ) { @@ -1829,8 +1834,7 @@ bool SwFlowFrame::MoveFwd( bool bMakePage, bool bPageBreak, bool bMoveAlways ) SwFootnoteBossFrame *pOldBoss = m_rThis.FindFootnoteBossFrame(); if (m_rThis.IsInFootnote()) { - assert(!m_rThis.IsTabFrame()); // prevented by IsMoveable() - assert(!m_rThis.IsInTab()); + assert(!ForbiddenForFootnoteCntFwd()); // prevented by IsMoveable() if (!m_rThis.IsContentFrame() || !pOldBoss) { SAL_WARN("sw.core", "Tables in footnotes are not truly supported"); diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index 0596f5076418..5c1b39e242e4 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -93,11 +93,9 @@ SwSectionFrame::SwSectionFrame( SwSectionFrame &rSect, bool bMaster ) : if( bMaster ) { - if( rSect.IsFollow() ) - { - SwSectionFrame* pMaster = rSect.FindMaster(); + SwSectionFrame* pMaster = rSect.IsFollow() ? rSect.FindMaster() : nullptr; + if (pMaster) pMaster->SetFollow( this ); - } SetFollow( &rSect ); } else @@ -2157,8 +2155,12 @@ SwTwips SwSectionFrame::Grow_( SwTwips nDist, bool bTst ) bool bInCalcContent = GetUpper() && IsInFly() && FindFlyFrame()->IsLocked(); // OD 2004-03-15 #116561# - allow grow in online layout - bool bGrow = !Lower() || !Lower()->IsColumnFrame() || !Lower()->GetNext() || - GetSection()->GetFormat()->GetBalancedColumns().GetValue(); + bool bGrow = !Lower() || !Lower()->IsColumnFrame() || !Lower()->GetNext(); + if (!bGrow) + { + SwSection* pSection = GetSection(); + bGrow = pSection && pSection->GetFormat()->GetBalancedColumns().GetValue(); + } if( !bGrow ) { const SwViewShell *pSh = getRootFrame()->GetCurrShell(); diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 16c2664b177c..b201bbbe648d 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -1935,7 +1935,11 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) SwFrame *pPre = GetPrev(); if ( pPre && pPre->IsTabFrame() && static_cast<SwTabFrame*>(pPre)->GetFollow() == this) { - if ( !MoveFwd( bMakePage, false ) ) + // don't make the effort to move fwd if its known + // conditions that are known not to work + if (IsInFootnote() && ForbiddenForFootnoteCntFwd()) + bMakePage = false; + else if (!MoveFwd(bMakePage, false)) bMakePage = false; bMovedFwd = true; } @@ -2560,8 +2564,15 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) const SwFrame* pOldUpper = GetUpper(); //Let's see if we find some place anywhere... - if ( !bMovedFwd && !MoveFwd( bMakePage, false ) ) - bMakePage = false; + if (!bMovedFwd) + { + // don't make the effort to move fwd if its known + // conditions that are known not to work + if (IsInFootnote() && ForbiddenForFootnoteCntFwd()) + bMakePage = false; + else if (!MoveFwd(bMakePage, false)) + bMakePage = false; + } // #i29771# Reset bSplitError flag on change of upper if ( GetUpper() != pOldUpper ) diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index 7ecc6e95e650..f721eeaf649e 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -979,10 +979,10 @@ void SwFrame::RemoveFromLayout() { OSL_ENSURE( mpUpper, "Remove without upper?" ); - if( mpPrev ) + if (mpPrev) // one out of the middle is removed mpPrev->mpNext = mpNext; - else + else if (mpUpper) { // the first in a list is removed //TODO OSL_ENSURE( mpUpper->m_pLower == this, "Layout is inconsistent." ); mpUpper->m_pLower = mpNext; |