summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-06-23 15:14:00 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-06-23 15:14:00 +0100
commit3524727db0f3cfecf3a47046795c527808c10c3e (patch)
tree19c39ba0538b9c038da27a6b76f4944fbb2c3ae0
parent767e473f0f16ef0270db4be204dd275814a015a0 (diff)
Related: #i58612# don't crash anyway
-rwxr-xr-xsw/source/core/text/frmform.cxx11
-rw-r--r--sw/source/core/text/inftxt.cxx3
-rw-r--r--sw/source/core/text/txtfly.cxx6
-rw-r--r--sw/source/core/text/txtfrm.cxx7
4 files changed, 17 insertions, 10 deletions
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 6a4be326a337..6b3b9cc59e55 100755
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -1463,10 +1463,11 @@ void SwTxtFrm::_Format( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf,
if( IsFollow() && IsFieldFollow() && rLine.GetStart() == GetOfst() )
{
- const SwLineLayout* pLine;
+ SwTxtFrm *pMaster = FindMaster();
+ OSL_ENSURE( pMaster, "SwTxtFrm::Format: homeless follow" );
+ const SwLineLayout* pLine=NULL;
+ if (pMaster)
{
- SwTxtFrm *pMaster = FindMaster();
- OSL_ENSURE( pMaster, "SwTxtFrm::Format: homeless follow" );
if( !pMaster->HasPara() )
pMaster->GetFormatted();
SwTxtSizeInfo aInf( pMaster );
@@ -1474,8 +1475,8 @@ void SwTxtFrm::_Format( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf,
aMasterLine.Bottom();
pLine = aMasterLine.GetCurr();
}
- SwLinePortion* pRest =
- rLine.MakeRestPortion( pLine, GetOfst() );
+ SwLinePortion* pRest = pLine ?
+ rLine.MakeRestPortion(pLine, GetOfst()) : NULL;
if( pRest )
rInf.SetRest( pRest );
else
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 570b3c6f19c9..a76d74689188 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1465,7 +1465,8 @@ void SwTxtFormatInfo::Init()
if ( GetTxtFrm()->IsFollow() )
{
const SwTxtFrm* pMaster = GetTxtFrm()->FindMaster();
- const SwLinePortion* pTmpPara = pMaster->GetPara();
+ OSL_ENSURE(pMaster, "pTxtFrm without Master");
+ const SwLinePortion* pTmpPara = pMaster ? pMaster->GetPara() : NULL;
// there is a master for this follow and the master does not have
// any contents (especially it does not have a number portion)
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 2d21ece97fe4..fbff110699f4 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -890,7 +890,7 @@ sal_Bool SwTxtFly::IsAnyObj( const SwRect &rRect ) const
const SwCntntFrm* SwTxtFly::_GetMaster()
{
pMaster = pCurrFrm;
- while( pMaster->IsFollow() )
+ while( pMaster && pMaster->IsFollow() )
pMaster = (SwCntntFrm*)pMaster->FindMaster();
return pMaster;
}
@@ -1551,7 +1551,9 @@ SwAnchoredObjList* SwTxtFly::InitAnchoredObjList()
SwTwips SwTxtFly::CalcMinBottom() const
{
SwTwips nRet = 0;
- const SwSortedObjs *pDrawObj = GetMaster()->GetDrawObjs();
+ const SwCntntFrm *pLclMaster = GetMaster();
+ OSL_ENSURE(pLclMaster, "SwTxtFly without master");
+ const SwSortedObjs *pDrawObj = pLclMaster ? pLclMaster->GetDrawObjs() : NULL;
const sal_uInt32 nCount = pDrawObj ? pDrawObj->Count() : 0;
if( nCount )
{
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 6e5f764680b8..9e4a23762f36 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -646,9 +646,12 @@ void SwTxtFrm::HideAndShowObjects()
}
}
- if ( IsFollow() )
+ if (IsFollow())
{
- FindMaster()->HideAndShowObjects();
+ SwTxtFrm *pMaster = FindMaster();
+ OSL_ENSURE(pMaster, "SwTxtFrm without master");
+ if (pMaster)
+ pMaster->HideAndShowObjects();
}
}