sw/source/core/layout/tabfrm.cxx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
New commits: commit f00070deee9ff550d6ee370eae1402af71928265 Author: Manfred Blume <manfred.bl...@cib.de> Date: Wed Jan 31 16:37:55 2018 +0100 tdf#114306 fix crash caused by special document 2 Regression from 18765b9fa739337d2d891513f6e2fb7c3ce23b50 Change-Id: Ic4205777077e4e3d93bdddf743c51abba8950eaf Reviewed-on: https://gerrit.libreoffice.org/49031 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> (cherry picked from commit d30eefb677b446886f7b5bab6de93d489ba63529) Reviewed-on: https://gerrit.libreoffice.org/49310 Reviewed-by: Katarina Behrens <katarina.behr...@cib.de> diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx old mode 100644 new mode 100755 index ca245b65599d..911ab3380da2 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -173,7 +173,7 @@ void SwTabFrame::RegistFlys() } void SwInvalidateAll( SwFrame *pFrame, long nBottom ); -static void lcl_RecalcRow( SwRowFrame* pRow, long nBottom ); +static bool lcl_RecalcRow( SwRowFrame* pRow, long nBottom ); static bool lcl_ArrangeLowers( SwLayoutFrame *pLay, long lYStart, bool bInva ); // #i26945# - add parameter <_bOnlyRowsAndCells> to control // that only row and cell frames are formatted. @@ -1565,7 +1565,8 @@ static bool lcl_InnerCalcLayout( SwFrame *pFrame, return bRet; } -static void lcl_RecalcRow( SwRowFrame* pRow, long nBottom ) +// returns false if pRow is invalid +static bool lcl_RecalcRow( SwRowFrame* pRow, long nBottom ) { // FME 2007-08-30 #i81146# new loop control int nLoopControlRuns_1 = 0; @@ -1623,7 +1624,7 @@ static void lcl_RecalcRow( SwRowFrame* pRow, long nBottom ) if (!bRowStillExists) { SAL_WARN("sw.layout", "no row anymore at " << pRow); - return; + return false; } // NEW TABLES @@ -1667,7 +1668,8 @@ static void lcl_RecalcRow( SwRowFrame* pRow, long nBottom ) } } break; - } while( true ); + } while (true); + return true; } static void lcl_RecalcTable( SwTabFrame& rTab, @@ -2354,7 +2356,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) // 1. Try: bTryToSplit = true => Try to split the row. // 2. Try: bTryToSplit = false => Split the table between the rows. - if ( pFirstNonHeadlineRow->GetNext() || bTryToSplit ) + if ((pFirstNonHeadlineRow && pFirstNonHeadlineRow->GetNext()) || bTryToSplit ) { SwTwips nDeadLine = aRectFnSet.GetPrtBottom(*GetUpper()); if( IsInSct() || GetUpper()->IsInTab() ) // TABLE IN TABLE) @@ -2363,7 +2365,11 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext) { SetInRecalcLowerRow( true ); - ::lcl_RecalcRow( static_cast<SwRowFrame*>(Lower()), nDeadLine ); + SwRowFrame* pRow = static_cast<SwRowFrame*>(Lower()); + if (!lcl_RecalcRow(pRow, nDeadLine)) + { + pFirstNonHeadlineRow = GetFirstNonHeadlineRow(); + } SetInRecalcLowerRow( false ); } m_bLowersFormatted = true; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits