diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-03-07 12:16:28 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-03-07 12:32:40 +0000 |
commit | 727ebae15e623660b9cc6f8db0e7558830bf920d (patch) | |
tree | b69eb7271daa96e1b790e5780b3645287d3a4583 /sw | |
parent | 14c14094e8587d28eb9cd2a3b5c0c57b355635b5 (diff) |
Resolves: tdf#96172 crashtesting: avoid crash in layout
sectfrm is riddled with workarounds for "half dead"
section frames. This is yet another one.
Change-Id: Ic03ad8971002d7dce308475f1497d1dda8045d15
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/sectfrm.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index 1d3ad20ae2e7..4295f4a520cc 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -1581,7 +1581,7 @@ SwLayoutFrame *SwFrame::GetNextSctLeaf( MakePageType eMakePage ) // We have found the suitable layout sheet. If there (in the sheet) is // already a Follow of our section, we take its first layout sheet, // otherwise it is time to create a section follow - SwSectionFrame* pNew; + SwSectionFrame* pNew = nullptr; // This can be omitted if existing Follows were cut short SwFrame* pFirst = pLayLeaf->Lower(); @@ -1592,7 +1592,7 @@ SwLayoutFrame *SwFrame::GetNextSctLeaf( MakePageType eMakePage ) pNew = pSect->GetFollow(); else if( MAKEPAGE_NOSECTION == eMakePage ) return pLayLeaf; - else + else if (pSect->GetSection()) { pNew = new SwSectionFrame( *pSect, false ); pNew->InsertBefore( pLayLeaf, pLayLeaf->Lower() ); @@ -1647,7 +1647,7 @@ SwLayoutFrame *SwFrame::GetNextSctLeaf( MakePageType eMakePage ) pNew->SimpleFormat(); } // The wanted layout sheet is now the first of the determined SctFrames: - pLayLeaf = FirstLeaf( pNew ); + pLayLeaf = pNew ? FirstLeaf(pNew) : nullptr; } return pLayLeaf; } |