sw/source/core/layout/flowfrm.cxx | 6 ++++++ sw/source/core/layout/ftnfrm.cxx | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-)
New commits: commit 7e0871094d0d820d2dc72ee57c38e7af3fb6505d Author: Michael Stahl <mst...@redhat.com> Date: Wed Apr 26 17:17:39 2017 +0200 sw: convert some OSL_ENSURE to assert in ftnfrm.cxx Change-Id: I1e37606a767a6399965ede05beb14abffd07be89 diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 775059c5d966..9f0cdbf04c10 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -835,7 +835,7 @@ void sw_RemoveFootnotes( SwFootnoteBossFrame* pBoss, bool bPageOnly, bool bEndNo if ( pCont ) { SwFootnoteFrame *pFootnote = static_cast<SwFootnoteFrame*>(pCont->Lower()); - OSL_ENSURE( pFootnote, "Footnote content without footnote." ); + assert(pFootnote); if ( bPageOnly ) while ( pFootnote->GetMaster() ) pFootnote = pFootnote->GetMaster(); @@ -955,10 +955,10 @@ SwFootnoteContFrame *SwFootnoteBossFrame::FindFootnoteCont() if ( pFrame ) { SwFrame *pFootnote = pFrame->GetLower(); - OSL_ENSURE( pFootnote, "Content without footnote." ); + assert(pFootnote); while ( pFootnote ) { - OSL_ENSURE( pFootnote->IsFootnoteFrame(), "Neighbor of footnote is not a footnote." ); + assert(pFootnote->IsFootnoteFrame() && "Neighbor of footnote must be a footnote"); pFootnote = pFootnote->GetNext(); } } commit e15b8997f0d2e54fa7b8345063755616d0b100b9 Author: Michael Stahl <mst...@redhat.com> Date: Wed Apr 26 17:10:09 2017 +0200 tdf#107398 sw: do not leave empty footnote container in layout ... when applying loop control in SwFlowFrame::MoveBwd(). The SwFootnoteContFrame is newly created in MoveBwd(), line 2062: pNewUpper = m_rThis.GetLeaf( MAKEPAGE_FTN, false ); If it stays empty, that is not a valid layout so delete it again. Since the idle/timer refactoring in VCL the invalid layout stays until the document is closed; presumably before LO 5.0 the timer based layout would reformat things again. (regression from af41b7f91f22052d49654d41ae9916d6981db3f6) Change-Id: I841f42b465f8123f9246f1fa70d1417ffdd57700 diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 88de9e047f9c..d80c03a054e1 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -2402,6 +2402,12 @@ bool SwFlowFrame::MoveBwd( bool &rbReformat ) ( pNextNewUpper == m_rThis.GetUpper() || pNextNewUpper->GetType() != m_rThis.GetUpper()->GetType() ) ) { + // tdf#107398 do not leave empty footnote container around + if (!pNewUpper->Lower() && pNewUpper->IsFootnoteContFrame()) + { + pNewUpper->Cut(); + SwFrame::DestroyFrame(pNewUpper); + } pNewUpper = nullptr; OSL_FAIL( "<SwFlowFrame::MoveBwd(..)> - layout loop control for layout action <Move Backward> applied!" ); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits