[Libreoffice-commits] core.git: sw/source
Caolán McNamara
caolanm at redhat.com
Tue Oct 6 13:19:39 PDT 2015
sw/source/core/layout/flowfrm.cxx | 9 ++++++---
sw/source/core/layout/sectfrm.cxx | 4 ++--
2 files changed, 8 insertions(+), 5 deletions(-)
New commits:
commit 731e11edb44711c87cefdfa82b484fe82a98f33b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 6 20:52:40 2015 +0100
crashtesting: fix failure on scrolling through ooo77837-1.odt
Change-Id: Iadb8be29d28c957ac773271904ee5ed86950087d
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 92fb9c3..5ba115f3 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 0147d1b..4a24daa 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
More information about the Libreoffice-commits
mailing list