summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-03-07 12:16:28 +0000
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-04-26 23:02:12 +0000
commit4f3e79a0493bf297fe165e974f4f9f044f5c7ed3 (patch)
tree4a5dd4ebb4889b6df3df507cbb7fa29879250f0d
parentf5913301054c4d6ffa2de44abda005a781120679 (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 Cherry-picked from 727ebae15e623660b9cc6f8db0e7558830bf920d Reviewed-on: https://gerrit.libreoffice.org/24155 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 43685487f24bc2a1244922ebc04af467f0eabef6) Reviewed-on: https://gerrit.libreoffice.org/24417 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--sw/source/core/layout/sectfrm.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index bef77ba097e2..60ff9ce54a92 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -1574,7 +1574,7 @@ SwLayoutFrm *SwFrm::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
- SwSectionFrm* pNew;
+ SwSectionFrm* pNew = nullptr;
// This can be omitted if existing Follows were cut short
SwFrm* pFirst = pLayLeaf->Lower();
@@ -1585,7 +1585,7 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage )
pNew = pSect->GetFollow();
else if( MAKEPAGE_NOSECTION == eMakePage )
return pLayLeaf;
- else
+ else if (pSect->GetSection())
{
pNew = new SwSectionFrm( *pSect, false );
pNew->InsertBefore( pLayLeaf, pLayLeaf->Lower() );
@@ -1640,7 +1640,7 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage )
pNew->SimpleFormat();
}
// The wanted layout sheet is now the first of the determined SctFrms:
- pLayLeaf = FIRSTLEAF( pNew );
+ pLayLeaf = pNew ? FIRSTLEAF( pNew ) : nullptr;
}
return pLayLeaf;
}