diff options
author | Manfred Blume <manfred.blume@cib.de> | 2018-01-31 16:37:55 +0100 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-02-07 10:51:40 +0100 |
commit | f00070deee9ff550d6ee370eae1402af71928265 (patch) | |
tree | 4f216935e0f0d7db63a57901368227222827464e | |
parent | b8e9f185c509213b4daae018ec27483dacdad2a0 (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>
(cherry picked from commit d30eefb677b446886f7b5bab6de93d489ba63529)
Reviewed-on: https://gerrit.libreoffice.org/49310
Reviewed-by: Katarina Behrens <Katarina.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 ca245b65599d..911ab3380da2 100644..100755 --- 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; |