diff options
author | Manfred Blume <manfred.blume@cib.de> | 2018-01-31 16:37:55 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-02-06 17:09:51 +0100 |
commit | d30eefb677b446886f7b5bab6de93d489ba63529 (patch) | |
tree | ccf4735b0bb3ef893d9cb19e0d85c06be294c27c | |
parent | 78b597191e9f10e4c523dae548bb51791efc36ff (diff) |
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 <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rwxr-xr-x[-rw-r--r--] | sw/source/core/layout/tabfrm.cxx | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index d0f2ddddba26..b816dfdf319e 100644..100755 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -163,7 +163,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. @@ -1555,7 +1555,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; @@ -1613,7 +1614,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 @@ -1657,7 +1658,8 @@ static void lcl_RecalcRow( SwRowFrame* pRow, long nBottom ) } } break; - } while( true ); + } while (true); + return true; } static void lcl_RecalcTable( SwTabFrame& rTab, @@ -2344,7 +2346,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) @@ -2353,7 +2355,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; |