diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-10-06 20:52:40 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-10-06 21:19:14 +0100 |
commit | 731e11edb44711c87cefdfa82b484fe82a98f33b (patch) | |
tree | 8ed3c0725317f5e8b87c66072dbcf93ff24d3281 /sw | |
parent | 4635a86971b6183e4161e35d903da5e86706f382 (diff) |
crashtesting: fix failure on scrolling through ooo77837-1.odt
Change-Id: Iadb8be29d28c957ac773271904ee5ed86950087d
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/flowfrm.cxx | 9 | ||||
-rw-r--r-- | sw/source/core/layout/sectfrm.cxx | 4 |
2 files changed, 8 insertions, 5 deletions
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 92fb9c3f493a..5ba115f30d5d 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -663,17 +663,20 @@ SwSectionFrm* SwSectionFrm::FindMaster() const { OSL_ENSURE( IsFollow(), "SwSectionFrm::FindMaster(): !IsFollow" ); + if (!pSection) + return nullptr; + SwIterator<SwSectionFrm,SwFormat> aIter( *pSection->GetFormat() ); SwSectionFrm* pSect = aIter.First(); while ( pSect ) { - if( pSect->GetFollow() == this ) - return pSect; + if (pSect->GetFollow() == this) + return pSect; pSect = aIter.Next(); } OSL_FAIL( "Follow ist lost in Space." ); - return 0; + return nullptr; } SwTabFrm* SwTabFrm::FindMaster( bool bFirstMaster ) const diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index 0147d1be463b..4a24daafda89 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -179,9 +179,9 @@ void SwSectionFrm::DelEmpty( bool bRemove ) } _Cut( bRemove ); } - if( IsFollow() ) + SwSectionFrm *pMaster = IsFollow() ? FindMaster() : nullptr; + if (pMaster) { - SwSectionFrm *pMaster = FindMaster(); pMaster->SetFollow( GetFollow() ); // A Master always grabs the space until the lower edge of his // Upper. If he doesn't have a Follow anymore, he can |