sw/source/core/text/frmform.cxx | 11 ++++++----- sw/source/core/text/inftxt.cxx | 3 ++- sw/source/core/text/txtfly.cxx | 6 ++++-- sw/source/core/text/txtfrm.cxx | 7 +++++-- 4 files changed, 17 insertions(+), 10 deletions(-)
New commits: commit 4c7dc58e47796ff502bbdc5fb93c648c30fc4daf Author: LuboÅ¡ LuÅák <l.lu...@suse.cz> Date: Wed Dec 7 17:23:47 2011 +0100 backport of 3524727db0f3cfecf3a47046795c527808c10c3e commit 3524727db0f3cfecf3a47046795c527808c10c3e Author: Caolán McNamara <caol...@redhat.com> Date: Thu Jun 23 15:14:00 2011 +0100 Related: #i58612# don't crash anyway diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index 80c8c76..c383c7e 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -1445,10 +1445,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 ); @@ -1456,8 +1457,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 ee9f9b9..87a81cd 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -1469,7 +1469,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 78f7021..e2d734d 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -895,7 +895,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; } @@ -1614,7 +1614,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 d90794b..77343ab 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -650,9 +650,12 @@ void SwTxtFrm::HideAndShowObjects() } } - if ( IsFollow() ) + if (IsFollow()) { - FindMaster()->HideAndShowObjects(); + SwTxtFrm *pMaster = FindMaster(); + OSL_ENSURE(pMaster, "SwTxtFrm without master"); + if (pMaster) + pMaster->HideAndShowObjects(); } }
_______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits