diff options
Diffstat (limited to 'sw/source/core/edit/autofmt.cxx')
-rw-r--r-- | sw/source/core/edit/autofmt.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 7588104d5c7f..5c3e22aaed4a 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -1896,11 +1896,14 @@ void SwAutoFormat::BuildHeadLine( sal_uInt16 nLvl ) JoinPrevPara(); DeleteLeadingTrailingBlanks( true, false ); - const SwTextFrame *const pNextFrame = GetNextNode(false); - (void)DeleteJoinCurNextPara(pNextFrame, true); - + const SwTextFrame* pNextFrame = GetNextNode(false); + if (pNextFrame->GetNext()) + { + (void)DeleteJoinCurNextPara(pNextFrame, true); + pNextFrame = GetNextNode(false); + } m_aDelPam.DeleteMark(); - m_aDelPam.GetPoint()->nNode = *GetNextNode(false)->GetTextNodeForParaProps(); + m_aDelPam.GetPoint()->nNode = *pNextFrame->GetTextNodeForParaProps(); m_aDelPam.GetPoint()->nContent.Assign( m_aDelPam.GetContentNode(), 0 ); m_pDoc->SetTextFormatColl( m_aDelPam, &rNxtColl ); } |