sw/source/core/layout/tabfrm.cxx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
New commits: commit 58f356c47b6622a044e300f6c30990d83a693e65 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/49309 Tested-by: Thorsten Behrens <thorsten.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 c25fa113dbe4..846c5af90585 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -179,7 +179,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. @@ -1505,7 +1505,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; @@ -1565,7 +1566,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 @@ -1611,7 +1612,8 @@ static void lcl_RecalcRow( SwRowFrame* pRow, long nBottom ) } } break; - } while( true ); + } while (true); + return true; } static void lcl_RecalcTable( SwTabFrame& rTab, @@ -2292,7 +2294,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 = (GetUpper()->*fnRect->fnGetPrtBottom)(); if( IsInSct() || GetUpper()->IsInTab() ) // TABLE IN TABLE) @@ -2301,7 +2303,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