diff options
Diffstat (limited to 'sw/source/core/layout')
35 files changed, 980 insertions, 980 deletions
diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx index 661c17365000..568665073748 100644 --- a/sw/source/core/layout/anchoreddrawobject.cxx +++ b/sw/source/core/layout/anchoreddrawobject.cxx @@ -196,7 +196,7 @@ SwAnchoredDrawObject::SwAnchoredDrawObject() : SwAnchoredObject(), mbValidPos( false ), // --> #i34748# - mpLastObjRect( 0L ), + mpLastObjRect( nullptr ), mbNotYetAttachedToAnchorFrame( true ), // --> #i28749# mbNotYetPositioned( true ), @@ -834,7 +834,7 @@ void SwAnchoredDrawObject::NotifyBackground( SwPageFrm* _pPageFrm, */ void SwAnchoredDrawObject::RegisterAtCorrectPage() { - SwPageFrm* pPageFrm( 0L ); + SwPageFrm* pPageFrm( nullptr ); if ( GetVertPosOrientFrm() ) { pPageFrm = const_cast<SwPageFrm*>(GetVertPosOrientFrm()->FindPageFrm()); diff --git a/sw/source/core/layout/anchoredobject.cxx b/sw/source/core/layout/anchoredobject.cxx index eff7767df79e..b6d6553b02df 100644 --- a/sw/source/core/layout/anchoredobject.cxx +++ b/sw/source/core/layout/anchoredobject.cxx @@ -36,7 +36,7 @@ using namespace ::com::sun::star; // implementation of helper class <SwObjPositioningInProgress> SwObjPositioningInProgress::SwObjPositioningInProgress( SdrObject& _rSdrObj ) : - mpAnchoredObj( 0L ), + mpAnchoredObj( nullptr ), // --> #i52904# mbOldObjPositioningInProgress( false ) { @@ -67,14 +67,14 @@ SwObjPositioningInProgress::~SwObjPositioningInProgress() TYPEINIT0(SwAnchoredObject); SwAnchoredObject::SwAnchoredObject() : - mpDrawObj( 0L ), - mpAnchorFrm( 0L ), + mpDrawObj( nullptr ), + mpAnchorFrm( nullptr ), // --> #i28701# - mpPageFrm( 0L ), + mpPageFrm( nullptr ), maRelPos(), maLastCharRect(), mnLastTopOfLine( 0L ), - mpVertPosOrientFrm( 0L ), + mpVertPosOrientFrm( nullptr ), // --> #i28701# mbPositioningInProgress( false ), mbConsiderForTextWrap( false ), @@ -98,7 +98,7 @@ void SwAnchoredObject::ClearVertPosOrientFrm() if (mpVertPosOrientFrm) { const_cast<SwLayoutFrm*>(mpVertPosOrientFrm)->ClearVertPosOrientFrmFor(this); - mpVertPosOrientFrm = NULL; + mpVertPosOrientFrm = nullptr; } } @@ -697,7 +697,7 @@ bool SwAnchoredObject::InvalidationOfPosAllowed() const */ SwPageFrm* SwAnchoredObject::FindPageFrmOfAnchor() { - SwPageFrm* pRetPageFrm = 0L; + SwPageFrm* pRetPageFrm = nullptr; // --> #i44339# - check, if anchor frame exists. if ( mpAnchorFrm ) @@ -720,7 +720,7 @@ SwPageFrm* SwAnchoredObject::FindPageFrmOfAnchor() */ SwTextFrm* SwAnchoredObject::FindAnchorCharFrm() { - SwTextFrm* pAnchorCharFrm( 0L ); + SwTextFrm* pAnchorCharFrm( nullptr ); // --> #i44339# - check, if anchor frame exists. if ( mpAnchorFrm ) @@ -852,7 +852,7 @@ Point SwAnchoredObject::GetRelPosToPageFrm( const bool _bFollowTextFlow, aRelPos = GetObjRect().Pos(); // --> #i33818# - search for cell frame, if object has to // follow the text flow. - const SwFrm* pFrm( 0L ); + const SwFrm* pFrm( nullptr ); if ( _bFollowTextFlow && !GetAnchorFrm()->IsPageFrm() ) { pFrm = GetAnchorFrm()->GetUpper(); diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index fea1265659ae..43e448ed1516 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -132,7 +132,7 @@ void DelHFFormat( SwClient *pToRemove, SwFrameFormat *pFormat ) SwFormatContent& rCnt = (SwFormatContent&)pFormat->GetContent(); if ( rCnt.GetContentIdx() ) { - SwNode *pNode = 0; + SwNode *pNode = nullptr; { // #i92993# // Begin with start node of page header/footer to assure that @@ -459,7 +459,7 @@ SwFormatHeader::SwFormatHeader( const SwFormatHeader &rCpy ) SwFormatHeader::SwFormatHeader( bool bOn ) : SfxPoolItem( RES_HEADER ), - SwClient( 0 ), + SwClient( nullptr ), bActive( bOn ) { } @@ -504,7 +504,7 @@ SwFormatFooter::SwFormatFooter( const SwFormatFooter &rCpy ) SwFormatFooter::SwFormatFooter( bool bOn ) : SfxPoolItem( RES_FOOTER ), - SwClient( 0 ), + SwClient( nullptr ), bActive( bOn ) { } @@ -537,13 +537,13 @@ SwFormatContent::SwFormatContent( const SwFormatContent &rCpy ) : SfxPoolItem( RES_CNTNT ) { pStartNode = rCpy.GetContentIdx() ? - new SwNodeIndex( *rCpy.GetContentIdx() ) : 0; + new SwNodeIndex( *rCpy.GetContentIdx() ) : nullptr; } SwFormatContent::SwFormatContent( const SwStartNode *pStartNd ) : SfxPoolItem( RES_CNTNT ) { - pStartNode = pStartNd ? new SwNodeIndex( *pStartNd ) : 0; + pStartNode = pStartNd ? new SwNodeIndex( *pStartNd ) : nullptr; } SwFormatContent::~SwFormatContent() @@ -554,7 +554,7 @@ SwFormatContent::SwFormatContent( const SwStartNode *pStartNd ) void SwFormatContent::SetNewContentIdx( const SwNodeIndex *pIdx ) { delete pStartNode; - pStartNode = pIdx ? new SwNodeIndex( *pIdx ) : 0; + pStartNode = pIdx ? new SwNodeIndex( *pIdx ) : nullptr; } bool SwFormatContent::operator==( const SfxPoolItem& rAttr ) const @@ -586,7 +586,7 @@ SwFormatPageDesc::SwFormatPageDesc( const SwFormatPageDesc &rCpy ) SwClient( const_cast<SwPageDesc*>(rCpy.GetPageDesc()) ), oNumOffset( rCpy.oNumOffset ), nDescNameIdx( rCpy.nDescNameIdx ), - pDefinedIn( 0 ) + pDefinedIn( nullptr ) { } @@ -594,7 +594,7 @@ SwFormatPageDesc::SwFormatPageDesc( const SwPageDesc *pDesc ) : SfxPoolItem( RES_PAGEDESC ), SwClient( const_cast<SwPageDesc*>(pDesc) ), nDescNameIdx( 0xFFFF ), // IDX_NO_VALUE - pDefinedIn( 0 ) + pDefinedIn( nullptr ) { } @@ -604,7 +604,7 @@ SwFormatPageDesc &SwFormatPageDesc::operator=(const SwFormatPageDesc &rCpy) RegisterToPageDesc(*const_cast<SwPageDesc*>(rCpy.GetPageDesc())); oNumOffset = rCpy.oNumOffset; nDescNameIdx = rCpy.nDescNameIdx; - pDefinedIn = 0; + pDefinedIn = nullptr; return *this; } @@ -613,7 +613,7 @@ SwFormatPageDesc &SwFormatPageDesc::operator=(const SwFormatPageDesc &rCpy) bool SwFormatPageDesc::KnowsPageDesc() const { - return (GetRegisteredIn() != 0); + return (GetRegisteredIn() != nullptr); } bool SwFormatPageDesc::operator==( const SfxPoolItem& rAttr ) const @@ -1101,7 +1101,7 @@ bool SwFormatCol::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) m_bOrtho = false; uno::Reference<lang::XUnoTunnel> xNumTunnel(xCols, uno::UNO_QUERY); - SwXTextColumns* pSwColums = 0; + SwXTextColumns* pSwColums = nullptr; if(xNumTunnel.is()) { pSwColums = reinterpret_cast< SwXTextColumns * >( @@ -1536,7 +1536,7 @@ SwFormatAnchor::SwFormatAnchor( RndStdIds nRnd, sal_uInt16 nPage ) SwFormatAnchor::SwFormatAnchor( const SwFormatAnchor &rCpy ) : SfxPoolItem( RES_ANCHOR ) , m_pContentAnchor( (rCpy.GetContentAnchor()) - ? new SwPosition( *rCpy.GetContentAnchor() ) : 0 ) + ? new SwPosition( *rCpy.GetContentAnchor() ) : nullptr ) , nAnchorId( rCpy.GetAnchorId() ) , nPageNum( rCpy.GetPageNum() ) // OD 2004-05-05 #i28701# - get always new increased order number @@ -1557,12 +1557,12 @@ void SwFormatAnchor::SetAnchor( const SwPosition *pPos ) dynamic_cast<SwStartNode*>(&pPos->nNode.GetNode())) || (FLY_AT_PARA == nAnchorId && dynamic_cast<SwTableNode*>(&pPos->nNode.GetNode())) || dynamic_cast<SwTextNode*>(&pPos->nNode.GetNode())); - m_pContentAnchor .reset( (pPos) ? new SwPosition( *pPos ) : 0 ); + m_pContentAnchor .reset( (pPos) ? new SwPosition( *pPos ) : nullptr ); // Flys anchored AT paragraph should not point into the paragraph content if (m_pContentAnchor && ((FLY_AT_PARA == nAnchorId) || (FLY_AT_FLY == nAnchorId))) { - m_pContentAnchor->nContent.Assign( 0, 0 ); + m_pContentAnchor->nContent.Assign( nullptr, 0 ); } } @@ -1575,7 +1575,7 @@ SwFormatAnchor& SwFormatAnchor::operator=(const SwFormatAnchor& rAnchor) m_pContentAnchor.reset( (rAnchor.GetContentAnchor()) ? new SwPosition(*(rAnchor.GetContentAnchor())) - : 0 ); + : nullptr ); return *this; } @@ -1752,7 +1752,7 @@ void SwFormatAnchor::dumpAsXml(xmlTextWriterPtr pWriter) const // Partially implemented inline in hxx SwFormatURL::SwFormatURL() : SfxPoolItem( RES_URL ), - pMap( 0 ), + pMap( nullptr ), bIsServerMap( false ) { } @@ -1764,7 +1764,7 @@ SwFormatURL::SwFormatURL( const SwFormatURL &rURL) : sName( rURL.GetName() ), bIsServerMap( rURL.IsServerMap() ) { - pMap = rURL.GetMap() ? new ImageMap( *rURL.GetMap() ) : 0; + pMap = rURL.GetMap() ? new ImageMap( *rURL.GetMap() ) : nullptr; } SwFormatURL::~SwFormatURL() @@ -1804,7 +1804,7 @@ void SwFormatURL::SetURL(const OUString &rURL, bool bServerMap) void SwFormatURL::SetMap( const ImageMap *pM ) { delete pMap; - pMap = pM ? new ImageMap( *pM ) : 0; + pMap = pM ? new ImageMap( *pM ) : nullptr; } bool SwFormatURL::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const @@ -2545,8 +2545,8 @@ bool SwFrameFormat::supportsFullDrawingLayerFillAttributeSet() const void SwFrameFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { - SwFormatHeader const *pH = 0; - SwFormatFooter const *pF = 0; + SwFormatHeader const *pH = nullptr; + SwFormatFooter const *pF = nullptr; const sal_uInt16 nWhich = pNew ? pNew->Which() : 0; @@ -2589,13 +2589,13 @@ void SwFrameFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) if( pH && pH->IsActive() && !pH->GetHeaderFormat() ) { //If he doesn't have one, I'll add one - SwFrameFormat *pFormat = GetDoc()->getIDocumentLayoutAccess().MakeLayoutFormat( RND_STD_HEADER, 0 ); + SwFrameFormat *pFormat = GetDoc()->getIDocumentLayoutAccess().MakeLayoutFormat( RND_STD_HEADER, nullptr ); const_cast<SwFormatHeader *>(pH)->RegisterToFormat( *pFormat ); } if( pF && pF->IsActive() && !pF->GetFooterFormat() ) { //If he doesn't have one, I'll add one - SwFrameFormat *pFormat = GetDoc()->getIDocumentLayoutAccess().MakeLayoutFormat( RND_STD_FOOTER, 0 ); + SwFrameFormat *pFormat = GetDoc()->getIDocumentLayoutAccess().MakeLayoutFormat( RND_STD_FOOTER, nullptr ); const_cast<SwFormatFooter *>(pF)->RegisterToFormat( *pFormat ); } @@ -2603,14 +2603,14 @@ void SwFrameFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which())) { // invalidate cached uno object - SetXObject(uno::Reference<uno::XInterface>(0)); + SetXObject(uno::Reference<uno::XInterface>(nullptr)); } - const SwPosition* oldAnchorPosition = NULL; - const SwPosition* newAnchorPosition = NULL; + const SwPosition* oldAnchorPosition = nullptr; + const SwPosition* newAnchorPosition = nullptr; if( pNew && pNew->Which() == RES_ATTRSET_CHG ) { - const SfxPoolItem* tmp = NULL; + const SfxPoolItem* tmp = nullptr; static_cast< const SwAttrSetChg* >(pNew)->GetChgSet()->GetItemState( RES_ANCHOR, false, &tmp ); if( tmp ) newAnchorPosition = static_cast< const SwFormatAnchor* >( tmp )->GetContentAnchor(); @@ -2619,18 +2619,18 @@ void SwFrameFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) newAnchorPosition = static_cast< const SwFormatAnchor* >( pNew )->GetContentAnchor(); if( pOld && pOld->Which() == RES_ATTRSET_CHG ) { - const SfxPoolItem* tmp = NULL; + const SfxPoolItem* tmp = nullptr; static_cast< const SwAttrSetChg* >(pOld)->GetChgSet()->GetItemState( RES_ANCHOR, false, &tmp ); if( tmp ) oldAnchorPosition = static_cast< const SwFormatAnchor* >( tmp )->GetContentAnchor(); } if( pOld && pOld->Which() == RES_ANCHOR ) oldAnchorPosition = static_cast< const SwFormatAnchor* >( pOld )->GetContentAnchor(); - if( oldAnchorPosition != NULL && ( newAnchorPosition == NULL || oldAnchorPosition->nNode.GetIndex() != newAnchorPosition->nNode.GetIndex())) + if( oldAnchorPosition != nullptr && ( newAnchorPosition == nullptr || oldAnchorPosition->nNode.GetIndex() != newAnchorPosition->nNode.GetIndex())) { oldAnchorPosition->nNode.GetNode().RemoveAnchoredFly(this); } - if( newAnchorPosition != NULL && ( oldAnchorPosition == NULL || oldAnchorPosition->nNode.GetIndex() != newAnchorPosition->nNode.GetIndex())) + if( newAnchorPosition != nullptr && ( oldAnchorPosition == nullptr || oldAnchorPosition->nNode.GetIndex() != newAnchorPosition->nNode.GetIndex())) { newAnchorPosition->nNode.GetNode().AddAnchoredFly(this); } @@ -2650,7 +2650,7 @@ void SwFrameFormat::DelFrms() do { pLast->Cut(); SwFrm::DestroyFrm(pLast); - } while( 0 != ( pLast = aIter.Next() )); + } while( nullptr != ( pLast = aIter.Next() )); } void SwFrameFormat::MakeFrms() @@ -2662,7 +2662,7 @@ SwRect SwFrameFormat::FindLayoutRect( const bool bPrtArea, const Point* pPoint, const bool bCalcFrm ) const { SwRect aRet; - SwFrm *pFrm = 0; + SwFrm *pFrm = nullptr; if( dynamic_cast<const SwSectionFormat*>( this ) != nullptr ) { // get the Frame using Node2Layout @@ -2686,15 +2686,15 @@ SwRect SwFrameFormat::FindLayoutRect( const bool bPrtArea, const Point* pPoint, aRet = pFrm->Frm(); --aRet.Pos().Y(); } - pFrm = 0; // the rect is finished by now + pFrm = nullptr; // the rect is finished by now } } } else { const sal_uInt16 nFrmType = RES_FLYFRMFMT == Which() ? FRM_FLY : USHRT_MAX; - pFrm = ::GetFrmOfModify( 0, *const_cast<SwModify*>(static_cast<SwModify const *>(this)), nFrmType, pPoint, - 0, bCalcFrm ); + pFrm = ::GetFrmOfModify( nullptr, *const_cast<SwModify*>(static_cast<SwModify const *>(this)), nFrmType, pPoint, + nullptr, bCalcFrm ); } if( pFrm ) @@ -2717,7 +2717,7 @@ SdrObject* SwFrameFormat::FindSdrObject() // #i30669# - use method <FindContactObj()> instead of // duplicated code. SwContact* pFoundContact = FindContactObj(); - return pFoundContact ? pFoundContact->GetMaster() : 0; + return pFoundContact ? pFoundContact->GetMaster() : nullptr; } SdrObject* SwFrameFormat::FindRealSdrObject() @@ -2725,9 +2725,9 @@ SdrObject* SwFrameFormat::FindRealSdrObject() if( RES_FLYFRMFMT == Which() ) { Point aNullPt; - SwFlyFrm* pFly = static_cast<SwFlyFrm*>(::GetFrmOfModify( 0, *this, FRM_FLY, + SwFlyFrm* pFly = static_cast<SwFlyFrm*>(::GetFrmOfModify( nullptr, *this, FRM_FLY, &aNullPt )); - return pFly ? pFly->GetVirtDrawObj() : 0; + return pFly ? pFly->GetVirtDrawObj() : nullptr; } return FindSdrObject(); } @@ -2819,7 +2819,7 @@ void SwFrameFormat::dumpAsXml(xmlTextWriterPtr pWriter) const xmlTextWriterWriteAttribute(pWriter, BAD_CAST("name"), BAD_CAST(GetName().toUtf8().getStr())); xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("whichId"), "%d", Which()); - const char* pWhich = 0; + const char* pWhich = nullptr; switch (Which()) { case RES_FLYFRMFMT: @@ -2859,7 +2859,7 @@ SwFlyFrameFormat::~SwFlyFrameFormat() do { SwFrm::DestroyFrm(pLast); - } while( 0 != ( pLast = aIter.Next() )); + } while( nullptr != ( pLast = aIter.Next() )); SwIterator<SwFlyDrawContact,SwFormat> a2ndIter( *this ); SwFlyDrawContact* pC = a2ndIter.First(); @@ -2867,7 +2867,7 @@ SwFlyFrameFormat::~SwFlyFrameFormat() do { delete pC; - } while( 0 != ( pC = a2ndIter.Next() )); + } while( nullptr != ( pC = a2ndIter.Next() )); } /// Creates the Frms if the format describes a paragraph-bound frame. @@ -2878,7 +2878,7 @@ void SwFlyFrameFormat::MakeFrms() if( !GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell() ) return; - SwModify *pModify = 0; + SwModify *pModify = nullptr; // OD 24.07.2003 #111032# - create local copy of anchor attribute for possible changes. SwFormatAnchor aAnchorAttr( GetAnchor() ); switch( aAnchorAttr.GetAnchorId() ) @@ -2903,7 +2903,7 @@ void SwFlyFrameFormat::MakeFrms() SwNodeIndex aIdx( aAnchorAttr.GetContentAnchor()->nNode ); SwContentNode *pCNd = GetDoc()->GetNodes().GoNext( &aIdx ); // #i105535# - if ( pCNd == 0 ) + if ( pCNd == nullptr ) { pCNd = aAnchorAttr.GetContentAnchor()->nNode.GetNode().GetContentNode(); } @@ -2915,7 +2915,7 @@ void SwFlyFrameFormat::MakeFrms() } } // #i105535# - if ( pModify == 0 ) + if ( pModify == nullptr ) { const SwNodeIndex &rIdx = aAnchorAttr.GetContentAnchor()->nNode; SwFrameFormats& rFormats = *GetDoc()->GetSpzFrameFormats(); @@ -2941,14 +2941,14 @@ void SwFlyFrameFormat::MakeFrms() { SwContentNode *pCNd = aAnchorAttr.GetContentAnchor()->nNode.GetNode().GetContentNode(); SwIterator<SwFrm,SwContentNode> aIter( *pCNd ); - for ( SwFrm* pFrm = aIter.First(); pFrm != NULL; pFrm = aIter.Next() ) + for ( SwFrm* pFrm = aIter.First(); pFrm != nullptr; pFrm = aIter.Next() ) { pPage = pFrm->FindPageFrm(); if( pPage ) { nPgNum = pPage->GetPhyPageNum(); aAnchorAttr.SetPageNum( nPgNum ); - aAnchorAttr.SetAnchor( 0 ); + aAnchorAttr.SetAnchor( nullptr ); SetFormatAttr( aAnchorAttr ); break; } @@ -2959,7 +2959,7 @@ void SwFlyFrameFormat::MakeFrms() if ( pPage->GetPhyPageNum() == nPgNum ) { // #i50432# - adjust synopsis of <PlaceFly(..)> - pPage->PlaceFly( 0, this ); + pPage->PlaceFly( nullptr, this ); break; } pPage = static_cast<SwPageFrm*>(pPage->GetNext()); @@ -3046,8 +3046,8 @@ void SwFlyFrameFormat::MakeFrms() SwFlyFrm* SwFlyFrameFormat::GetFrm( const Point* pPoint, const bool bCalcFrm ) const { - return static_cast<SwFlyFrm*>(::GetFrmOfModify( 0, *const_cast<SwModify*>(static_cast<SwModify const *>(this)), FRM_FLY, - pPoint, 0, bCalcFrm )); + return static_cast<SwFlyFrm*>(::GetFrmOfModify( nullptr, *const_cast<SwModify*>(static_cast<SwModify const *>(this)), FRM_FLY, + pPoint, nullptr, bCalcFrm )); } SwAnchoredObject* SwFlyFrameFormat::GetAnchoredObj( const Point* pPoint, const bool bCalcFrm ) const @@ -3059,7 +3059,7 @@ SwAnchoredObject* SwFlyFrameFormat::GetAnchoredObj( const Point* pPoint, const b } else { - return 0L; + return nullptr; } } @@ -3275,7 +3275,7 @@ SwHandleAnchorNodeChg::SwHandleAnchorNodeChg( SwFlyFrameFormat& _rFlyFrameFormat pFrm->Cut(); SwFrm::DestroyFrm(pFrm); } - } while( 0 != ( pFrm = aIter.Next() )); + } while( nullptr != ( pFrm = aIter.Next() )); } // indicate, that re-creation of fly frames necessary mbAnchorNodeChanged = true; @@ -3382,19 +3382,19 @@ IMapObject* SwFrameFormat::GetIMapObject( const Point& rPoint, { const SwFormatURL &rURL = GetURL(); if( !rURL.GetMap() ) - return 0; + return nullptr; if( !pFly ) { pFly = SwIterator<SwFlyFrm,SwFormat>( *this ).First(); if( !pFly ) - return 0; + return nullptr; } //Original size for OLE and graphic is TwipSize, otherwise the size of //FrameFormat of the Fly. const SwFrm *pRef; - const SwNoTextNode *pNd = 0; + const SwNoTextNode *pNd = nullptr; Size aOrigSz; if( pFly->Lower() && pFly->Lower()->IsNoTextFrm() ) { @@ -3436,7 +3436,7 @@ IMapObject* SwFrameFormat::GetIMapObject( const Point& rPoint, aActSz, aPos, nFlags ); } - return 0; + return nullptr; } //UUUU diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 5b32b56acae8..1ef7373faf68 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -349,18 +349,18 @@ void SwFrm::OptPrepareMake() { { SwFrmDeleteGuard aDeleteGuard(this); - GetUpper()->Calc(getRootFrm()->GetCurrShell() ? getRootFrm()->GetCurrShell()->GetOut() : 0); + GetUpper()->Calc(getRootFrm()->GetCurrShell() ? getRootFrm()->GetCurrShell()->GetOut() : nullptr); } OSL_ENSURE( GetUpper(), ":-( Layout unstable (Upper gone)." ); if ( !GetUpper() ) return; } if ( GetPrev() && !GetPrev()->IsValid() ) - PrepareMake(getRootFrm()->GetCurrShell() ? getRootFrm()->GetCurrShell()->GetOut() : 0); + PrepareMake(getRootFrm()->GetCurrShell() ? getRootFrm()->GetCurrShell()->GetOut() : nullptr); else { StackHack aHack; - MakeAll(IsRootFrm() ? 0 : getRootFrm()->GetCurrShell()->GetOut()); + MakeAll(IsRootFrm() ? nullptr : getRootFrm()->GetCurrShell()->GetOut()); } } @@ -370,7 +370,7 @@ void SwFrm::PrepareCrsr() if( GetUpper() && !GetUpper()->IsSctFrm() ) { GetUpper()->PrepareCrsr(); - GetUpper()->Calc(getRootFrm()->GetCurrShell() ? getRootFrm()->GetCurrShell()->GetOut() : 0); + GetUpper()->Calc(getRootFrm()->GetCurrShell() ? getRootFrm()->GetCurrShell()->GetOut() : nullptr); OSL_ENSURE( GetUpper(), ":-( Layout unstable (Upper gone)." ); if ( !GetUpper() ) @@ -381,7 +381,7 @@ void SwFrm::PrepareCrsr() bool bNoSect = IsInSct(); bool bOldTabLock = false, bFoll; - SwFlowFrm* pThis = bCnt ? static_cast<SwContentFrm*>(this) : NULL; + SwFlowFrm* pThis = bCnt ? static_cast<SwContentFrm*>(this) : nullptr; if ( bTab ) { @@ -438,7 +438,7 @@ void SwFrm::PrepareCrsr() if ( bTab && !bOldTabLock ) ::PrepareUnlock( static_cast<SwTabFrm*>(this) ); } - Calc(getRootFrm()->GetCurrShell() ? getRootFrm()->GetCurrShell()->GetOut() : 0); + Calc(getRootFrm()->GetCurrShell() ? getRootFrm()->GetCurrShell()->GetOut() : nullptr); } // Here we return GetPrev(); however we will ignore empty SectionFrms @@ -482,7 +482,7 @@ void SwFrm::MakePos() !pPrv->GetAttrSet()->GetKeep().GetValue() ) { - pPrv->Calc(getRootFrm()->GetCurrShell() ? getRootFrm()->GetCurrShell()->GetOut() : 0); // This may cause Prev to vanish! + pPrv->Calc(getRootFrm()->GetCurrShell() ? getRootFrm()->GetCurrShell()->GetOut() : nullptr); // This may cause Prev to vanish! } else if ( pPrv->Frm().Top() == 0 ) { @@ -640,12 +640,12 @@ static void lcl_CheckObjects( SwSortedObjs* pSortedObjs, SwFrm* pFrm, long& rBot void SwPageFrm::MakeAll(vcl::RenderContext* pRenderContext) { - PROTOCOL_ENTER( this, PROT_MAKEALL, 0, 0 ) + PROTOCOL_ENTER( this, PROT_MAKEALL, 0, nullptr ) const SwRect aOldRect( Frm() ); // Adjust root size const SwLayNotify aNotify( this ); // takes care of the notification in the dtor std::unique_ptr<SwBorderAttrAccess> pAccess; - const SwBorderAttrs*pAttrs = 0; + const SwBorderAttrs*pAttrs = nullptr; while ( !mbValidPos || !mbValidSize || !mbValidPrtArea ) { @@ -776,7 +776,7 @@ void SwPageFrm::MakeAll(vcl::RenderContext* pRenderContext) } //while ( !mbValidPos || !mbValidSize || !mbValidPrtArea ) if ( Frm() != aOldRect && GetUpper() ) - static_cast<SwRootFrm*>(GetUpper())->CheckViewLayout( 0, 0 ); + static_cast<SwRootFrm*>(GetUpper())->CheckViewLayout( nullptr, nullptr ); OSL_ENSURE( !GetUpper() || GetUpper()->Prt().Width() >= maFrm.Width(), "Upper (Root) must be wide enough to contain the widest page"); @@ -784,7 +784,7 @@ void SwPageFrm::MakeAll(vcl::RenderContext* pRenderContext) void SwLayoutFrm::MakeAll(vcl::RenderContext* /*pRenderContext*/) { - PROTOCOL_ENTER( this, PROT_MAKEALL, 0, 0 ) + PROTOCOL_ENTER( this, PROT_MAKEALL, 0, nullptr ) // takes care of the notification in the dtor const SwLayNotify aNotify( this ); @@ -793,7 +793,7 @@ void SwLayoutFrm::MakeAll(vcl::RenderContext* /*pRenderContext*/) SwRectFn fnRect = ( IsNeighbourFrm() == bVert )? fnRectHori : ( IsVertLR() ? fnRectVertL2R : fnRectVert ); std::unique_ptr<SwBorderAttrAccess> pAccess; - const SwBorderAttrs*pAttrs = 0; + const SwBorderAttrs*pAttrs = nullptr; while ( !mbValidPos || !mbValidSize || !mbValidPrtArea ) { @@ -869,12 +869,12 @@ bool SwTextNode::IsCollapse() const const SwEndNode *pNdAfter=GetNodes()[nIdx+1]->GetEndNode(); // The paragraph is collapsed only if the NdAfter is the end of a cell - bool bInTable = this->FindTableNode( ) != NULL; + bool bInTable = this->FindTableNode( ) != nullptr; SwSortedObjs* pObjs = this->getLayoutFrm( GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout() )->GetDrawObjs( ); - const size_t nObjs = ( pObjs != NULL ) ? pObjs->size( ) : 0; + const size_t nObjs = ( pObjs != nullptr ) ? pObjs->size( ) : 0; - return pNdBefore!=NULL && pNdAfter!=NULL && nObjs == 0 && bInTable; + return pNdBefore!=nullptr && pNdAfter!=nullptr && nObjs == 0 && bInTable; } return false; @@ -1056,7 +1056,7 @@ void SwContentFrm::MakeAll(vcl::RenderContext* /*pRenderContext*/) long nFormatCount = 0; // - loop prevention int nConsecutiveFormatsWithoutChange = 0; - PROTOCOL_ENTER( this, PROT_MAKEALL, 0, 0 ) + PROTOCOL_ENTER( this, PROT_MAKEALL, 0, nullptr ) #ifdef DBG_UTIL const SwDoc *pDoc = GetAttrSet()->GetDoc(); @@ -1112,7 +1112,7 @@ void SwContentFrm::MakeAll(vcl::RenderContext* /*pRenderContext*/) const bool bKeep = IsKeep( rAttrs.GetAttrSet() ); - SwSaveFootnoteHeight *pSaveFootnote = 0; + SwSaveFootnoteHeight *pSaveFootnote = nullptr; if ( bFootnote ) { SwFootnoteFrm *pFootnote = FindFootnoteFrm(); @@ -1179,7 +1179,7 @@ void SwContentFrm::MakeAll(vcl::RenderContext* /*pRenderContext*/) if ( bFootnote && !mbValidPos ) { SwFootnoteFrm* pFootnote = FindFootnoteFrm(); - SwContentFrm* pRefCnt = pFootnote ? pFootnote->GetRef() : 0; + SwContentFrm* pRefCnt = pFootnote ? pFootnote->GetRef() : nullptr; if ( pRefCnt && !pRefCnt->IsValid() ) { SwFootnoteBossFrm* pFootnoteBossOfFootnote = pFootnote->FindFootnoteBossFrm(); @@ -1309,7 +1309,7 @@ void SwContentFrm::MakeAll(vcl::RenderContext* /*pRenderContext*/) if ( bMoveable && !bFormatted && ( GetFollow() || ( (Frm().*fnRect->fnOverStep)( nDeadLine ) ) ) ) { - Prepare( PREP_WIDOWS_ORPHANS, 0, false ); + Prepare( PREP_WIDOWS_ORPHANS, nullptr, false ); mbValidSize = bWidow = false; } if( (Frm().*fnRect->fnGetPos)() != aOldFrmPos || @@ -1320,7 +1320,7 @@ void SwContentFrm::MakeAll(vcl::RenderContext* /*pRenderContext*/) Prepare( PREP_POS_CHGD, static_cast<const void*>(&bFormatted), false ); if ( bWidow && GetFollow() ) { - Prepare( PREP_WIDOWS_ORPHANS, 0, false ); + Prepare( PREP_WIDOWS_ORPHANS, nullptr, false ); mbValidSize = false; } } @@ -1383,16 +1383,16 @@ void SwContentFrm::MakeAll(vcl::RenderContext* /*pRenderContext*/) const long nOldW = (Prt().*fnRect->fnGetWidth)(); MakePrtArea( rAttrs ); if( nOldW != (Prt().*fnRect->fnGetWidth)() ) - Prepare( PREP_FIXSIZE_CHG, 0, false ); + Prepare( PREP_FIXSIZE_CHG, nullptr, false ); } if( GetFollow() ) - Prepare( PREP_WIDOWS_ORPHANS, 0, false ); + Prepare( PREP_WIDOWS_ORPHANS, nullptr, false ); mbValidSize = true; bFormatted = sal_True; Format(getRootFrm()->GetCurrShell()->GetOut()); } } - SwFrm *pNxt = HasFollow() ? NULL : FindNext(); + SwFrm *pNxt = HasFollow() ? nullptr : FindNext(); while( pNxt && pNxt->IsSctFrm() ) { // Leave empty sections out, go into the other ones. if( static_cast<SwSectionFrm*>(pNxt)->GetSection() ) @@ -1482,7 +1482,7 @@ void SwContentFrm::MakeAll(vcl::RenderContext* /*pRenderContext*/) // bMoveFwdInvalid is required for #38407#. This was originally solved // in flowfrm.cxx rev 1.38, but broke the above schema and // preferred to play towers of hanoi (#43669#). - SwFrm *pNxt = HasFollow() ? NULL : FindNext(); + SwFrm *pNxt = HasFollow() ? nullptr : FindNext(); // For sections we prefer the content, because it can change // the page if required. while( pNxt && pNxt->IsSctFrm() ) @@ -1496,7 +1496,7 @@ void SwContentFrm::MakeAll(vcl::RenderContext* /*pRenderContext*/) } if ( pNxt ) { - const bool bMoveFwdInvalid = 0 != GetIndNext(); + const bool bMoveFwdInvalid = nullptr != GetIndNext(); const bool bNxtNew = ( 0 == (pNxt->Prt().*fnRect->fnGetHeight)() ) && (!pNxt->IsTextFrm() ||!static_cast<SwTextFrm*>(pNxt)->IsHiddenNow()); @@ -1556,7 +1556,7 @@ void SwContentFrm::MakeAll(vcl::RenderContext* /*pRenderContext*/) // Finally, we are able to split table rows. Therefore, bDontMoveMe // can be set to false: if( bDontMoveMe && IsInTab() && - 0 != GetNextCellLeaf( MAKEPAGE_NONE ) ) + nullptr != GetNextCellLeaf( MAKEPAGE_NONE ) ) bDontMoveMe = false; if ( bDontMoveMe && (Frm().*fnRect->fnGetHeight)() > @@ -1569,7 +1569,7 @@ void SwContentFrm::MakeAll(vcl::RenderContext* /*pRenderContext*/) bool bSplit = !IsFwdMoveAllowed(); if ( nTmp > 0 && WouldFit( nTmp, bSplit, false ) ) { - Prepare( PREP_WIDOWS_ORPHANS, 0, false ); + Prepare( PREP_WIDOWS_ORPHANS, nullptr, false ); mbValidSize = false; bFitPromise = true; continue; @@ -1643,7 +1643,7 @@ void SwContentFrm::MakeAll(vcl::RenderContext* /*pRenderContext*/) // FME 2007-08-30 #i81146# new loop control if ( nConsecutiveFormatsWithoutChange <= cnStopFormat ) { - Prepare( PREP_MUST_FIT, 0, false ); + Prepare( PREP_MUST_FIT, nullptr, false ); mbValidSize = false; bMustFit = true; continue; @@ -1765,7 +1765,7 @@ bool SwContentFrm::_WouldFit( SwTwips nSpace, // To have the footnote select it's place carefully, it needs // to be moved in any case if there is at least one page/column // between the footnote and the new Upper. - SwFootnoteFrm* pFootnoteFrm = 0; + SwFootnoteFrm* pFootnoteFrm = nullptr; if ( IsInFootnote() ) { if( !lcl_IsNextFootnoteBoss( pNewUpper, this ) ) @@ -1807,7 +1807,7 @@ bool SwContentFrm::_WouldFit( SwTwips nSpace, SwLayoutFrm *pUp = pTmpFrm->GetUpper(); SwFrm *pOldNext = pTmpFrm->GetNext(); pTmpFrm->RemoveFromLayout(); - pTmpFrm->InsertBefore( pNewUpper, 0 ); + pTmpFrm->InsertBefore( pNewUpper, nullptr ); if ( pFrm->IsTextFrm() && ( bTstMove || static_cast<SwTextFrm*>(pFrm)->HasFollow() || @@ -1843,7 +1843,7 @@ bool SwContentFrm::_WouldFit( SwTwips nSpace, if ( pTmpPrev ) { - nUpper = CalcUpperSpace( NULL, pTmpPrev ); + nUpper = CalcUpperSpace( nullptr, pTmpPrev ); // in balanced columned section frames we do not want the // common border @@ -1936,7 +1936,7 @@ bool SwContentFrm::_WouldFit( SwTwips nSpace, } } SwFrm *pNxt; - if( 0 != (pNxt = pFrm->FindNext()) && pNxt->IsContentFrm() && + if( nullptr != (pNxt = pFrm->FindNext()) && pNxt->IsContentFrm() && ( !pFootnoteFrm || ( pNxt->IsInFootnote() && pNxt->FindFootnoteFrm()->GetAttr() == pFootnoteFrm->GetAttr() ) ) ) { @@ -1957,7 +1957,7 @@ bool SwContentFrm::_WouldFit( SwTwips nSpace, // spacing has been calculated already, and we don't need to re-calculate // it in an expensive way. if( lcl_NotHiddenPrev( pNxt ) ) - pTmpPrev = 0; + pTmpPrev = nullptr; else { if( pFrm->IsTextFrm() && static_cast<SwTextFrm*>(pFrm)->IsHiddenNow() ) @@ -1968,10 +1968,10 @@ bool SwContentFrm::_WouldFit( SwTwips nSpace, pFrm = static_cast<SwContentFrm*>(pNxt); } else - pFrm = 0; + pFrm = nullptr; } else - pFrm = 0; + pFrm = nullptr; } while ( bRet && pFrm ); diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx index e8d22fb4a65a..9c5b9796c18f 100644 --- a/sw/source/core/layout/colfrm.cxx +++ b/sw/source/core/layout/colfrm.cxx @@ -37,7 +37,7 @@ SwColumnFrm::SwColumnFrm( SwFrameFormat *pFormat, SwFrm* pSib ): { mnFrmType = FRM_COLUMN; SwBodyFrm* pColBody = new SwBodyFrm( pFormat->GetDoc()->GetDfltFrameFormat(), pSib ); - pColBody->InsertBehind( this, 0 ); // ColumnFrms now with BodyFrm + pColBody->InsertBehind( this, nullptr ); // ColumnFrms now with BodyFrm SetMaxFootnoteHeight( LONG_MAX ); } @@ -94,9 +94,9 @@ static SwLayoutFrm * lcl_FindColumns( SwLayoutFrm *pLay, sal_uInt16 nCount ) sal_uInt16 i; for ( i = 0; pTmp; pTmp = pTmp->GetNext(), ++i ) /* do nothing */; - return i == nCount ? static_cast<SwLayoutFrm*>(pCol) : 0; + return i == nCount ? static_cast<SwLayoutFrm*>(pCol) : nullptr; } - return 0; + return nullptr; } static bool lcl_AddColumns( SwLayoutFrm *pCont, sal_uInt16 nCount ) @@ -111,7 +111,7 @@ static bool lcl_AddColumns( SwLayoutFrm *pCont, sal_uInt16 nCount ) SwLayoutFrm *pAttrOwner = pCont; if ( pCont->IsBodyFrm() ) pAttrOwner = pCont->FindPageFrm(); - SwLayoutFrm *pNeighbourCol = 0; + SwLayoutFrm *pNeighbourCol = nullptr; SwIterator<SwLayoutFrm,SwFormat> aIter( *pAttrOwner->GetFormat() ); SwLayoutFrm *pNeighbour = aIter.First(); @@ -122,10 +122,10 @@ static bool lcl_AddColumns( SwLayoutFrm *pCont, sal_uInt16 nCount ) /* do nothing */; while ( pNeighbour ) { - if ( 0 != (pNeighbourCol = lcl_FindColumns( pNeighbour, nCount+nAdd )) && + if ( nullptr != (pNeighbourCol = lcl_FindColumns( pNeighbour, nCount+nAdd )) && pNeighbourCol != pCont ) break; - pNeighbourCol = 0; + pNeighbourCol = nullptr; pNeighbour = aIter.Next(); } @@ -145,7 +145,7 @@ static bool lcl_AddColumns( SwLayoutFrm *pCont, sal_uInt16 nCount ) { SwColumnFrm *pTmpCol = new SwColumnFrm( pNeighbourCol->GetFormat(), pCont ); pTmpCol->SetMaxFootnoteHeight( nMax ); - pTmpCol->InsertBefore( pCont, NULL ); + pTmpCol->InsertBefore( pCont, nullptr ); pNeighbourCol = static_cast<SwLayoutFrm*>(pNeighbourCol->GetNext()); } } @@ -193,7 +193,7 @@ void SwLayoutFrm::ChgColumns( const SwFormatCol &rOld, const SwFormatCol &rNew, if( Lower() && Lower()->IsColumnFrm() ) { SwFrm* pCol = Lower(); - while( 0 != (pCol=pCol->GetNext()) ) + while( nullptr != (pCol=pCol->GetNext()) ) ++nOldNum; } nNewNum = rNew.GetNumCols(); @@ -209,7 +209,7 @@ void SwLayoutFrm::ChgColumns( const SwFormatCol &rOld, const SwFormatCol &rNew, bool bAdjustAttributes = nOldNum != rOld.GetNumCols(); //The content is saved and restored if the column count is different. - SwFrm *pSave = 0; + SwFrm *pSave = nullptr; if( nOldNum != nNewNum || bChgFootnote ) { SwDoc *pDoc = GetFormat()->GetDoc(); @@ -229,7 +229,7 @@ void SwLayoutFrm::ChgColumns( const SwFormatCol &rOld, const SwFormatCol &rNew, else GetFormat()->SetFormatAttr( SwFormatFillOrder() ); if ( pSave ) - ::RestoreContent( pSave, this, 0, true ); + ::RestoreContent( pSave, this, nullptr, true ); return; } if ( nOldNum == 1 ) @@ -282,7 +282,7 @@ void SwLayoutFrm::ChgColumns( const SwFormatCol &rOld, const SwFormatCol &rNew, static_cast<SwLayoutFrm*>(Lower())->Lower() && static_cast<SwLayoutFrm*>(Lower())->Lower()->IsLayoutFrm(), "no column body." ); // ColumnFrms contain BodyFrms - ::RestoreContent( pSave, static_cast<SwLayoutFrm*>(static_cast<SwLayoutFrm*>(Lower())->Lower()), 0, true ); + ::RestoreContent( pSave, static_cast<SwLayoutFrm*>(static_cast<SwLayoutFrm*>(Lower())->Lower()), nullptr, true ); } } diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx index 2e82142222c3..07b64636aeb2 100644 --- a/sw/source/core/layout/dbg_lay.cxx +++ b/sw/source/core/layout/dbg_lay.cxx @@ -104,7 +104,7 @@ #include <comphelper/string.hxx> sal_uLong SwProtocol::nRecord = 0; -SwImplProtocol* SwProtocol::pImpl = NULL; +SwImplProtocol* SwProtocol::pImpl = nullptr; static sal_uLong lcl_GetFrameId( const SwFrm* pFrm ) { @@ -247,7 +247,7 @@ void SwProtocol::Stop() if( pImpl ) { delete pImpl; - pImpl = NULL; + pImpl = nullptr; if( pFntCache ) pFntCache->Flush(); } @@ -255,7 +255,7 @@ void SwProtocol::Stop() } SwImplProtocol::SwImplProtocol() - : pStream( NULL ), pFrmIds( NULL ), nTypes( 0xffff ), + : pStream( nullptr ), pFrmIds( nullptr ), nTypes( 0xffff ), nLineCount( 0 ), nMaxLines( USHRT_MAX ), nTestMode( 0 ) { NewStream(); @@ -269,9 +269,9 @@ bool SwImplProtocol::NewStream() if( pStream->GetError() ) { delete pStream; - pStream = NULL; + pStream = nullptr; } - return 0 != pStream; + return nullptr != pStream; } SwImplProtocol::~SwImplProtocol() @@ -301,7 +301,7 @@ void SwImplProtocol::CheckLine( OString& rLine ) nInitFile = 1; pFrmIds->clear(); delete pFrmIds; - pFrmIds = NULL; // default: log all frames + pFrmIds = nullptr; // default: log all frames } else if (aTmp == "[frmtype")// section types { @@ -508,8 +508,8 @@ void SwImplProtocol::_Record( const SwFrm* pFrm, sal_uLong nFunction, sal_uLong { case 1: InsertFrm( nId ); break; case 2: DeleteFrm( nId ); break; - case 3: pFrmIds->clear(); delete pFrmIds; pFrmIds = NULL; break; - case 4: delete pStream; pStream = NULL; break; + case 3: pFrmIds->clear(); delete pFrmIds; pFrmIds = nullptr; break; + case 4: delete pStream; pStream = nullptr; break; } return; } diff --git a/sw/source/core/layout/dumpfilter.cxx b/sw/source/core/layout/dumpfilter.cxx index fe315d3bf7a8..be559b4bff35 100644 --- a/sw/source/core/layout/dumpfilter.cxx +++ b/sw/source/core/layout/dumpfilter.cxx @@ -104,11 +104,11 @@ namespace sw // Dump the layout XML into the XOutputStream xmlOutputBufferPtr outBuffer = xmlOutputBufferCreateIO( - writeCallback, closeCallback, static_cast<void*>(xOut.get()), NULL ); + writeCallback, closeCallback, static_cast<void*>(xOut.get()), nullptr ); xmlTextWriterPtr writer = xmlNewTextWriter( outBuffer ); xmlTextWriterSetIndent(writer, 1); - xmlTextWriterStartDocument( writer, NULL, NULL, NULL ); + xmlTextWriterStartDocument( writer, nullptr, nullptr, nullptr ); // TODO This doesn't export the whole XML file, whereas dumpAsXML() does it nicely pLayout->dumpAsXml( writer ); diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index 8936e25ea4a2..5376296e9801 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -94,9 +94,9 @@ const SwContentFrm *SwLayoutFrm::ContainsContent() const pLayLeaf = pLayLeaf->GetNextLayoutLeaf(); if( !IsAnLower( pLayLeaf) ) - return 0; + return nullptr; } while( pLayLeaf ); - return 0; + return nullptr; } /** @@ -151,19 +151,19 @@ const SwFrm *SwLayoutFrm::ContainsAny( const bool _bInvestigateFootnoteForSectio } while( pLayLeaf && pLayLeaf->IsInFootnote() ); } if( !IsAnLower( pLayLeaf) ) - return 0; + return nullptr; } while( pLayLeaf ); - return 0; + return nullptr; } const SwFrm* SwFrm::GetLower() const { - return IsLayoutFrm() ? static_cast<const SwLayoutFrm*>(this)->Lower() : 0; + return IsLayoutFrm() ? static_cast<const SwLayoutFrm*>(this)->Lower() : nullptr; } SwFrm* SwFrm::GetLower() { - return IsLayoutFrm() ? static_cast<SwLayoutFrm*>(this)->Lower() : 0; + return IsLayoutFrm() ? static_cast<SwLayoutFrm*>(this)->Lower() : nullptr; } SwContentFrm* SwFrm::FindPrevCnt( const bool _bInSameFootnote ) @@ -264,7 +264,7 @@ bool SwLayoutFrm::IsBefore( const SwLayoutFrm* _pCheckRefLayFrm ) const { pUpNext = static_cast<const SwLayoutFrm*>(pUpNext->GetNext()); } - bReturn = pUpNext != 0; + bReturn = pUpNext != nullptr; } } @@ -275,7 +275,7 @@ bool SwLayoutFrm::IsBefore( const SwLayoutFrm* _pCheckRefLayFrm ) const static const SwFrm* lcl_FindLayoutFrame( const SwFrm* pFrm, bool bNext ) { - const SwFrm* pRet = 0; + const SwFrm* pRet = nullptr; if ( pFrm->IsFlyFrm() ) pRet = bNext ? static_cast<const SwFlyFrm*>(pFrm)->GetNextLink() : static_cast<const SwFlyFrm*>(pFrm)->GetPrevLink(); else @@ -287,7 +287,7 @@ static const SwFrm* lcl_FindLayoutFrame( const SwFrm* pFrm, bool bNext ) static const SwFrm* lcl_GetLower( const SwFrm* pFrm, bool bFwd ) { if ( !pFrm->IsLayoutFrm() ) - return 0; + return nullptr; return bFwd ? static_cast<const SwLayoutFrm*>(pFrm)->Lower() : @@ -304,29 +304,29 @@ static const SwFrm* lcl_GetLower( const SwFrm* pFrm, bool bFwd ) const SwLayoutFrm *SwFrm::ImplGetNextLayoutLeaf( bool bFwd ) const { const SwFrm *pFrm = this; - const SwLayoutFrm *pLayoutFrm = 0; - const SwFrm *p = 0; + const SwLayoutFrm *pLayoutFrm = nullptr; + const SwFrm *p = nullptr; bool bGoingUp = !bFwd; // false for forward, true for backward do { bool bGoingFwdOrBwd = false; - bool bGoingDown = ( !bGoingUp && ( 0 != (p = lcl_GetLower( pFrm, bFwd ) ) ) ); + bool bGoingDown = ( !bGoingUp && ( nullptr != (p = lcl_GetLower( pFrm, bFwd ) ) ) ); if ( !bGoingDown ) { // I cannot go down, because either I'm currently going up or // because the is no lower. // I'll try to go forward: - bGoingFwdOrBwd = (0 != (p = lcl_FindLayoutFrame( pFrm, bFwd ) ) ); + bGoingFwdOrBwd = (nullptr != (p = lcl_FindLayoutFrame( pFrm, bFwd ) ) ); if ( !bGoingFwdOrBwd ) { // I cannot go forward, because there is no next frame. // I'll try to go up: - bGoingUp = (0 != (p = pFrm->GetUpper() ) ); + bGoingUp = (nullptr != (p = pFrm->GetUpper() ) ); if ( !bGoingUp ) { // I cannot go up, because there is no upper frame. - return 0; + return nullptr; } } } @@ -339,7 +339,7 @@ const SwLayoutFrm *SwFrm::ImplGetNextLayoutLeaf( bool bFwd ) const } while( ( p && !p->IsFlowFrm() ) || pFrm == this || - 0 == ( pLayoutFrm = pFrm->IsLayoutFrm() ? static_cast<const SwLayoutFrm*>(pFrm) : 0 ) || + nullptr == ( pLayoutFrm = pFrm->IsLayoutFrm() ? static_cast<const SwLayoutFrm*>(pFrm) : nullptr ) || pLayoutFrm->IsAnLower( this ) ); return pLayoutFrm; @@ -358,22 +358,22 @@ const SwLayoutFrm *SwFrm::ImplGetNextLayoutLeaf( bool bFwd ) const const SwContentFrm* SwContentFrm::ImplGetNextContentFrm( bool bFwd ) const { const SwFrm *pFrm = this; - const SwContentFrm *pContentFrm = 0; + const SwContentFrm *pContentFrm = nullptr; bool bGoingUp = false; do { - const SwFrm *p = 0; + const SwFrm *p = nullptr; bool bGoingFwdOrBwd = false; - bool bGoingDown = ( !bGoingUp && ( 0 != ( p = lcl_GetLower( pFrm, true ) ) ) ); + bool bGoingDown = ( !bGoingUp && ( nullptr != ( p = lcl_GetLower( pFrm, true ) ) ) ); if ( !bGoingDown ) { - bGoingFwdOrBwd = ( 0 != ( p = lcl_FindLayoutFrame( pFrm, bFwd ) ) ); + bGoingFwdOrBwd = ( nullptr != ( p = lcl_FindLayoutFrame( pFrm, bFwd ) ) ); if ( !bGoingFwdOrBwd ) { - bGoingUp = ( 0 != ( p = pFrm->GetUpper() ) ); + bGoingUp = ( nullptr != ( p = pFrm->GetUpper() ) ); if ( !bGoingUp ) { - return 0; + return nullptr; } } } @@ -388,7 +388,7 @@ const SwContentFrm* SwContentFrm::ImplGetNextContentFrm( bool bFwd ) const } pFrm = p; - } while ( 0 == (pContentFrm = (pFrm->IsContentFrm() ? static_cast<const SwContentFrm*>(pFrm) : 0) )); + } while ( nullptr == (pContentFrm = (pFrm->IsContentFrm() ? static_cast<const SwContentFrm*>(pFrm) : nullptr) )); return pContentFrm; } @@ -434,7 +434,7 @@ SwFootnoteBossFrm* SwFrm::FindFootnoteBossFrm( bool bFootnotes ) pRet = static_cast<SwFlyFrm*>(pRet)->AnchorFrm(); } else - return 0; + return nullptr; } if( bFootnotes && pRet && pRet->IsColumnFrm() && !pRet->GetNext() && !pRet->GetPrev() ) @@ -454,7 +454,7 @@ SwTabFrm* SwFrm::ImplFindTabFrm() { pRet = pRet->GetUpper(); if ( !pRet ) - return 0; + return nullptr; } return static_cast<SwTabFrm*>(pRet); } @@ -466,7 +466,7 @@ SwSectionFrm* SwFrm::ImplFindSctFrm() { pRet = pRet->GetUpper(); if ( !pRet ) - return 0; + return nullptr; } return static_cast<SwSectionFrm*>(pRet); } @@ -478,7 +478,7 @@ SwFootnoteFrm *SwFrm::ImplFindFootnoteFrm() { pRet = pRet->GetUpper(); if ( !pRet ) - return 0; + return nullptr; } return static_cast<SwFootnoteFrm*>(pRet); } @@ -493,7 +493,7 @@ SwFlyFrm *SwFrm::ImplFindFlyFrm() else pRet = pRet->GetUpper(); } while ( pRet ); - return 0; + return nullptr; } SwFrm *SwFrm::FindColFrm() @@ -526,7 +526,7 @@ SwFrm* SwFrm::FindFooterOrHeader() else if ( pRet->IsFlyFrm() ) pRet = static_cast<SwFlyFrm*>(pRet)->AnchorFrm(); else - return 0; + return nullptr; } while ( pRet ); return pRet; } @@ -536,12 +536,12 @@ const SwFootnoteFrm* SwFootnoteContFrm::FindFootNote() const const SwFootnoteFrm* pRet = static_cast<const SwFootnoteFrm*>(Lower()); if( pRet && !pRet->GetAttr()->GetFootnote().IsEndNote() ) return pRet; - return NULL; + return nullptr; } const SwPageFrm* SwRootFrm::GetPageAtPos( const Point& rPt, const Size* pSize, bool bExtend ) const { - const SwPageFrm* pRet = 0; + const SwPageFrm* pRet = nullptr; SwRect aRect; if ( pSize ) @@ -555,7 +555,7 @@ const SwPageFrm* SwRootFrm::GetPageAtPos( const Point& rPt, const Size* pSize, b if ( !bExtend ) { if( !Frm().IsInside( rPt ) ) - return 0; + return nullptr; // skip pages above point: while( pPage && rPt.Y() > pPage->Frm().Bottom() ) @@ -674,30 +674,30 @@ bool SwFrm::supportsFullDrawingLayerFillAttributeSet() const // besides ContentFrames this function also returns TabFrms and SectionFrms. static SwFrm* lcl_NextFrm( SwFrm* pFrm ) { - SwFrm *pRet = 0; + SwFrm *pRet = nullptr; bool bGoingUp = false; do { - SwFrm *p = 0; + SwFrm *p = nullptr; bool bGoingFwd = false; - bool bGoingDown = (!bGoingUp && ( 0 != (p = pFrm->IsLayoutFrm() ? static_cast<SwLayoutFrm*>(pFrm)->Lower() : 0))); + bool bGoingDown = (!bGoingUp && ( nullptr != (p = pFrm->IsLayoutFrm() ? static_cast<SwLayoutFrm*>(pFrm)->Lower() : nullptr))); if( !bGoingDown ) { - bGoingFwd = (0 != (p = ( pFrm->IsFlyFrm() ? static_cast<SwFlyFrm*>(pFrm)->GetNextLink() : pFrm->GetNext()))); + bGoingFwd = (nullptr != (p = ( pFrm->IsFlyFrm() ? static_cast<SwFlyFrm*>(pFrm)->GetNextLink() : pFrm->GetNext()))); if ( !bGoingFwd ) { - bGoingUp = (0 != (p = pFrm->GetUpper())); + bGoingUp = (nullptr != (p = pFrm->GetUpper())); if ( !bGoingUp ) { - return 0; + return nullptr; } } } bGoingUp = !(bGoingFwd || bGoingDown); pFrm = p; - } while ( 0 == (pRet = ( ( pFrm->IsContentFrm() || ( !bGoingUp && - ( pFrm->IsTabFrm() || pFrm->IsSctFrm() ) ) )? pFrm : 0 ) ) ); + } while ( nullptr == (pRet = ( ( pFrm->IsContentFrm() || ( !bGoingUp && + ( pFrm->IsTabFrm() || pFrm->IsSctFrm() ) ) )? pFrm : nullptr ) ) ); return pRet; } @@ -739,12 +739,12 @@ SwFrm *SwFrm::_FindNext() SwFrm* pMyUpper = GetUpper(); if ( pMyUpper->IsTabFrm() && static_cast<SwTabFrm*>(pMyUpper)->GetFollow() ) return static_cast<SwTabFrm*>(pMyUpper)->GetFollow()->GetLower(); - else return NULL; + else return nullptr; } else - return NULL; + return nullptr; - SwFrm* pRet = NULL; + SwFrm* pRet = nullptr; const bool bFootnote = pThis->IsInFootnote(); if ( !bIgnoreTab && pThis->IsInTab() ) { @@ -752,7 +752,7 @@ SwFrm *SwFrm::_FindNext() while (pUp && !pUp->IsCellFrm()) pUp = pUp->GetUpper(); SAL_WARN_IF(!pUp, "sw.core", "Content in table but not in cell."); - SwFrm* pNxt = pUp ? static_cast<SwCellFrm*>(pUp)->GetFollowCell() : NULL; + SwFrm* pNxt = pUp ? static_cast<SwCellFrm*>(pUp)->GetFollowCell() : nullptr; if ( pNxt ) pNxt = static_cast<SwCellFrm*>(pNxt)->ContainsContent(); if ( !pNxt ) @@ -846,7 +846,7 @@ SwContentFrm *SwFrm::_FindNextCnt( const bool _bInSameFootnote ) } pThis = static_cast<SwTabFrm*>(this)->FindLastContent(); if ( !pThis ) - return 0; + return nullptr; } else if ( IsSctFrm() ) { @@ -858,7 +858,7 @@ SwContentFrm *SwFrm::_FindNextCnt( const bool _bInSameFootnote ) } pThis = static_cast<SwSectionFrm*>(this)->FindLastContent(); if ( !pThis ) - return 0; + return nullptr; } else if ( IsContentFrm() && static_cast<SwContentFrm*>(this)->GetFollow() ) return static_cast<SwContentFrm*>(this)->GetFollow(); @@ -901,7 +901,7 @@ SwContentFrm *SwFrm::_FindNextCnt( const bool _bInSameFootnote ) // in the follow footnote, which contains a content frame. SwFootnoteFrm* pFollowFootnoteFrmOfCurr( const_cast<SwFootnoteFrm*>(pFootnoteFrmOfCurr) ); - pNxtCnt = 0L; + pNxtCnt = nullptr; do { pFollowFootnoteFrmOfCurr = pFollowFootnoteFrmOfCurr->GetFollow(); pNxtCnt = pFollowFootnoteFrmOfCurr->ContainsContent(); @@ -912,7 +912,7 @@ SwContentFrm *SwFrm::_FindNextCnt( const bool _bInSameFootnote ) { // current content frame is the last content frame in the // footnote - no next content frame exists. - return 0L; + return nullptr; } } else if ( pThis->IsInFly() ) @@ -935,7 +935,7 @@ SwContentFrm *SwFrm::_FindNextCnt( const bool _bInSameFootnote ) } } } - return 0; + return nullptr; } /** method to determine previous content frame in the same environment @@ -948,10 +948,10 @@ SwContentFrm* SwFrm::_FindPrevCnt( const bool _bInSameFootnote ) if ( !IsFlowFrm() ) { // nothing to do, if current frame isn't a flow frame. - return 0L; + return nullptr; } - SwContentFrm* pPrevContentFrm( 0L ); + SwContentFrm* pPrevContentFrm( nullptr ); // Because method <SwContentFrm::GetPrevContentFrm()> is used to travel // through the layout, a content frame, at which the travel starts, is needed. @@ -1039,7 +1039,7 @@ SwContentFrm* SwFrm::_FindPrevCnt( const bool _bInSameFootnote ) { SwFootnoteFrm* pMasterFootnoteFrmOfCurr( const_cast<SwFootnoteFrm*>(pFootnoteFrmOfCurr) ); - pPrevContentFrm = 0L; + pPrevContentFrm = nullptr; // correct wrong loop-condition do { pMasterFootnoteFrmOfCurr = pMasterFootnoteFrmOfCurr->GetMaster(); @@ -1051,7 +1051,7 @@ SwContentFrm* SwFrm::_FindPrevCnt( const bool _bInSameFootnote ) { // current content frame is the first content in the // footnote - no previous content exists. - pPrevContentFrm = 0L; + pPrevContentFrm = nullptr; } } } @@ -1072,7 +1072,7 @@ SwContentFrm* SwFrm::_FindPrevCnt( const bool _bInSameFootnote ) if ( pPrevContentFrm->FindFooterOrHeader() != pCurrContentFrm->FindFooterOrHeader() ) { - pPrevContentFrm = 0L; + pPrevContentFrm = nullptr; } } } @@ -1103,7 +1103,7 @@ SwFrm *SwFrm::_FindPrev() { SwContentFrm *pPrvCnt = static_cast<SwContentFrm*>(pThis)->GetPrevContentFrm(); if( !pPrvCnt ) - return 0; + return nullptr; if ( !bIgnoreTab && pThis->IsInTab() ) { SwLayoutFrm *pUp = pThis->GetUpper(); @@ -1156,13 +1156,13 @@ SwFrm *SwFrm::_FindPrev() } } } - return 0; + return nullptr; } void SwFrm::ImplInvalidateNextPos( bool bNoFootnote ) { SwFrm *pFrm; - if ( 0 != (pFrm = _FindNext()) ) + if ( nullptr != (pFrm = _FindNext()) ) { if( pFrm->IsSctFrm() ) { @@ -1433,7 +1433,7 @@ SwLayoutFrm* SwFrm::GetNextCellLeaf( MakePageType ) pTmpFrm = pTmpFrm->GetUpper(); SAL_WARN_IF(!pTmpFrm, "sw.core", "SwFrm::GetNextCellLeaf() without cell"); - return pTmpFrm ? static_cast<SwCellFrm*>(pTmpFrm)->GetFollowCell() : NULL; + return pTmpFrm ? static_cast<SwCellFrm*>(pTmpFrm)->GetFollowCell() : nullptr; } SwLayoutFrm* SwFrm::GetPrevCellLeaf( MakePageType ) @@ -1451,7 +1451,7 @@ static SwCellFrm* lcl_FindCorrespondingCellFrm( const SwRowFrm& rOrigRow, const SwRowFrm& rCorrRow, bool bInFollow ) { - SwCellFrm* pRet = NULL; + SwCellFrm* pRet = nullptr; const SwCellFrm* pCell = static_cast<const SwCellFrm*>(rOrigRow.Lower()); SwCellFrm* pCorrCell = const_cast<SwCellFrm*>(static_cast<const SwCellFrm*>(rCorrRow.Lower())); @@ -1473,7 +1473,7 @@ static SwCellFrm* lcl_FindCorrespondingCellFrm( const SwRowFrm& rOrigRow, while ( !pRow->IsAnLower( &rOrigCell ) ) pRow = static_cast<const SwRowFrm*>(pRow->GetNext()); - SwRowFrm* pCorrRow = 0; + SwRowFrm* pCorrRow = nullptr; if ( bInFollow ) pCorrRow = pRow->GetFollowRow(); else @@ -1496,13 +1496,13 @@ static SwCellFrm* lcl_FindCorrespondingCellFrm( const SwRowFrm& rOrigRow, // VERSION OF GetFollowCell() that assumes that we always have a follow flow line: SwCellFrm* SwCellFrm::GetFollowCell() const { - SwCellFrm* pRet = NULL; + SwCellFrm* pRet = nullptr; // NEW TABLES // Covered cells do not have follow cells! const long nRowSpan = GetLayoutRowSpan(); if ( nRowSpan < 1 ) - return NULL; + return nullptr; // find most upper row frame const SwFrm* pRow = GetUpper(); @@ -1511,11 +1511,11 @@ SwCellFrm* SwCellFrm::GetFollowCell() const pRow = pRow->GetUpper(); if (!pRow) - return NULL; + return nullptr; const SwTabFrm* pTabFrm = static_cast<const SwTabFrm*>(pRow->GetUpper()); if (!pTabFrm || !pTabFrm->GetFollow() || !pTabFrm->HasFollowFlowLine()) - return NULL; + return nullptr; const SwCellFrm* pThisCell = this; @@ -1534,9 +1534,9 @@ SwCellFrm* SwCellFrm::GetFollowCell() const } } - const SwRowFrm* pFollowRow = NULL; + const SwRowFrm* pFollowRow = nullptr; if ( !pRow->GetNext() && - NULL != ( pFollowRow = pRow->IsInSplitTableRow() ) && + nullptr != ( pFollowRow = pRow->IsInSplitTableRow() ) && ( !pFollowRow->IsRowSpanLine() || nRowSpan > 1 ) ) pRet = lcl_FindCorrespondingCellFrm( *static_cast<const SwRowFrm*>(pRow), *pThisCell, *pFollowRow, true ); @@ -1546,12 +1546,12 @@ SwCellFrm* SwCellFrm::GetFollowCell() const // VERSION OF GetPreviousCell() THAT ASSUMES THAT WE ALWAYS HAVE A FFL SwCellFrm* SwCellFrm::GetPreviousCell() const { - SwCellFrm* pRet = NULL; + SwCellFrm* pRet = nullptr; // NEW TABLES // Covered cells do not have previous cells! if ( GetLayoutRowSpan() < 1 ) - return NULL; + return nullptr; // find most upper row frame const SwFrm* pRow = GetUpper(); @@ -1587,7 +1587,7 @@ SwCellFrm* SwCellFrm::GetPreviousCell() const // --> NEW TABLES const SwCellFrm& SwCellFrm::FindStartEndOfRowSpanCell( bool bStart, bool bCurrentTableOnly ) const { - const SwCellFrm* pRet = 0; + const SwCellFrm* pRet = nullptr; const SwTabFrm* pTableFrm = dynamic_cast<const SwTabFrm*>(GetUpper()->GetUpper()); @@ -1684,7 +1684,7 @@ const SwRowFrm* SwFrm::IsInSplitTableRow() const while( pRow && ( !pRow->IsRowFrm() || !pRow->GetUpper()->IsTabFrm() ) ) pRow = pRow->GetUpper(); - if ( !pRow ) return NULL; + if ( !pRow ) return nullptr; OSL_ENSURE( pRow->GetUpper()->IsTabFrm(), "Confusion in table layout" ); @@ -1697,7 +1697,7 @@ const SwRowFrm* SwFrm::IsInSplitTableRow() const *(static_cast<const SwRowFrm*>(pRow)->GetTabLine()) ) || !pTab->HasFollowFlowLine() || !pTab->GetFollow() ) - return NULL; + return nullptr; // skip headline const SwRowFrm* pFollowRow = pTab->GetFollow()->GetFirstNonHeadlineRow(); @@ -1716,22 +1716,22 @@ const SwRowFrm* SwFrm::IsInFollowFlowRow() const while( pRow && ( !pRow->IsRowFrm() || !pRow->GetUpper()->IsTabFrm() ) ) pRow = pRow->GetUpper(); - if ( !pRow ) return NULL; + if ( !pRow ) return nullptr; OSL_ENSURE( pRow->GetUpper()->IsTabFrm(), "Confusion in table layout" ); const SwTabFrm* pTab = static_cast<const SwTabFrm*>(pRow->GetUpper()); - const SwTabFrm* pMaster = pTab->IsFollow() ? pTab->FindMaster() : 0; + const SwTabFrm* pMaster = pTab->IsFollow() ? pTab->FindMaster() : nullptr; if ( !pMaster || !pMaster->HasFollowFlowLine() ) - return NULL; + return nullptr; const SwFrm* pTmp = pTab->GetFirstNonHeadlineRow(); const bool bIsInFirstLine = ( pTmp == pRow ); if ( !bIsInFirstLine ) - return NULL; + return nullptr; const SwRowFrm* pMasterRow = static_cast<const SwRowFrm*>(pMaster->GetLastLower()); return pMasterRow; @@ -1754,7 +1754,7 @@ const SwFrm* SwLayoutFrm::GetLastLower() const { const SwFrm* pRet = Lower(); if ( !pRet ) - return 0; + return nullptr; while ( pRet->GetNext() ) pRet = pRet->GetNext(); return pRet; diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index e6f224bebbb9..65b9f03923ab 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -61,8 +61,8 @@ bool SwFlowFrm::m_bMoveBwdJump = false; SwFlowFrm::SwFlowFrm( SwFrm &rFrm ) : m_rThis( rFrm ), - m_pFollow( 0 ), - m_pPrecede( 0 ), + m_pFollow( nullptr ), + m_pPrecede( nullptr ), m_bLockJoin( false ), m_bUndersized( false ), m_bFlyLock( false ) @@ -72,11 +72,11 @@ SwFlowFrm::~SwFlowFrm() { if (m_pFollow) { - m_pFollow->m_pPrecede = 0; + m_pFollow->m_pPrecede = nullptr; } if (m_pPrecede) { - m_pPrecede->m_pFollow = 0; + m_pPrecede->m_pFollow = nullptr; } } @@ -85,15 +85,15 @@ void SwFlowFrm::SetFollow(SwFlowFrm *const pFollow) if (m_pFollow) { assert(this == m_pFollow->m_pPrecede); - m_pFollow->m_pPrecede = 0; + m_pFollow->m_pPrecede = nullptr; } m_pFollow = pFollow; - if (m_pFollow != NULL) + if (m_pFollow != nullptr) { if (m_pFollow->m_pPrecede) // re-chaining pFollow? { assert(m_pFollow == m_pFollow->m_pPrecede->m_pFollow); - m_pFollow->m_pPrecede->m_pFollow = 0; + m_pFollow->m_pPrecede->m_pFollow = nullptr; } m_pFollow->m_pPrecede = this; } @@ -149,7 +149,7 @@ void SwFlowFrm::CheckKeep() SwFrm* pTmp; bool bKeep; while ( (bKeep = pPre->GetAttrSet()->GetKeep().GetValue()) && - 0 != ( pTmp = pPre->GetIndPrev() ) ) + nullptr != ( pTmp = pPre->GetIndPrev() ) ) { if( pTmp->IsSctFrm() ) { @@ -198,15 +198,15 @@ bool SwFlowFrm::IsKeep( const SwAttrSet& rAttrs, bool bCheckIfLastRowShouldKeep if ( bKeep ) { SwFrm *pNxt; - if( 0 != (pNxt = m_rThis.FindNextCnt()) && + if( nullptr != (pNxt = m_rThis.FindNextCnt()) && (!m_pFollow || pNxt != &m_pFollow->GetFrm())) { // The last row of a table only keeps with the next content // it they are in the same section: if ( bCheckIfLastRowShouldKeep ) { - const SwSection* pThisSection = 0; - const SwSection* pNextSection = 0; + const SwSection* pThisSection = nullptr; + const SwSection* pNextSection = nullptr; const SwSectionFrm* pThisSectionFrm = m_rThis.FindSctFrm(); const SwSectionFrm* pNextSectionFrm = pNxt->FindSctFrm(); @@ -222,7 +222,7 @@ bool SwFlowFrm::IsKeep( const SwAttrSet& rAttrs, bool bCheckIfLastRowShouldKeep if ( bKeep ) { - const SwAttrSet* pSet = NULL; + const SwAttrSet* pSet = nullptr; if ( pNxt->IsInTab() ) { @@ -387,8 +387,8 @@ SwLayoutFrm *SwFlowFrm::CutTree( SwFrm *pStart ) pStart->GetUpper()->m_pLower = nullptr; if ( pStart->GetPrev() ) { - pStart->GetPrev()->mpNext = 0; - pStart->mpPrev = 0; + pStart->GetPrev()->mpNext = nullptr; + pStart->mpPrev = nullptr; } if ( pLay->IsFootnoteFrm() ) @@ -421,7 +421,7 @@ SwLayoutFrm *SwFlowFrm::CutTree( SwFrm *pStart ) if( bUnlock ) static_cast<SwFootnoteFrm*>(pLay)->UnlockBackMove(); } - pLay = 0; + pLay = nullptr; } return pLay; } @@ -442,7 +442,7 @@ bool SwFlowFrm::PasteTree( SwFrm *pStart, SwLayoutFrm *pParent, SwFrm *pSibling, // On the way there, we invalidate as required. if ( pSibling ) { - if ( 0 != (pStart->mpPrev = pSibling->GetPrev()) ) + if ( nullptr != (pStart->mpPrev = pSibling->GetPrev()) ) pStart->GetPrev()->mpNext = pStart; else pParent->m_pLower = pStart; @@ -451,7 +451,7 @@ bool SwFlowFrm::PasteTree( SwFrm *pStart, SwLayoutFrm *pParent, SwFrm *pSibling, } else { - if ( 0 == (pStart->mpPrev = pParent->Lower()) ) + if ( nullptr == (pStart->mpPrev = pParent->Lower()) ) pParent->m_pLower = pStart; else //Modified for #i100782#,04/03/2009 @@ -489,7 +489,7 @@ bool SwFlowFrm::PasteTree( SwFrm *pStart, SwLayoutFrm *pParent, SwFrm *pSibling, } } SwFrm *pFloat = pStart; - SwFrm *pLst = 0; + SwFrm *pLst = nullptr; SWRECTFN( pParent ) SwTwips nGrowVal = 0; do @@ -513,7 +513,7 @@ bool SwFlowFrm::PasteTree( SwFrm *pStart, SwLayoutFrm *pParent, SwFrm *pSibling, else { pLst = pFloat; - pFloat = 0; + pFloat = nullptr; } } while ( pFloat ); @@ -548,7 +548,7 @@ void SwFlowFrm::MoveSubTree( SwLayoutFrm* pParent, SwFrm* pSibling ) // Be economical with notifications if an action is running. SwViewShell *pSh = m_rThis.getRootFrm()->GetCurrShell(); - const SwViewShellImp *pImp = pSh ? pSh->Imp() : 0; + const SwViewShellImp *pImp = pSh ? pSh->Imp() : nullptr; const bool bComplete = pImp && pImp->IsAction() && pImp->GetLayAction().IsComplete(); if ( !bComplete ) @@ -657,7 +657,7 @@ SwTextFrm* SwContentFrm::FindMaster() const } OSL_FAIL( "Follow ist lost in Space." ); - return 0; + return nullptr; } SwSectionFrm* SwSectionFrm::FindMaster() const @@ -715,7 +715,7 @@ SwTabFrm* SwTabFrm::FindMaster( bool bFirstMaster ) const } OSL_FAIL( "Follow ist lost in Space." ); - return 0; + return nullptr; } /** @@ -727,7 +727,7 @@ const SwLayoutFrm *SwFrm::GetLeaf( MakePageType eMakePage, bool bFwd, { // No flow, no joy... if ( !(IsInDocBody() || IsInFootnote() || IsInFly()) ) - return 0; + return nullptr; const SwFrm *pLeaf = this; bool bFound = false; @@ -816,7 +816,7 @@ bool SwFrm::WrongPageDesc( SwPageFrm* pNew ) const SwFormatPageDesc &rFormatDesc = GetAttrSet()->GetPageDesc(); //My Pagedesc doesn't count if I'm a follow! - SwPageDesc *pDesc = 0; + SwPageDesc *pDesc = nullptr; int nTmp = 0; SwFlowFrm *pFlow = SwFlowFrm::CastFlowFrm( this ); if ( !pFlow || !pFlow->IsFollow() ) @@ -845,11 +845,11 @@ bool SwFrm::WrongPageDesc( SwPageFrm* pNew ) const SwFlowFrm *pNewFlow = pNew->FindFirstBodyContent(); // Did we find ourselves? if( pNewFlow == pFlow ) - pNewFlow = NULL; + pNewFlow = nullptr; if ( pNewFlow && pNewFlow->GetFrm().IsInTab() ) pNewFlow = pNewFlow->GetFrm().FindTabFrm(); const SwPageDesc *pNewDesc= ( pNewFlow && !pNewFlow->IsFollow() ) - ? pNewFlow->GetFrm().GetAttrSet()->GetPageDesc().GetPageDesc() : 0; + ? pNewFlow->GetFrm().GetAttrSet()->GetPageDesc().GetPageDesc() : nullptr; return (pNew->GetPageDesc() != pDesc) // own desc ? || (pNew->GetFormat() != @@ -873,7 +873,7 @@ SwLayoutFrm *SwFrm::GetNextLeaf( MakePageType eMakePage ) // For tables, we just take the big leap. A simple GetNext would // iterate through the first cells and, in turn, all other cells. - SwLayoutFrm *pLayLeaf = 0; + SwLayoutFrm *pLayLeaf = nullptr; if ( IsTabFrm() ) { SwContentFrm* pTmp = static_cast<SwTabFrm*>(this)->FindLastContent(); @@ -883,7 +883,7 @@ SwLayoutFrm *SwFrm::GetNextLeaf( MakePageType eMakePage ) if ( !pLayLeaf ) pLayLeaf = GetNextLayoutLeaf(); - SwLayoutFrm *pOldLayLeaf = 0; // Make sure that we don't have to + SwLayoutFrm *pOldLayLeaf = nullptr; // Make sure that we don't have to // start searching from top when we // have a freshly created page. bool bNewPg = false; // Only insert a new page once. @@ -898,7 +898,7 @@ SwLayoutFrm *SwFrm::GetNextLeaf( MakePageType eMakePage ) // (DocBody or Footnote respectively) if ( pLayLeaf->FindPageFrm()->IsFootnotePage() ) { // If I ended up at the end note pages, we're done. - pLayLeaf = 0; + pLayLeaf = nullptr; continue; } if ( (bBody && !pLayLeaf->IsInDocBody()) || pLayLeaf->IsInTab() @@ -950,7 +950,7 @@ SwLayoutFrm *SwFrm::GetNextLeaf( MakePageType eMakePage ) bNewPg = true; SwPageFrm *pPg = pOldLayLeaf ? - pOldLayLeaf->FindPageFrm() : 0; + pOldLayLeaf->FindPageFrm() : nullptr; if ( pPg && pPg->IsEmptyPage() ) // Don't insert behind. Insert before the EmptyPage. pPg = static_cast<SwPageFrm*>(pPg->GetPrev()); @@ -960,11 +960,11 @@ SwLayoutFrm *SwFrm::GetNextLeaf( MakePageType eMakePage ) InsertPage( pPg, false ); pLayLeaf = GetNextLayoutLeaf(); - pOldLayLeaf = 0; + pOldLayLeaf = nullptr; continue; } else - pLayLeaf = 0; + pLayLeaf = nullptr; } } break; @@ -999,7 +999,7 @@ SwLayoutFrm *SwFrm::GetPrevLeaf( MakePageType ) const bool bFly = IsInFly(); SwLayoutFrm *pLayLeaf = GetPrevLayoutLeaf(); - SwLayoutFrm *pPrevLeaf = 0; + SwLayoutFrm *pPrevLeaf = nullptr; while ( pLayLeaf ) { @@ -1310,7 +1310,7 @@ const SwFrm* SwFlowFrm::_GetPrevFrmForUpperSpaceCalc( const SwFrm* _pProposedPre /// Compare styles attached to these text frames. static bool lcl_IdenticalStyles(const SwFrm* pPrevFrm, const SwFrm* pFrm) { - SwTextFormatColl *pPrevFormatColl = 0; + SwTextFormatColl *pPrevFormatColl = nullptr; if (pPrevFrm && pPrevFrm->IsTextFrm()) { const SwTextFrm *pTextFrm = static_cast< const SwTextFrm * >( pPrevFrm ); @@ -1355,7 +1355,7 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs, SwSectionFrm* pFoll = &static_cast<SwSectionFrm&>(m_rThis); do pOwn = pFoll->ContainsAny(); - while( !pOwn && 0 != ( pFoll = pFoll->GetFollow() ) ); + while( !pOwn && nullptr != ( pFoll = pFoll->GetFollow() ) ); if( !pOwn ) return 0; } @@ -1484,7 +1484,7 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs, // OD 2004-02-26 #i25029# - pass previous frame <pPrevFrm> // to method <GetTopLine(..)>, if parameter <pPr> is set. // Note: parameter <pPr> is set, if method is called from <SwTextFrm::WouldFit(..)> - nUpper += pAttrs->GetTopLine( m_rThis, (pPr ? pPrevFrm : 0L) ); + nUpper += pAttrs->GetTopLine( m_rThis, (pPr ? pPrevFrm : nullptr) ); // OD 2004-03-12 #i11860# - consider value of new parameter <_bConsiderGrid> // and use new method <GetUpperSpaceAmountConsideredForPageGrid(..)> @@ -1611,7 +1611,7 @@ SwTwips SwFlowFrm::GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() const nUpperSpaceAmountConsideredForPrevFrmAndPageGrid = _GetUpperSpaceAmountConsideredForPrevFrm() + ( m_rThis.GetUpper()->GetFormat()->GetDoc()->IsSquaredPageMode() - ? _GetUpperSpaceAmountConsideredForPageGrid( CalcUpperSpace( 0, 0, false ) ) + ? _GetUpperSpaceAmountConsideredForPageGrid( CalcUpperSpace( nullptr, nullptr, false ) ) : 0 ); } @@ -1705,17 +1705,17 @@ bool SwFlowFrm::CheckMoveFwd( bool& rbMakePage, bool bKeep, bool ) if ( bKeep && //!bMovedBwd && ( !pNxt || ( pNxt->IsTextFrm() && static_cast<const SwTextFrm*>(pNxt)->IsEmptyMaster() ) ) && - ( 0 != (pNxt = m_rThis.FindNext()) ) && IsKeepFwdMoveAllowed() ) + ( nullptr != (pNxt = m_rThis.FindNext()) ) && IsKeepFwdMoveAllowed() ) { if( pNxt->IsSctFrm() ) { // Don't get fooled by empty SectionFrms - const SwFrm* pTmp = NULL; + const SwFrm* pTmp = nullptr; while( pNxt && pNxt->IsSctFrm() && ( !static_cast<const SwSectionFrm*>(pNxt)->GetSection() || - 0 == ( pTmp = static_cast<const SwSectionFrm*>(pNxt)->ContainsAny() ) ) ) + nullptr == ( pTmp = static_cast<const SwSectionFrm*>(pNxt)->ContainsAny() ) ) ) { pNxt = pNxt->FindNext(); - pTmp = NULL; + pTmp = nullptr; } if( pTmp ) pNxt = pTmp; // the content of the next notempty sectionfrm @@ -1813,7 +1813,7 @@ bool SwFlowFrm::MoveFwd( bool bMakePage, bool bPageBreak, bool bMoveAlways ) ( !m_rThis.IsTabFrm() || ( m_rThis.GetUpper()->IsInTab() && m_rThis.GetUpper()->FindTabFrm()->IsFwdMoveAllowed() ) ) && - 0 != const_cast<SwFrm&>(m_rThis).GetNextCellLeaf( MAKEPAGE_NONE ) ) + nullptr != const_cast<SwFrm&>(m_rThis).GetNextCellLeaf( MAKEPAGE_NONE ) ) { bNoFwd = false; } @@ -1837,7 +1837,7 @@ bool SwFlowFrm::MoveFwd( bool bMakePage, bool bPageBreak, bool bMoveAlways ) if ( pNewUpper ) { - PROTOCOL_ENTER( &m_rThis, PROT_MOVE_FWD, 0, 0 ); + PROTOCOL_ENTER( &m_rThis, PROT_MOVE_FWD, 0, nullptr ); SwPageFrm *pOldPage = pOldBoss->FindPageFrm(); // We move ourself and all the direct successors before the // first ContentFrm below the new Upper. @@ -1896,7 +1896,7 @@ bool SwFlowFrm::MoveFwd( bool bMakePage, bool bPageBreak, bool bMoveAlways ) OSL_ENSURE( pStart || ( m_rThis.IsTabFrm() && !static_cast<SwTabFrm&>(m_rThis).Lower() ), "MoveFwd: Missing Content" ); SwLayoutFrm* pBody = pStart ? ( pStart->IsTextFrm() ? - const_cast<SwBodyFrm *>(static_cast<SwTextFrm*>(pStart)->FindBodyFrm()) : 0 ) : 0; + const_cast<SwBodyFrm *>(static_cast<SwTextFrm*>(pStart)->FindBodyFrm()) : nullptr ) : nullptr; if( pBody ) bFootnoteMoved = pBody->MoveLowerFootnotes( pStart, pOldBoss, pNewBoss, false); @@ -1908,7 +1908,7 @@ bool SwFlowFrm::MoveFwd( bool bMakePage, bool bPageBreak, bool bMoveAlways ) if( pNewUpper != m_rThis.GetUpper() ) { // #i27145# - SwSectionFrm* pOldSct = 0; + SwSectionFrm* pOldSct = nullptr; if ( m_rThis.GetUpper()->IsSctFrm() ) { pOldSct = static_cast<SwSectionFrm*>(m_rThis.GetUpper()); @@ -1945,7 +1945,7 @@ bool SwFlowFrm::MoveFwd( bool bMakePage, bool bPageBreak, bool bMoveAlways ) if( bBossChg ) { - m_rThis.Prepare( PREP_BOSS_CHGD, 0, false ); + m_rThis.Prepare( PREP_BOSS_CHGD, nullptr, false ); if( !bSamePage ) { SwViewShell *pSh = m_rThis.getRootFrm()->GetCurrShell(); @@ -2011,7 +2011,7 @@ bool SwFlowFrm::MoveBwd( bool &rbReformat ) SwFootnoteBossFrm * pOldBoss = m_rThis.FindFootnoteBossFrm(); SwPageFrm * const pOldPage = pOldBoss->FindPageFrm(); - SwLayoutFrm *pNewUpper = 0; + SwLayoutFrm *pNewUpper = nullptr; bool bCheckPageDescs = false; bool bCheckPageDescOfNextPage = false; @@ -2022,7 +2022,7 @@ bool SwFlowFrm::MoveBwd( bool &rbReformat ) // #i37084# FindLastContent does not necessarily // have to have a result != 0 - SwFrm* pRef = 0; + SwFrm* pRef = nullptr; const bool bEndnote = pFootnote->GetAttr()->GetFootnote().IsEndNote(); if( bEndnote && pFootnote->IsInSct() ) { @@ -2126,7 +2126,7 @@ bool SwFlowFrm::MoveBwd( bool &rbReformat ) !pNewUpper->GetUpper()->GetPrev() ) && !pNewUpper->FindSctFrm()->GetPrev() ) ) ) { - pNewUpper = 0; + pNewUpper = nullptr; } // #i53139# // #i69409# - check <pNewUpper> @@ -2246,7 +2246,7 @@ bool SwFlowFrm::MoveBwd( bool &rbReformat ) if ( bMoveFwdByObjPos && pNewUpper->FindPageFrm()->GetPhyPageNum() < nToPageNum ) { - pNewUpper = 0; + pNewUpper = nullptr; } // #i44049# - check, if one of its anchored objects // has restarted the layout process. @@ -2259,7 +2259,7 @@ bool SwFlowFrm::MoveBwd( bool &rbReformat ) if ( pAnchoredObj->RestartLayoutProcess() && !pAnchoredObj->IsTmpConsiderWrapInfluence() ) { - pNewUpper = 0; + pNewUpper = nullptr; break; } } @@ -2301,10 +2301,10 @@ bool SwFlowFrm::MoveBwd( bool &rbReformat ) pFrm = pFrm->GetNext(); pNewUpper = pFrm->GetLeaf( MAKEPAGE_INSERT, true ); if( pNewUpper == m_rThis.GetUpper() ) // Did we end up in the same place? - pNewUpper = NULL; // If so, moving is not needed. + pNewUpper = nullptr; // If so, moving is not needed. } else - pNewUpper = 0; + pNewUpper = nullptr; } } if ( pNewUpper && !ShouldBwdMoved( pNewUpper, true, rbReformat ) ) @@ -2330,7 +2330,7 @@ bool SwFlowFrm::MoveBwd( bool &rbReformat ) } } } - pNewUpper = 0; + pNewUpper = nullptr; } // OD 2004-05-26 #i21478# - don't move backward, if flow frame wants to @@ -2363,7 +2363,7 @@ bool SwFlowFrm::MoveBwd( bool &rbReformat ) if ( pIndNext && pIndNext->IsFlowFrm() && SwFlowFrm::CastFlowFrm(pIndNext)->IsJoinLocked() ) { - pNewUpper = 0L; + pNewUpper = nullptr; } } } @@ -2387,7 +2387,7 @@ bool SwFlowFrm::MoveBwd( bool &rbReformat ) ( pNextNewUpper == m_rThis.GetUpper() || pNextNewUpper->GetType() != m_rThis.GetUpper()->GetType() ) ) { - pNewUpper = 0L; + pNewUpper = nullptr; OSL_FAIL( "<SwFlowFrm::MoveBwd(..)> - layout loop control for layout action <Move Backward> applied!" ); } } @@ -2396,7 +2396,7 @@ bool SwFlowFrm::MoveBwd( bool &rbReformat ) "<SwFlowFrm::MoveBwd(..)> - moving backward to the current upper frame!?" ); if ( pNewUpper ) { - PROTOCOL_ENTER( &m_rThis, PROT_MOVE_BWD, 0, 0 ); + PROTOCOL_ENTER( &m_rThis, PROT_MOVE_BWD, 0, nullptr ); if ( pNewUpper->IsFootnoteContFrm() ) { // I may have gotten a Container @@ -2427,7 +2427,7 @@ bool SwFlowFrm::MoveBwd( bool &rbReformat ) pTmp = pTmp->GetNext(); if( !pTmp->IsSctFrm() || static_cast<SwSectionFrm*>(pTmp)->GetFollow() != pSct ) - pTmp = NULL; + pTmp = nullptr; } if( pTmp ) pNewUpper = static_cast<SwSectionFrm*>(pTmp); @@ -2507,7 +2507,7 @@ bool SwFlowFrm::MoveBwd( bool &rbReformat ) } } } - return pNewUpper != 0; + return pNewUpper != nullptr; } SwFlowFrm *SwFlowFrm::CastFlowFrm( SwFrm *pFrm ) @@ -2518,7 +2518,7 @@ SwFlowFrm *SwFlowFrm::CastFlowFrm( SwFrm *pFrm ) return static_cast<SwTabFrm*>(pFrm); if ( pFrm->IsSctFrm() ) return static_cast<SwSectionFrm*>(pFrm); - return 0; + return nullptr; } const SwFlowFrm *SwFlowFrm::CastFlowFrm( const SwFrm *pFrm ) @@ -2529,7 +2529,7 @@ const SwFlowFrm *SwFlowFrm::CastFlowFrm( const SwFrm *pFrm ) return static_cast<const SwTabFrm*>(pFrm); if ( pFrm->IsSctFrm() ) return static_cast<const SwSectionFrm*>(pFrm); - return 0; + return nullptr; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 99a79a07fdc4..5745f83f6820 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -71,8 +71,8 @@ TYPEINIT2(SwFlyFrm,SwLayoutFrm,SwAnchoredObject); SwFlyFrm::SwFlyFrm( SwFlyFrameFormat *pFormat, SwFrm* pSib, SwFrm *pAnch ) : SwLayoutFrm( pFormat, pSib ), SwAnchoredObject(), // #i26791# - m_pPrevLink( 0 ), - m_pNextLink( 0 ), + m_pPrevLink( nullptr ), + m_pNextLink( nullptr ), m_bInCnt( false ), m_bAtCnt( false ), m_bLayout( false ), @@ -108,7 +108,7 @@ SwFlyFrm::SwFlyFrm( SwFlyFrameFormat *pFormat, SwFrm* pSib, SwFrm *pAnch ) : } else { - const SwViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0; + const SwViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : nullptr; if( pSh && pSh->GetViewOptions()->getBrowseMode() ) { mbVertLR = false; @@ -343,7 +343,7 @@ sal_uInt32 SwFlyFrm::_GetOrdNumForNewRef( const SwFlyDrawContact* pContact ) // search for another Writer fly frame registered at same frame format SwIterator<SwFlyFrm,SwFormat> aIter( *pContact->GetFormat() ); - const SwFlyFrm* pFlyFrm( 0L ); + const SwFlyFrm* pFlyFrm( nullptr ); for ( pFlyFrm = aIter.First(); pFlyFrm; pFlyFrm = aIter.Next() ) { if ( pFlyFrm != this ) @@ -379,8 +379,8 @@ SwVirtFlyDrawObj* SwFlyFrm::CreateNewRef( SwFlyDrawContact *pContact ) // order to transport the z-order. // After creating the first Reference the Masters are removed from the // List and are not important anymore. - SdrPage* pPg( 0L ); - if ( 0 != ( pPg = pContact->GetMaster()->GetPage() ) ) + SdrPage* pPg( nullptr ); + if ( nullptr != ( pPg = pContact->GetMaster()->GetPage() ) ) { const size_t nOrdNum = pContact->GetMaster()->GetOrdNum(); pPg->ReplaceObject( pDrawObj, nOrdNum ); @@ -450,7 +450,7 @@ void SwFlyFrm::FinitDrawObj() // Take VirtObject to the grave. // If the last VirtObject is destroyed, the DrawObject and the DrawContact // also need to be destroyed. - SwFlyDrawContact *pMyContact = 0; + SwFlyDrawContact *pMyContact = nullptr; if ( GetFormat() ) { bool bContinue = true; @@ -473,9 +473,9 @@ void SwFlyFrm::FinitDrawObj() // Writer fly frame again. if ( pMyContact ) { - pMyContact->GetMaster()->SetUserCall( 0 ); + pMyContact->GetMaster()->SetUserCall( nullptr ); } - GetVirtDrawObj()->SetUserCall( 0 ); // Else calls delete of the ContactObj + GetVirtDrawObj()->SetUserCall( nullptr ); // Else calls delete of the ContactObj delete GetVirtDrawObj(); // Deregisters itself at the Master delete pMyContact; // Destroys the Master itself } @@ -504,7 +504,7 @@ void SwFlyFrm::ChainFrames( SwFlyFrm *pMaster, SwFlyFrm *pFollow ) pInva = pInva->FindPrev(); } else - pInva = 0; + pInva = nullptr; } } @@ -530,8 +530,8 @@ void SwFlyFrm::ChainFrames( SwFlyFrm *pMaster, SwFlyFrm *pFollow ) void SwFlyFrm::UnchainFrames( SwFlyFrm *pMaster, SwFlyFrm *pFollow ) { - pMaster->m_pNextLink = 0; - pFollow->m_pPrevLink = 0; + pMaster->m_pNextLink = nullptr; + pFollow->m_pPrevLink = nullptr; if ( pFollow->ContainsContent() ) { @@ -732,7 +732,7 @@ void SwFlyFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) if ( ( nInvFlags & 0x40 ) && Lower() && Lower()->IsNoTextFrm() ) ClrContourCache( GetVirtDrawObj() ); SwRootFrm *pRoot; - if ( nInvFlags & 0x20 && 0 != (pRoot = getRootFrm()) ) + if ( nInvFlags & 0x20 && nullptr != (pRoot = getRootFrm()) ) pRoot->InvalidateBrowseWidth(); // #i28701# if ( nInvFlags & 0x80 ) @@ -791,7 +791,7 @@ void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, { SwNoTextNode *pNd = static_cast<SwNoTextNode*>(static_cast<SwContentFrm*>(Lower())->GetNode()); if ( pNd->HasContour() ) - pNd->SetContour( 0 ); + pNd->SetContour( nullptr ); } // #i28701# - perform reorder of object lists // at anchor frame and at page frame. @@ -864,8 +864,8 @@ void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, SwFormatURL aURL( GetFormat()->GetURL() ); - SwFormatFrmSize *pNewFormatFrmSize = NULL; - SwFormatChg *pOldFormatChg = NULL; + SwFormatFrmSize *pNewFormatFrmSize = nullptr; + SwFormatChg *pOldFormatChg = nullptr; if (nWhich == RES_FRM_SIZE) pNewFormatFrmSize = const_cast<SwFormatFrmSize*>(static_cast<const SwFormatFrmSize*>(pNew)); else @@ -909,7 +909,7 @@ void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, { SwNoTextNode *pNd = static_cast<SwNoTextNode*>(static_cast<SwContentFrm*>(Lower())->GetNode()); if ( pNd->HasContour() ) - pNd->SetContour( 0 ); + pNd->SetContour( nullptr ); } else if( !Lower()->IsColumnFrm() ) { @@ -1090,7 +1090,7 @@ void SwFlyFrm::_Invalidate( SwPageFrm *pPage ) m_bNotifyBack = m_bInvalid = true; SwFlyFrm *pFrm; - if ( GetAnchorFrm() && 0 != (pFrm = AnchorFrm()->FindFlyFrm()) ) + if ( GetAnchorFrm() && nullptr != (pFrm = AnchorFrm()->FindFlyFrm()) ) { // Very bad case: If the Fly is bound within another Fly which // contains columns, the Format should be from that one. @@ -1106,7 +1106,7 @@ void SwFlyFrm::_Invalidate( SwPageFrm *pPage ) if ( GetVertPosOrientFrm() && GetVertPosOrientFrm()->IsLayoutFrm() ) { const SwSectionFrm* pSectFrm( GetVertPosOrientFrm()->FindSctFrm() ); - if ( pSectFrm && pSectFrm->GetSection() == 0 ) + if ( pSectFrm && pSectFrm->GetSection() == nullptr ) { InvalidatePos(); ClearVertPosOrientFrm(); @@ -1132,7 +1132,7 @@ void SwFlyFrm::ChgRelPos( const Point &rNewPos ) RES_VERT_ORIENT, RES_HORI_ORIENT); SwFormatVertOrient aVert( pFormat->GetVertOrient() ); - const SwTextFrm *pAutoFrm = NULL; + const SwTextFrm *pAutoFrm = nullptr; // #i34948# - handle also at-page and at-fly anchored // Writer fly frames const RndStdIds eAnchorType = GetFrameFormat().GetAnchor().GetAnchorId(); @@ -1255,7 +1255,7 @@ void SwFlyFrm::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderAtt // Check column width and set it if needed if ( Lower() && Lower()->IsColumnFrm() ) - AdjustColumns( 0, false ); + AdjustColumns( nullptr, false ); mbValidSize = true; @@ -1308,7 +1308,7 @@ void SwFlyFrm::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderAtt Size aSize((Frm().*fnRect->fnGetWidth)(), (Frm().*fnRect->fnGetHeight)()); pCustomShape->SuggestTextFrameSize(aSize); // Do the calculations normally done after touching editeng text of the shape. - pCustomShape->NbcSetOutlinerParaObjectForText(0, 0); + pCustomShape->NbcSetOutlinerParaObjectForText(nullptr, nullptr); } } } @@ -1393,7 +1393,7 @@ void CalcContent( SwLayoutFrm *pLay, pSect->CalcFootnoteContent(); } else - pSect = NULL; + pSect = nullptr; SwFrm *pFrm = pLay->ContainsAny(); if ( !pFrm ) { @@ -1426,13 +1426,13 @@ void CalcContent( SwLayoutFrm *pLay, do { // local variables to avoid loops caused by anchored object positioning - SwAnchoredObject* pAgainObj1 = 0; - SwAnchoredObject* pAgainObj2 = 0; + SwAnchoredObject* pAgainObj1 = nullptr; + SwAnchoredObject* pAgainObj2 = nullptr; // FME 2007-08-30 #i81146# new loop control int nLoopControlRuns = 0; const int nLoopControlMax = 20; - const SwFrm* pLoopControlCond = 0; + const SwFrm* pLoopControlCond = nullptr; SwFrm* pLast; do @@ -1483,8 +1483,8 @@ void CalcContent( SwLayoutFrm *pLay, // #i57765# - do not consider invalid previous // frame, if current frame has a column/page break before attribute. SwFrm* pTmpPrev = pFrm->FindPrev(); - SwFlowFrm* pTmpPrevFlowFrm = pTmpPrev && pTmpPrev->IsFlowFrm() ? SwFlowFrm::CastFlowFrm(pTmpPrev) : 0; - SwFlowFrm* pTmpFlowFrm = pFrm->IsFlowFrm() ? SwFlowFrm::CastFlowFrm(pFrm) : 0; + SwFlowFrm* pTmpPrevFlowFrm = pTmpPrev && pTmpPrev->IsFlowFrm() ? SwFlowFrm::CastFlowFrm(pTmpPrev) : nullptr; + SwFlowFrm* pTmpFlowFrm = pFrm->IsFlowFrm() ? SwFlowFrm::CastFlowFrm(pFrm) : nullptr; bool bPrevInvalid = pTmpPrevFlowFrm && pTmpFlowFrm && !pTmpFlowFrm->IsFollow() && @@ -1584,8 +1584,8 @@ void CalcContent( SwLayoutFrm *pLay, if ( bRestartLayoutProcess ) { pFrm = pLay->ContainsAny(); - pAgainObj1 = 0L; - pAgainObj2 = 0L; + pAgainObj1 = nullptr; + pAgainObj2 = nullptr; continue; } @@ -2035,7 +2035,7 @@ void SwFrm::AppendFly( SwFlyFrm *pNew ) // Register at the page // If there's none present, register via SwPageFrm::PreparePage SwPageFrm* pPage = FindPageFrm(); - if ( pPage != NULL ) + if ( pPage != nullptr ) { pPage->AppendFlyToPage( pNew ); } @@ -2073,7 +2073,7 @@ void SwFrm::RemoveFly( SwFlyFrm *pToRemove ) if ( !mpDrawObjs->size() ) DELETEZ( mpDrawObjs ); - pToRemove->ChgAnchorFrm( 0 ); + pToRemove->ChgAnchorFrm( nullptr ); if ( !pToRemove->IsFlyInCntFrm() && GetUpper() && IsInTab() )//MA_FLY_HEIGHT GetUpper()->InvalidateSize(); @@ -2176,7 +2176,7 @@ void SwFrm::RemoveDrawObj( SwAnchoredObject& _rToRemoveObj ) if ( !mpDrawObjs->size() ) DELETEZ( mpDrawObjs ); - _rToRemoveObj.ChgAnchorFrm( 0 ); + _rToRemoveObj.ChgAnchorFrm( nullptr ); assert(!mpDrawObjs || mpDrawObjs->is_sorted()); } @@ -2471,7 +2471,7 @@ bool SwFlyFrm::GetContour( tools::PolyPolygon& rContour, // OD 16.04.2003 #i13147# - determine <GraphicObject> instead of <Graphic> // in order to avoid load of graphic, if <SwNoTextNode> contains a graphic // node and method is called for paint. - const GraphicObject* pGrfObj = NULL; + const GraphicObject* pGrfObj = nullptr; bool bGrfObjCreated = false; const SwGrfNode* pGrfNd = pNd->GetGrfNode(); if ( pGrfNd && _bForPaint ) diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx index 8dceb15acff8..f2780c5b2971 100644 --- a/sw/source/core/layout/flycnt.cxx +++ b/sw/source/core/layout/flycnt.cxx @@ -79,7 +79,7 @@ TYPEINIT1(SwFlyAtCntFrm,SwFlyFreeFrm); void SwFlyAtCntFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) { const sal_uInt16 nWhich = pNew ? pNew->Which() : 0; - const SwFormatAnchor *pAnch = 0; + const SwFormatAnchor *pAnch = nullptr; if( RES_ATTRSET_CHG == nWhich && SfxItemState::SET == static_cast<const SwAttrSetChg*>(pNew)->GetChgSet()->GetItemState( RES_ANCHOR, false, @@ -161,7 +161,7 @@ void SwFlyAtCntFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) if ( !pContent ) { SwContentNode *pNode = aNewIdx.GetNode().GetContentNode(); - pContent = pNode->getLayoutFrm( getRootFrm(), &pOldAnchor->Frm().Pos(), 0, false ); + pContent = pNode->getLayoutFrm( getRootFrm(), &pOldAnchor->Frm().Pos(), nullptr, false ); OSL_ENSURE( pContent, "Neuen Anker nicht gefunden" ); } //Flys are never attached to a follow, but always on the master which @@ -212,11 +212,11 @@ public: static bool IsInProgress( const SwFlyFrm *pFly ); }; -const SwFlyFrm *SwOszControl::pStk1 = 0; -const SwFlyFrm *SwOszControl::pStk2 = 0; -const SwFlyFrm *SwOszControl::pStk3 = 0; -const SwFlyFrm *SwOszControl::pStk4 = 0; -const SwFlyFrm *SwOszControl::pStk5 = 0; +const SwFlyFrm *SwOszControl::pStk1 = nullptr; +const SwFlyFrm *SwOszControl::pStk2 = nullptr; +const SwFlyFrm *SwOszControl::pStk3 = nullptr; +const SwFlyFrm *SwOszControl::pStk4 = nullptr; +const SwFlyFrm *SwOszControl::pStk5 = nullptr; SwOszControl::SwOszControl( const SwFlyFrm *pFrm ) : pFly( pFrm ), @@ -238,15 +238,15 @@ SwOszControl::SwOszControl( const SwFlyFrm *pFrm ) SwOszControl::~SwOszControl() { if ( SwOszControl::pStk1 == pFly ) - SwOszControl::pStk1 = 0; + SwOszControl::pStk1 = nullptr; else if ( SwOszControl::pStk2 == pFly ) - SwOszControl::pStk2 = 0; + SwOszControl::pStk2 = nullptr; else if ( SwOszControl::pStk3 == pFly ) - SwOszControl::pStk3 = 0; + SwOszControl::pStk3 = nullptr; else if ( SwOszControl::pStk4 == pFly ) - SwOszControl::pStk4 = 0; + SwOszControl::pStk4 = nullptr; else if ( SwOszControl::pStk5 == pFly ) - SwOszControl::pStk5 = 0; + SwOszControl::pStk5 = nullptr; // #i3317# while ( !maObjPositions.empty() ) { @@ -334,7 +334,7 @@ void SwFlyAtCntFrm::MakeAll(vcl::RenderContext* pRenderContext) if( !GetPageFrm() && GetAnchorFrm() && GetAnchorFrm()->IsInFly() ) { SwFlyFrm* pFly = AnchorFrm()->FindFlyFrm(); - SwPageFrm *pTmpPage = pFly ? pFly->FindPageFrm() : NULL; + SwPageFrm *pTmpPage = pFly ? pFly->FindPageFrm() : nullptr; if( pTmpPage ) pTmpPage->AppendFlyToPage( this ); } @@ -372,7 +372,7 @@ void SwFlyAtCntFrm::MakeAll(vcl::RenderContext* pRenderContext) const SwFrm* pFooter = GetAnchorFrm()->FindFooterOrHeader(); if( pFooter && !pFooter->IsFooterFrm() ) - pFooter = NULL; + pFooter = nullptr; bool bOsz = false; bool bExtra = Lower() && Lower()->IsColumnFrm(); // #i3317# - boolean, to apply temporarly the @@ -652,7 +652,7 @@ static const SwFrm * lcl_CalcDownDist( SwDistance &rRet, if( pSect && !pSect->IsAnLower( pLay ) ) { bSct = false; - const SwSectionFrm* pNxtSect = pLay ? pLay->FindSctFrm() : 0; + const SwSectionFrm* pNxtSect = pLay ? pLay->FindSctFrm() : nullptr; if (pSect->IsAnFollow(pNxtSect) && pLay) { if( pLay->IsVertical() ) @@ -696,7 +696,7 @@ static const SwFrm * lcl_CalcDownDist( SwDistance &rRet, + pLay->Prt().Height() - pSect->Frm().Top() - pSect->Frm().Height(); } - pSect = 0; + pSect = nullptr; } } else if( pLay ) @@ -719,7 +719,7 @@ static const SwFrm * lcl_CalcDownDist( SwDistance &rRet, nFrmTop = pLay->Frm().Top(); nPrtHeight = pLay->Prt().Height(); } - bSct = 0 != pSect; + bSct = nullptr != pSect; } while ( pLay && !pLay->Frm().IsInside( rPt ) && ( pLay->Frm().Top() <= rPt.Y() || pLay->IsInFly() || @@ -735,7 +735,7 @@ static const SwFrm * lcl_CalcDownDist( SwDistance &rRet, SwFrm::DestroyFrm(pDel); return pPre; } - return 0; + return nullptr; } else { @@ -749,7 +749,7 @@ static const SwFrm * lcl_CalcDownDist( SwDistance &rRet, { // If we're leaving a SwSectionFrm, the next Leaf-Frm // is the part of the upper below the SectionFrm. const SwSectionFrm* pNxtSect = pLay ? - pLay->FindSctFrm() : NULL; + pLay->FindSctFrm() : nullptr; bSct = false; if (pLay && pSect->IsAnFollow(pNxtSect)) { @@ -799,7 +799,7 @@ static const SwFrm * lcl_CalcDownDist( SwDistance &rRet, + pLay->Prt().Height() - pSect->Frm().Top() - pSect->Frm().Height(); } - pSect = 0; + pSect = nullptr; } } else if( pLay ) @@ -822,7 +822,7 @@ static const SwFrm * lcl_CalcDownDist( SwDistance &rRet, nFrmTop = pLay->Frm().Top(); nPrtHeight = pLay->Prt().Height(); } - bSct = 0 != pSect; + bSct = nullptr != pSect; } } } @@ -842,7 +842,7 @@ static const SwFrm * lcl_CalcDownDist( SwDistance &rRet, SwFrm *pDel = const_cast<SwFrm*>(pLay); pDel->Cut(); SwFrm::DestroyFrm(pDel); - return 0; + return nullptr; } return pLay; } @@ -850,7 +850,7 @@ static const SwFrm * lcl_CalcDownDist( SwDistance &rRet, rRet.nMain = LONG_MAX; } } - return 0; + return nullptr; } static sal_uInt64 lcl_FindCntDiff( const Point &rPt, const SwLayoutFrm *pLay, @@ -861,16 +861,16 @@ static sal_uInt64 lcl_FindCntDiff( const Point &rPt, const SwLayoutFrm *pLay, //the Contents is always the left upper corner. //The Cnt should preferably be above the point. - rpCnt = 0; + rpCnt = nullptr; sal_uInt64 nDistance = SAL_MAX_UINT64; sal_uInt64 nNearest = SAL_MAX_UINT64; - const SwContentFrm *pCnt = pLay ? pLay->ContainsContent() : NULL; + const SwContentFrm *pCnt = pLay ? pLay->ContainsContent() : nullptr; while ( pCnt && (bBody != pCnt->IsInDocBody() || bFootnote != pCnt->IsInFootnote())) { pCnt = pCnt->GetNextContentFrm(); if ( !pLay->IsAnLower( pCnt ) ) - pCnt = 0; + pCnt = nullptr; } const SwContentFrm *pNearest = pCnt; if ( pCnt ) @@ -1179,7 +1179,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew ) if( pCnt->IsProtected() ) pCnt = const_cast<SwContentFrm*>(static_cast<const SwContentFrm*>(GetAnchorFrm())); - SwPageFrm *pTmpPage = 0; + SwPageFrm *pTmpPage = nullptr; const bool bVert = pCnt->IsVertical(); const bool bVertL2R = pCnt->IsVertLR(); @@ -1208,7 +1208,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew ) //rNew is an absolute position. We need to calculate the distance from rNew //to the anchor inside the text flow to correctly set RelPos. //!!!!!We can optimize here: FindAnchor could also return RelPos! - const SwFrm *pFrm = 0; + const SwFrm *pFrm = nullptr; SwTwips nY; if ( pCnt->Frm().IsInside( aNew ) ) { @@ -1318,7 +1318,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew ) nX = rNew.X() - pFrm->Frm().Left(); } } - GetFormat()->GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL ); + GetFormat()->GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, nullptr ); if( pCnt != GetAnchorFrm() || ( IsAutoPos() && pCnt->IsTextFrm() && GetFormat()->getIDocumentSettingAccess().get(DocumentSettingId::HTML_MODE)) ) @@ -1333,11 +1333,11 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew ) if( pCnt->GetCrsrOfst( &pos, aPt, &eTmpState ) && pos.nNode == *pCnt->GetNode() ) { - if ( pCnt->GetNode()->GetTextNode() != NULL ) + if ( pCnt->GetNode()->GetTextNode() != nullptr ) { const SwTextAttr* pTextInputField = pCnt->GetNode()->GetTextNode()->GetTextAttrAt( pos.nContent.GetIndex(), RES_TXTATR_INPUTFIELD, SwTextNode::PARENT ); - if ( pTextInputField != NULL ) + if ( pTextInputField != nullptr ) { pos.nContent = pTextInputField->GetStart(); } @@ -1377,7 +1377,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew ) ChgRelPos( aRelPos ); - GetFormat()->GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); + GetFormat()->GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, nullptr ); if ( pOldPage != FindPageFrm() ) ::Notify_Background( GetVirtDrawObj(), pOldPage, aOld, PREP_FLY_LEAVE, false ); @@ -1391,7 +1391,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew ) */ void SwFlyAtCntFrm::RegisterAtCorrectPage() { - SwPageFrm* pPageFrm( 0L ); + SwPageFrm* pPageFrm( nullptr ); if ( GetVertPosOrientFrm() ) { pPageFrm = const_cast<SwPageFrm*>(GetVertPosOrientFrm()->FindPageFrm()); diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx index 832e465ab3e6..21c599fe6c09 100644 --- a/sw/source/core/layout/flyincnt.cxx +++ b/sw/source/core/layout/flyincnt.cxx @@ -66,7 +66,7 @@ void SwFlyInCntFrm::SetRefPoint( const Point& rPoint, { // OD 2004-05-27 #i26791# - member <aRelPos> moved to <SwAnchoredObject> OSL_ENSURE( rPoint != aRef || rRelAttr != GetCurrRelPos(), "SetRefPoint: no change" ); - SwFlyNotify *pNotify = NULL; + SwFlyNotify *pNotify = nullptr; // No notify at a locked fly frame, if a fly frame is locked, there's // already a SwFlyNotify object on the stack (MakeAll). if( !IsLocked() ) diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx index 1c96097a42d8..767a93e9b075 100644 --- a/sw/source/core/layout/flylay.cxx +++ b/sw/source/core/layout/flylay.cxx @@ -45,7 +45,7 @@ using namespace ::com::sun::star; SwFlyFreeFrm::SwFlyFreeFrm( SwFlyFrameFormat *pFormat, SwFrm* pSib, SwFrm *pAnch ) : SwFlyFrm( pFormat, pSib, pAnch ), - pPage( 0 ), + pPage( nullptr ), // #i34753# mbNoMakePos( false ), // #i37068# @@ -113,7 +113,7 @@ void SwFlyFreeFrm::MakeAll(vcl::RenderContext* /*pRenderContext*/) if( !GetPageFrm() && GetAnchorFrm() && GetAnchorFrm()->IsInFly() ) { SwFlyFrm* pFly = AnchorFrm()->FindFlyFrm(); - SwPageFrm *pPageFrm = pFly ? pFly->FindPageFrm() : NULL; + SwPageFrm *pPageFrm = pFly ? pFly->FindPageFrm() : nullptr; if( pPageFrm ) pPageFrm->AppendFlyToPage( this ); } @@ -480,7 +480,7 @@ void SwFlyLayFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) { const sal_uInt16 nWhich = pNew ? pNew->Which() : 0; - const SwFormatAnchor *pAnch = 0; + const SwFormatAnchor *pAnch = nullptr; if( RES_ATTRSET_CHG == nWhich && SfxItemState::SET == static_cast<const SwAttrSetChg*>(pNew)->GetChgSet()->GetItemState( RES_ANCHOR, false, reinterpret_cast<const SfxPoolItem**>(&pAnch) )) @@ -517,7 +517,7 @@ void SwFlyLayFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) if ( i == nPgNum ) { // #i50432# - adjust synopsis of <PlaceFly(..)> - pTmpPage->PlaceFly( this, 0 ); + pTmpPage->PlaceFly( this, nullptr ); } } if( !pTmpPage ) @@ -530,7 +530,7 @@ void SwFlyLayFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) { SwNodeIndex aIdx( pAnch->GetContentAnchor()->nNode ); SwContentFrm *pContent = GetFormat()->GetDoc()->GetNodes().GoNext( &aIdx )-> - GetContentNode()->getLayoutFrm( getRootFrm(), 0, 0, false ); + GetContentNode()->getLayoutFrm( getRootFrm(), nullptr, nullptr, false ); if( pContent ) { SwFlyFrm *pTmp = pContent->FindFlyFrm(); @@ -595,7 +595,7 @@ void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew ) (void) bSucessInserted; // #i87493# - OSL_ENSURE( pNew->GetPageFrm() == 0 || pNew->GetPageFrm() == this, + OSL_ENSURE( pNew->GetPageFrm() == nullptr || pNew->GetPageFrm() == this, "<SwPageFrm::AppendFlyToPage(..)> - anchored fly frame seems to be registered at another page frame. Serious defect." ); // #i28701# - use new method <SetPageFrm(..)> pNew->SetPageFrm( this ); @@ -634,7 +634,7 @@ void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew ) // #i87493# if ( pTmpObj->GetPageFrm() != this ) { - if ( pTmpObj->GetPageFrm() != 0 ) + if ( pTmpObj->GetPageFrm() != nullptr ) { pTmpObj->GetPageFrm()->RemoveDrawObjFromPage( *pTmpObj ); } @@ -675,7 +675,7 @@ void SwPageFrm::RemoveFlyFromPage( SwFlyFrm *pToRemove ) if (!m_pSortedObjs->size()) { delete m_pSortedObjs; - m_pSortedObjs = 0; + m_pSortedObjs = nullptr; } } @@ -691,7 +691,7 @@ void SwPageFrm::RemoveFlyFromPage( SwFlyFrm *pToRemove ) } // #i28701# - use new method <SetPageFrm(..)> - pToRemove->SetPageFrm( 0L ); + pToRemove->SetPageFrm( nullptr ); } void SwPageFrm::MoveFly( SwFlyFrm *pToMove, SwPageFrm *pDest ) @@ -833,7 +833,7 @@ void SwPageFrm::AppendDrawObjToPage( SwAnchoredObject& _rNewObj ) "Drawing object not appended into list <pSortedObjs>." ); } // #i87493# - OSL_ENSURE( _rNewObj.GetPageFrm() == 0 || _rNewObj.GetPageFrm() == this, + OSL_ENSURE( _rNewObj.GetPageFrm() == nullptr || _rNewObj.GetPageFrm() == this, "<SwPageFrm::AppendDrawObjToPage(..)> - anchored draw object seems to be registered at another page frame. Serious defect." ); _rNewObj.SetPageFrm( this ); @@ -867,7 +867,7 @@ void SwPageFrm::RemoveDrawObjFromPage( SwAnchoredObject& _rToRemoveObj ) static_cast<SwRootFrm*>(GetUpper())->InvalidateBrowseWidth(); } } - _rToRemoveObj.SetPageFrm( 0 ); + _rToRemoveObj.SetPageFrm( nullptr ); } // #i50432# - adjust method description and synopsis. @@ -1034,7 +1034,7 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) const_cast<SwFlyFrm*>(pFly)->GetAnchorFrmContainingAnchPos(); SWRECTFN( pClip ) const SwLayoutFrm *pUp = pClip->GetUpper(); - const SwFrm *pCell = pUp->IsCellFrm() ? pUp : 0; + const SwFrm *pCell = pUp->IsCellFrm() ? pUp : nullptr; const sal_uInt16 nType = bMove ? FRM_ROOT | FRM_FLY | FRM_HEADER | FRM_FOOTER | FRM_FTN : FRM_BODY | FRM_FLY | FRM_HEADER | @@ -1052,7 +1052,7 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) { rRect = pUp->Prt(); rRect += pUp->Frm().Pos(); - pUp = 0; + pUp = nullptr; } } if ( pUp ) diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index eb107c1ce5e0..5a679157a9c7 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -254,7 +254,7 @@ SwFrmNotify::~SwFrmNotify() if ( mpFrm->GetDrawObjs() ) { const SwSortedObjs &rObjs = *mpFrm->GetDrawObjs(); - SwPageFrm* pPageFrm = 0; + SwPageFrm* pPageFrm = nullptr; for ( size_t i = 0; i < rObjs.size(); ++i ) { // OD 2004-03-31 #i26791# - no general distinction between @@ -381,10 +381,10 @@ SwFrmNotify::~SwFrmNotify() } // #i9046# Automatic frame width - SwFlyFrm* pFly = 0; + SwFlyFrm* pFly = nullptr; // #i35879# Do not trust the inf flags. pFrm does not // necessarily have to have an upper! - if ( !mpFrm->IsFlyFrm() && 0 != ( pFly = mpFrm->ImplFindFlyFrm() ) ) + if ( !mpFrm->IsFlyFrm() && nullptr != ( pFly = mpFrm->ImplFindFlyFrm() ) ) { // #i61999# // no invalidation of columned Writer fly frames, because automatic @@ -647,7 +647,7 @@ SwFlyNotify::~SwFlyNotify() if ( pFly->IsNotifyBack() ) { SwViewShell *pSh = pFly->getRootFrm()->GetCurrShell(); - SwViewShellImp *pImp = pSh ? pSh->Imp() : 0; + SwViewShellImp *pImp = pSh ? pSh->Imp() : nullptr; if ( !pImp || !pImp->IsAction() || !pImp->GetLayAction().IsAgain() ) { //If in the LayAction the IsAgain is set it can be @@ -849,7 +849,7 @@ SwContentNotify::~SwContentNotify() if ( pSh ) { SwOLENode *pNd; - if ( 0 != (pNd = pCnt->GetNode()->GetOLENode()) && + if ( nullptr != (pNd = pCnt->GetNode()->GetOLENode()) && (pNd->GetOLEObj().IsOleRef() || pNd->IsOLESizeInvalid()) ) { @@ -860,7 +860,7 @@ SwContentNotify::~SwContentNotify() OSL_ENSURE( pCnt->IsInFly(), "OLE not in FlyFrm" ); SwFlyFrm *pFly = pCnt->FindFlyFrm(); svt::EmbeddedObjectRef& xObj = pNd->GetOLEObj().GetObject(); - SwFEShell *pFESh = 0; + SwFEShell *pFESh = nullptr; for(SwViewShell& rCurrentShell : pSh->GetRingContainer()) { if ( dynamic_cast<const SwCrsrShell*>( &rCurrentShell) != nullptr ) { @@ -919,8 +919,8 @@ SwContentNotify::~SwContentNotify() // When this content is formatted it is the time at which // the page is known. Thus, this data can be corrected now. - const SwPageFrm *pPage = 0; - SwNodeIndex *pIdx = 0; + const SwPageFrm *pPage = nullptr; + SwNodeIndex *pIdx = nullptr; SwFrameFormats *pTable = pDoc->GetSpzFrameFormats(); for ( size_t i = 0; i < pTable->size(); ++i ) @@ -928,7 +928,7 @@ SwContentNotify::~SwContentNotify() SwFrameFormat *pFormat = (*pTable)[i]; const SwFormatAnchor &rAnch = pFormat->GetAnchor(); if ( FLY_AT_PAGE != rAnch.GetAnchorId() || - rAnch.GetContentAnchor() == 0 ) + rAnch.GetContentAnchor() == nullptr ) { continue; } @@ -945,7 +945,7 @@ SwContentNotify::~SwContentNotify() pPage = pCnt->FindPageFrm(); } SwFormatAnchor aAnch( rAnch ); - aAnch.SetAnchor( 0 ); + aAnch.SetAnchor( nullptr ); aAnch.SetPageNum( pPage->GetPhyPageNum() ); pFormat->SetFormatAttr( aAnch ); if ( RES_DRAWFRMFMT != pFormat->Which() ) @@ -1045,8 +1045,8 @@ void AppendObjs( const SwFrameFormats *pTable, sal_uLong nIndex, (rAnch.GetAnchorId() == FLY_AT_CHAR) || bDrawObjInContent ) { - SdrObject* pSdrObj = 0; - if ( bSdrObj && 0 == (pSdrObj = pFormat->FindSdrObject()) ) + SdrObject* pSdrObj = nullptr; + if ( bSdrObj && nullptr == (pSdrObj = pFormat->FindSdrObject()) ) { OSL_ENSURE( !bSdrObj, "DrawObject not found." ); ++it; @@ -1065,7 +1065,7 @@ void AppendObjs( const SwFrameFormats *pTable, sal_uLong nIndex, static_cast<SwDrawContact*>(GetUserCall( pSdrObj )); if ( !pNew->GetAnchorFrm() ) { - pFrm->AppendDrawObj( *(pNew->GetAnchoredObj( 0L )) ); + pFrm->AppendDrawObj( *(pNew->GetAnchoredObj( nullptr )) ); } // OD 19.06.2003 #108784# - add 'virtual' drawing object, // if necessary. But control objects have to be excluded. @@ -1107,7 +1107,7 @@ static bool lcl_ObjConnected( const SwFrameFormat *pFormat, const SwFrm* pSib ) if ( RES_FLYFRMFMT == pFormat->Which() ) { SwIterator<SwFlyFrm,SwFormat> aIter( *pFormat ); - const SwRootFrm* pRoot = pSib ? pSib->getRootFrm() : 0; + const SwRootFrm* pRoot = pSib ? pSib->getRootFrm() : nullptr; const SwFlyFrm* pTmpFrm; for( pTmpFrm = aIter.First(); pTmpFrm; pTmpFrm = aIter.Next() ) { @@ -1119,7 +1119,7 @@ static bool lcl_ObjConnected( const SwFrameFormat *pFormat, const SwFrm* pSib ) { SwDrawContact *pContact = SwIterator<SwDrawContact,SwFormat>(*pFormat).First(); if ( pContact ) - return pContact->GetAnchorFrm() != 0; + return pContact->GetAnchorFrm() != nullptr; } return false; } @@ -1247,8 +1247,8 @@ void _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, SwPageFrm *pPage = pLay->FindPageFrm(); const SwFrameFormats *pTable = pDoc->GetSpzFrameFormats(); - SwFrm *pFrm = 0; - SwActualSection *pActualSection = 0; + SwFrm *pFrm = nullptr; + SwActualSection *pActualSection = nullptr; SwLayHelper *pPageMaker; //If the layout will be created (bPages == true) we do head on the progress @@ -1269,7 +1269,7 @@ void _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, } } else - pPageMaker = NULL; + pPageMaker = nullptr; if( pLay->IsInSct() && ( pLay->IsSctFrm() || pLay->GetUpper() ) ) // Hereby will newbies @@ -1287,7 +1287,7 @@ void _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, if( ( !pLay->IsInFootnote() || pSct->IsInFootnote() ) && ( !pLay->IsInTab() || pSct->IsInTab() ) ) { - pActualSection = new SwActualSection( 0, pSct, 0 ); + pActualSection = new SwActualSection( nullptr, pSct, nullptr ); OSL_ENSURE( !pLay->Lower() || !pLay->Lower()->IsColumnFrm(), "_InsertCnt: Wrong Call" ); } @@ -1392,7 +1392,7 @@ void _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, while ( pTmpFrm ) { pTmpFrm->CheckDirChange(); - pTmpFrm = pTmpFrm->IsFollow() ? pTmpFrm->FindMaster() : NULL; + pTmpFrm = pTmpFrm->IsFollow() ? pTmpFrm->FindMaster() : nullptr; } } @@ -1428,12 +1428,12 @@ void _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, // Do not trust the IsInFootnote flag. If we are currently // building up a table, the upper of pPrv may be a cell // frame, but the cell frame does not have an upper yet. - if( pPrv && 0 != pPrv->ImplFindFootnoteFrm() ) + if( pPrv && nullptr != pPrv->ImplFindFootnoteFrm() ) { if( pPrv->IsSctFrm() ) pPrv = static_cast<SwSectionFrm*>(pPrv)->ContainsContent(); if( pPrv && pPrv->IsTextFrm() ) - static_cast<SwTextFrm*>(pPrv)->Prepare( PREP_QUOVADIS, 0, false ); + static_cast<SwTextFrm*>(pPrv)->Prepare( PREP_QUOVADIS, nullptr, false ); } } // #i27138# @@ -1480,7 +1480,7 @@ void _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, pLay = static_cast<SwLayoutFrm*>(pFrm); if ( pLay->Lower() && pLay->Lower()->IsLayoutFrm() ) pLay = pLay->GetNextLayoutLeaf(); - pPrv = 0; + pPrv = nullptr; } } else if ( pNd->IsEndNode() && pNd->StartOfSectionNode()->IsSectionNode() ) @@ -1491,10 +1491,10 @@ void _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, //Close the section, where appropriate activate the surrounding //section again. - SwActualSection *pTmp = pActualSection ? pActualSection->GetUpper() : NULL; + SwActualSection *pTmp = pActualSection ? pActualSection->GetUpper() : nullptr; delete pActualSection; pLay = pLay->FindSctFrm(); - if ( 0 != (pActualSection = pTmp) ) + if ( nullptr != (pActualSection = pTmp) ) { //Could be, that the last SectionFrm remains empty. //Then now is the time to remove them. @@ -1527,7 +1527,7 @@ void _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, SwSectionFrm* pFollow = pOuterSectionFrm->GetFollow(); if ( pFollow ) { - pOuterSectionFrm->SetFollow( NULL ); + pOuterSectionFrm->SetFollow( nullptr ); pOuterSectionFrm->InvalidateSize(); static_cast<SwSectionFrm*>(pFrm)->SetFollow( pFollow ); } @@ -1544,7 +1544,7 @@ void _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc, pLay = static_cast<SwLayoutFrm*>(pFrm); if ( pLay->Lower() && pLay->Lower()->IsLayoutFrm() ) pLay = pLay->GetNextLayoutLeaf(); - pPrv = 0; + pPrv = nullptr; } else { @@ -1626,7 +1626,7 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx, bool bApres = aTmp < rSttIdx; SwNode2Layout aNode2Layout( *pNd, rSttIdx.GetIndex() ); SwFrm* pFrm; - while( 0 != (pFrm = aNode2Layout.NextFrm()) ) + while( nullptr != (pFrm = aNode2Layout.NextFrm()) ) { SwLayoutFrm *pUpper = pFrm->GetUpper(); SwFootnoteFrm* pFootnoteFrm = pUpper->FindFootnoteFrm(); @@ -1643,7 +1643,7 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx, // not the ones (e.g. column areas) in which are the footnote containers positioned. // #109767# Table frame is in section, insert section in cell frame. if( pSct && ((pFootnoteFrm && !pSct->IsInFootnote()) || pUpper->IsCellFrm()) ) - pSct = NULL; + pSct = nullptr; if( pSct ) { // to prevent pTmp->MoveFwd from destroying the SectionFrm bOldLock = pSct->IsColLocked(); @@ -1692,7 +1692,7 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx, pCol = static_cast<SwColumnFrm*>(pCol->GetNext()); } else - pCol = NULL; + pCol = nullptr; } // skip invalid SectionFrms while( pMove && pMove->IsSctFrm() && @@ -1712,11 +1712,11 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx, if( pMove ) pTmp = SwFlowFrm::CastFlowFrm( pMove ); else - pTmp = NULL; + pTmp = nullptr; } } else - pTmp = 0; + pTmp = nullptr; } else { @@ -1732,7 +1732,7 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx, if( pMove ) pTmp = SwFlowFrm::CastFlowFrm( pMove ); else - pTmp = NULL; + pTmp = nullptr; } } @@ -2227,14 +2227,14 @@ SwBorderAttrs *SwBorderAttrAccess::Get() SwOrderIter::SwOrderIter( const SwPageFrm *pPg, bool bFlys ) : m_pPage( pPg ), - m_pCurrent( 0 ), + m_pCurrent( nullptr ), m_bFlysOnly( bFlys ) { } const SdrObject *SwOrderIter::Top() { - m_pCurrent = 0; + m_pCurrent = nullptr; if ( m_pPage->GetSortedObjs() ) { const SwSortedObjs *pObjs = m_pPage->GetSortedObjs(); @@ -2261,7 +2261,7 @@ const SdrObject *SwOrderIter::Top() const SdrObject *SwOrderIter::Bottom() { - m_pCurrent = 0; + m_pCurrent = nullptr; if ( m_pPage->GetSortedObjs() ) { sal_uInt32 nBotOrd = USHRT_MAX; @@ -2289,7 +2289,7 @@ const SdrObject *SwOrderIter::Bottom() const SdrObject *SwOrderIter::Next() { const sal_uInt32 nCurOrd = m_pCurrent ? m_pCurrent->GetOrdNumDirect() : 0; - m_pCurrent = 0; + m_pCurrent = nullptr; if ( m_pPage->GetSortedObjs() ) { sal_uInt32 nOrd = USHRT_MAX; @@ -2317,7 +2317,7 @@ const SdrObject *SwOrderIter::Next() const SdrObject *SwOrderIter::Prev() { const sal_uInt32 nCurOrd = m_pCurrent ? m_pCurrent->GetOrdNumDirect() : 0; - m_pCurrent = 0; + m_pCurrent = nullptr; if ( m_pPage->GetSortedObjs() ) { const SwSortedObjs *pObjs = m_pPage->GetSortedObjs(); @@ -2408,8 +2408,8 @@ SwFrm *SaveContent( SwLayoutFrm *pLay, SwFrm *pStart ) sw_RemoveFootnotes( static_cast<SwColumnFrm*>(pLay->Lower()), true, true ); SwFrm *pSav; - if ( 0 == (pSav = pLay->ContainsAny()) ) - return 0; + if ( nullptr == (pSav = pLay->ContainsAny()) ) + return nullptr; if( pSav->IsInFootnote() && !pLay->IsInFootnote() ) { @@ -2417,7 +2417,7 @@ SwFrm *SaveContent( SwLayoutFrm *pLay, SwFrm *pStart ) pSav = pSav->FindNext(); while( pSav && pSav->IsInFootnote() ); if( !pSav || !pLay->IsAnLower( pSav ) ) - return NULL; + return nullptr; } // Tables should be saved as a whole, expection: @@ -2433,7 +2433,7 @@ SwFrm *SaveContent( SwLayoutFrm *pLay, SwFrm *pStart ) do { pSav = pTmp; - pTmp = (pSav && pSav->GetUpper()) ? pSav->GetUpper()->FindSctFrm() : NULL; + pTmp = (pSav && pSav->GetUpper()) ? pSav->GetUpper()->FindSctFrm() : nullptr; } while ( pTmp != pSect ); } @@ -2475,13 +2475,13 @@ SwFrm *SaveContent( SwLayoutFrm *pLay, SwFrm *pStart ) if ( pFloat->GetNext() ) { if( bGo ) - pFloat->mpUpper = NULL; + pFloat->mpUpper = nullptr; pFloat = pFloat->GetNext(); if( !bGo && pFloat == pStart ) { bGo = true; - pFloat->mpPrev->mpNext = NULL; - pFloat->mpPrev = NULL; + pFloat->mpPrev->mpNext = nullptr; + pFloat->mpPrev = nullptr; } } else @@ -2492,14 +2492,14 @@ SwFrm *SaveContent( SwLayoutFrm *pLay, SwFrm *pStart ) // search next chain part and connect both chains SwFrm *pTmp = pFloat->FindNext(); if( bGo ) - pFloat->mpUpper = NULL; + pFloat->mpUpper = nullptr; if( !pLay->IsInFootnote() ) while( pTmp && pTmp->IsInFootnote() ) pTmp = pTmp->FindNext(); if ( !pLay->IsAnLower( pTmp ) ) - pTmp = 0; + pTmp = nullptr; if ( pTmp && bGo ) { @@ -2510,7 +2510,7 @@ SwFrm *SaveContent( SwLayoutFrm *pLay, SwFrm *pStart ) bGo = bGo || ( pStart == pFloat ); } while ( pFloat ); - return bGo ? pStart : NULL; + return bGo ? pStart : nullptr; } // #115759# - add also drawing objects to page and at-fly @@ -2592,7 +2592,7 @@ void RestoreContent( SwFrm *pSav, SwLayoutFrm *pParent, SwFrm *pSibling, bool bG pSibling->InvalidatePage( pPage ); SwFlowFrm *pFlowFrm = dynamic_cast<SwFlowFrm*>(pSibling); if (pFlowFrm && pFlowFrm->GetFollow()) - pSibling->Prepare( PREP_CLEAR, 0, false ); + pSibling->Prepare( PREP_CLEAR, nullptr, false ); } else { pNxt = pParent->m_pLower; @@ -2920,7 +2920,7 @@ void Notify_Background( const SdrObject* pObj, return; SwLayoutFrm* pArea; - SwFlyFrm *pFlyFrm = 0; + SwFlyFrm *pFlyFrm = nullptr; SwFrm* pAnchor; if( dynamic_cast<const SwVirtFlyDrawObj*>( pObj) != nullptr ) { @@ -2929,7 +2929,7 @@ void Notify_Background( const SdrObject* pObj, } else { - pFlyFrm = NULL; + pFlyFrm = nullptr; pAnchor = const_cast<SwFrm*>( GetUserCall(pObj)->GetAnchoredObj( pObj )->GetAnchorFrm() ); } @@ -2937,7 +2937,7 @@ void Notify_Background( const SdrObject* pObj, pArea = pAnchor->FindFlyFrm(); else pArea = pPage; - SwContentFrm *pCnt = 0; + SwContentFrm *pCnt = nullptr; if ( pArea ) { if( PREP_FLY_ARRIVE != eHint ) @@ -2958,7 +2958,7 @@ void Notify_Background( const SdrObject* pObj, pCnt = pArea->ContainsContent(); } } - SwFrm *pLastTab = 0; + SwFrm *pLastTab = nullptr; while ( pCnt && pArea && pArea->IsAnLower( pCnt ) ) { @@ -3055,9 +3055,9 @@ void Notify_Background( const SdrObject* pObj, pAnchor->GetUpper()->InvalidateSize(); // #i82258# - make code robust - SwViewShell* pSh = 0; + SwViewShell* pSh = nullptr; if ( bInva && pPage && - 0 != (pSh = pPage->getRootFrm()->GetCurrShell()) ) + nullptr != (pSh = pPage->getRootFrm()->GetCurrShell()) ) { pSh->InvalidateWindows( rRect ); } @@ -3228,7 +3228,7 @@ const SwFrm* FindPage( const SwRect &rRect, const SwFrm *pPage ) if ( !rRect.IsOver( pPage->Frm() ) ) { const SwRootFrm* pRootFrm = static_cast<const SwRootFrm*>(pPage->GetUpper()); - const SwFrm* pTmpPage = pRootFrm ? pRootFrm->GetPageAtPos( rRect.TopLeft(), &rRect.SSize(), true ) : 0; + const SwFrm* pTmpPage = pRootFrm ? pRootFrm->GetPageAtPos( rRect.TopLeft(), &rRect.SSize(), true ) : nullptr; if ( pTmpPage ) pPage = pTmpPage; } @@ -3242,7 +3242,7 @@ class SwFrmHolder : private SfxListener bool bSet; virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; public: - SwFrmHolder() : pFrm(0), bSet(false) {} + SwFrmHolder() : pFrm(nullptr), bSet(false) {} void SetFrm( SwFrm* pHold ); SwFrm* GetFrm() { return pFrm; } void Reset(); @@ -3261,7 +3261,7 @@ void SwFrmHolder::Reset() if (pFrm) EndListening(*pFrm); bSet = false; - pFrm = 0; + pFrm = nullptr; } void SwFrmHolder::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) @@ -3269,21 +3269,21 @@ void SwFrmHolder::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING && &rBC == pFrm ) { - pFrm = 0; + pFrm = nullptr; } } SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, sal_uInt16 const nFrmType, const Point* pPoint, const SwPosition *pPos, const bool bCalcFrm ) { - SwFrm *pMinFrm = 0, *pTmpFrm; + SwFrm *pMinFrm = nullptr, *pTmpFrm; SwFrmHolder aHolder; SwRect aCalcRect; bool bClientIterChanged = false; SwIterator<SwFrm,SwModify> aIter( rMod ); do { - pMinFrm = 0; + pMinFrm = nullptr; aHolder.Reset(); sal_uInt64 nMinDist = 0; bClientIterChanged = false; @@ -3315,7 +3315,7 @@ SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, sal_uInt1 { SwObjectFormatter::FormatObj( *pFlyFrm ); } - pTmpFrm->Calc(pLayout ? pLayout->GetCurrShell()->GetOut() : 0); + pTmpFrm->Calc(pLayout ? pLayout->GetCurrShell()->GetOut() : nullptr); } // aIter.IsChanged checks if the current pTmpFrm has been deleted while diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index ad334db9158f..9e9b019ba632 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -96,8 +96,8 @@ static bool lcl_NextFootnoteBoss( SwFootnoteBossFrm* &rpBoss, SwPageFrm* &rpPage } else if( bDontLeave ) { - rpPage = NULL; - rpBoss = NULL; + rpPage = nullptr; + rpBoss = nullptr; return false; } } @@ -203,7 +203,7 @@ void SwFootnoteContFrm::Format( vcl::RenderContext* /*pRenderContext*/, const Sw bool bGrow = pPage->IsFootnotePage(); if( bGrow ) { - const SwViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0; + const SwViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : nullptr; if( pSh && pSh->GetViewOptions()->getBrowseMode() ) bGrow = false; } @@ -286,7 +286,7 @@ SwTwips SwFootnoteContFrm::GrowFrm( SwTwips nDist, bool bTst, bool ) return 0; } } - const SwViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0; + const SwViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : nullptr; const bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); SwPageFrm *pPage = pBoss->FindPageFrm(); if ( bBrowseMode || !pPage->IsFootnotePage() ) @@ -419,8 +419,8 @@ SwTwips SwFootnoteContFrm::ShrinkFrm( SwTwips nDiff, bool bTst, bool bInfo ) SwFootnoteFrm::SwFootnoteFrm( SwFrameFormat *pFormat, SwFrm* pSib, SwContentFrm *pCnt, SwTextFootnote *pAt ): SwLayoutFrm( pFormat, pSib ), - pFollow( 0 ), - pMaster( 0 ), + pFollow( nullptr ), + pMaster( nullptr ), pRef( pCnt ), pAttr( pAt ), bBackMoveLocked( false ), @@ -500,8 +500,8 @@ void SwFootnoteFrm::Cut() pFootnote->GetFollow()->SetMaster( pFootnote->GetMaster() ); if ( pFootnote->GetMaster() ) pFootnote->GetMaster()->SetFollow( pFootnote->GetFollow() ); - pFootnote->SetFollow( 0 ); - pFootnote->SetMaster( 0 ); + pFootnote->SetFollow( nullptr ); + pFootnote->SetMaster( nullptr ); // cut all connections RemoveFromLayout(); @@ -602,9 +602,9 @@ SwLayoutFrm *SwFrm::GetNextFootnoteLeaf( MakePageType eMakePage ) SwPageFrm* pOldPage = pOldBoss->FindPageFrm(); SwPageFrm* pPage; SwFootnoteBossFrm *pBoss = pOldBoss->IsColumnFrm() ? - static_cast<SwFootnoteBossFrm*>(pOldBoss->GetNext()) : 0; // next column, if existing + static_cast<SwFootnoteBossFrm*>(pOldBoss->GetNext()) : nullptr; // next column, if existing if( pBoss ) - pPage = NULL; + pPage = nullptr; else { if( pOldBoss->GetUpper()->IsSctFrm() ) @@ -617,7 +617,7 @@ SwLayoutFrm *SwFrm::GetNextFootnoteLeaf( MakePageType eMakePage ) pPage = pBoss->FindPageFrm(); } else - return 0; + return nullptr; } else { @@ -660,7 +660,7 @@ SwLayoutFrm *SwFrm::GetNextFootnoteLeaf( MakePageType eMakePage ) static_cast<SwPageFrm*>(pBoss)->SetEndNotePage( pOldPage->IsEndNotePage() ); } else - return 0; + return nullptr; } if( pBoss->IsPageFrm() ) { @@ -694,7 +694,7 @@ SwLayoutFrm *SwFrm::GetPrevFootnoteLeaf( MakePageType eMakeFootnote ) if ( !pRet ) { bool bEndn = pFootnote->GetAttr()->GetFootnote().IsEndNote(); - SwFrm* pTmpRef = NULL; + SwFrm* pTmpRef = nullptr; if( bEndn && pFootnote->IsInSct() ) { SwSectionFrm* pSect = pFootnote->FindSctFrm(); @@ -713,7 +713,7 @@ SwLayoutFrm *SwFrm::GetPrevFootnoteLeaf( MakePageType eMakeFootnote ) const bool bFootnoteEndDoc = pOldPage->IsFootnotePage(); SwFootnoteBossFrm* pNxtBoss = pOldBoss; SwSectionFrm *pSect = pNxtBoss->GetUpper()->IsSctFrm() ? - static_cast<SwSectionFrm*>(pNxtBoss->GetUpper()) : 0; + static_cast<SwSectionFrm*>(pNxtBoss->GetUpper()) : nullptr; do { @@ -721,20 +721,20 @@ SwLayoutFrm *SwFrm::GetPrevFootnoteLeaf( MakePageType eMakeFootnote ) pNxtBoss = static_cast<SwFootnoteBossFrm*>(pNxtBoss->GetPrev()); // one column backwards else // one page backwards { - SwLayoutFrm* pBody = 0; + SwLayoutFrm* pBody = nullptr; if( pSect ) { if( pSect->IsFootnoteLock() ) { if( pNxtBoss == pOldBoss ) - return 0; + return nullptr; pStop = pNxtBoss; } else { pSect = pSect->FindMaster(); if( !pSect || !pSect->Lower() ) - return 0; + return nullptr; OSL_ENSURE( pSect->Lower()->IsColumnFrm(), "GetPrevFootnoteLeaf: Where's the column?" ); pNxtBoss = static_cast<SwFootnoteBossFrm*>(pSect->Lower()); @@ -746,7 +746,7 @@ SwLayoutFrm *SwFrm::GetPrevFootnoteLeaf( MakePageType eMakeFootnote ) SwPageFrm* pPage = static_cast<SwPageFrm*>(pNxtBoss->FindPageFrm()->GetPrev()); if( !pPage || pPage->GetPhyPageNum() < nNum || bEndNote != pPage->IsEndNotePage() || bFootnoteEndDoc != pPage->IsFootnotePage() ) - return NULL; // no further pages found + return nullptr; // no further pages found pNxtBoss = pPage; pBody = pPage->FindBodyCont(); } @@ -878,7 +878,7 @@ void sw_RemoveFootnotes( SwFootnoteBossFrm* pBoss, bool bPageOnly, bool bEndNote } } // is there another column? - pBoss = pBoss->IsColumnFrm() ? static_cast<SwColumnFrm*>(pBoss->GetNext()) : NULL; + pBoss = pBoss->IsColumnFrm() ? static_cast<SwColumnFrm*>(pBoss->GetNext()) : nullptr; } while( pBoss ); } @@ -971,7 +971,7 @@ SwFootnoteContFrm *SwFootnoteBossFrm::FindFootnoteCont() /// Search the next available footnote container. SwFootnoteContFrm *SwFootnoteBossFrm::FindNearestFootnoteCont( bool bDontLeave ) { - SwFootnoteContFrm *pCont = 0; + SwFootnoteContFrm *pCont = nullptr; if ( !GetFormat()->GetDoc()->GetFootnoteIdxs().empty() ) { pCont = FindFootnoteCont(); @@ -997,7 +997,7 @@ SwFootnoteFrm *SwFootnoteBossFrm::FindFirstFootnote() // search for the nearest footnote container SwFootnoteContFrm *pCont = FindNearestFootnoteCont(); if ( !pCont ) - return 0; + return nullptr; // Starting from the first footnote, search the first // footnote that is referenced by the current column/page @@ -1013,7 +1013,7 @@ SwFootnoteFrm *SwFootnoteBossFrm::FindFirstFootnote() pBoss = pRet->GetRef()->FindFootnoteBossFrm(); OSL_ENSURE( pBoss, "FindFirstFootnote: No boss found" ); if( !pBoss ) - return NULL; // ?There must be a bug, but no GPF + return nullptr; // ?There must be a bug, but no GPF pPage = pBoss->FindPageFrm(); nPgNum = pPage->GetPhyPageNum(); if ( nPgNum == nRefNum ) @@ -1022,13 +1022,13 @@ SwFootnoteFrm *SwFootnoteBossFrm::FindFirstFootnote() if( nColNum == nRefCol ) return pRet; // found else if( nColNum > nRefCol ) - return NULL; // at least one column too far + return nullptr; // at least one column too far } else if ( nPgNum > nRefNum ) - return NULL; // at least one column too far + return nullptr; // at least one column too far } else - return NULL; + return nullptr; // Done if Ref is on a subsequent page or on the same page in a subsequent column do @@ -1042,7 +1042,7 @@ SwFootnoteFrm *SwFootnoteBossFrm::FindFirstFootnote() pBoss = pRet->FindFootnoteBossFrm(); pPage = pBoss->FindPageFrm(); lcl_NextFootnoteBoss( pBoss, pPage, false ); // next FootnoteBoss - pCont = pBoss ? pBoss->FindNearestFootnoteCont() : 0; + pCont = pBoss ? pBoss->FindNearestFootnoteCont() : nullptr; if ( pCont ) pNxt = static_cast<SwFootnoteFrm*>(pCont->Lower()); } @@ -1058,13 +1058,13 @@ SwFootnoteFrm *SwFootnoteBossFrm::FindFirstFootnote() if( nColNum == nRefCol ) break; // found else if( nColNum > nRefCol ) - pRet = 0; // at least one column too far + pRet = nullptr; // at least one column too far } else if ( nPgNum > nRefNum ) - pRet = 0; // at least a page too far + pRet = nullptr; // at least a page too far } else - pRet = 0; // there is none + pRet = nullptr; // there is none } while( pRet ); return pRet; } @@ -1088,15 +1088,15 @@ const SwFootnoteFrm *SwFootnoteBossFrm::FindFirstFootnote( SwContentFrm *pCnt ) { SwFootnoteBossFrm *pBoss = const_cast<SwFootnoteBossFrm*>(pRet->FindFootnoteBossFrm()); SwPageFrm *pPage = pBoss->FindPageFrm(); lcl_NextFootnoteBoss( pBoss, pPage, false ); // next FootnoteBoss - SwFootnoteContFrm *pCont = pBoss ? pBoss->FindNearestFootnoteCont() : 0; - pRet = pCont ? static_cast<SwFootnoteFrm*>(pCont->Lower()) : 0; + SwFootnoteContFrm *pCont = pBoss ? pBoss->FindNearestFootnoteCont() : nullptr; + pRet = pCont ? static_cast<SwFootnoteFrm*>(pCont->Lower()) : nullptr; } if ( pRet ) { const SwFootnoteBossFrm* pBoss = pRet->GetRef()->FindFootnoteBossFrm(); if( pBoss->GetPhyPageNum() != nPageNum || nColNum != lcl_ColumnNum( pBoss ) ) - pRet = 0; + pRet = nullptr; } } } @@ -1164,17 +1164,17 @@ void SwFootnoteBossFrm::InsertFootnote( SwFootnoteFrm* pNew ) if( bEndnt ) { const SwSectionFormat* pEndFormat = pMySect->GetEndSectFormat(); - bDontLeave = 0 != pEndFormat; + bDontLeave = nullptr != pEndFormat; if( pSibling ) { if( pEndFormat ) { if( !pSibling->IsInSct() || !pSibling->ImplFindSctFrm()->IsDescendantFrom( pEndFormat ) ) - pSibling = NULL; + pSibling = nullptr; } else if( pSibling->IsInSct() ) - pSibling = NULL; + pSibling = nullptr; } } else @@ -1186,17 +1186,17 @@ void SwFootnoteBossFrm::InsertFootnote( SwFootnoteFrm* pNew ) { if( !pSibling->IsInSct() || !pMySect->IsAnFollow( pSibling->ImplFindSctFrm() ) ) - pSibling = NULL; + pSibling = nullptr; } else if( pSibling->IsInSct() ) - pSibling = NULL; + pSibling = nullptr; } } } if( pSibling && pSibling->FindPageFrm()->IsEndNotePage() != FindPageFrm()->IsEndNotePage() ) - pSibling = NULL; + pSibling = nullptr; // use the Doc to find out the position SwDoc *pDoc = GetFormat()->GetDoc(); @@ -1204,12 +1204,12 @@ void SwFootnoteBossFrm::InsertFootnote( SwFootnoteFrm* pNew ) sal_uLong nCmpPos = 0; sal_uLong nLastPos = 0; - SwFootnoteContFrm *pParent = 0; + SwFootnoteContFrm *pParent = nullptr; if( pSibling ) { nCmpPos = ::lcl_FindFootnotePos( pDoc, pSibling->GetAttr() ); if( nCmpPos > nStPos ) - pSibling = NULL; + pSibling = nullptr; } if ( !pSibling ) @@ -1228,10 +1228,10 @@ void SwFootnoteBossFrm::InsertFootnote( SwFootnoteFrm* pNew ) nCmpPos = ::lcl_FindFootnotePos( pDoc, pFootnote->GetAttr() ); if ( nCmpPos > nStPos ) - pParent = 0; + pParent = nullptr; } else - pParent = 0; + pParent = nullptr; } } if ( !pParent ) @@ -1249,7 +1249,7 @@ void SwFootnoteBossFrm::InsertFootnote( SwFootnoteFrm* pNew ) nCmpPos = ::lcl_FindFootnotePos( pDoc, pSibling->GetAttr() ); SwFootnoteBossFrm *pNxtB; // remember the last one to not - SwFootnoteFrm *pLastSib = 0; // go too far. + SwFootnoteFrm *pLastSib = nullptr; // go too far. while ( pSibling && nCmpPos <= nStPos ) { @@ -1275,7 +1275,7 @@ void SwFootnoteBossFrm::InsertFootnote( SwFootnoteFrm* pNew ) // When changing pages, also the endnote flag must match. SwFootnoteContFrm *pCont = pNxtB && ( !bChgPage || pSibPage->IsEndNotePage() == bEndNote ) - ? pNxtB->FindNearestFootnoteCont( bDontLeave ) : 0; + ? pNxtB->FindNearestFootnoteCont( bDontLeave ) : nullptr; if( pCont ) pSibling = static_cast<SwFootnoteFrm*>(pCont->Lower()); else // no further FootnoteContainer, insert after pSibling @@ -1316,7 +1316,7 @@ void SwFootnoteBossFrm::InsertFootnote( SwFootnoteFrm* pNew ) sal_uInt16 nRefNum = pBoss->GetPhyPageNum(); // page number of the new footnote sal_uInt16 nRefCol = lcl_ColumnNum( pBoss ); // column number of the new footnote bool bEnd = false; - SwFootnoteFrm *pLastSib = 0; + SwFootnoteFrm *pLastSib = nullptr; while ( pSibling && !bEnd && (nCmpPos <= nStPos) ) { pLastSib = pSibling; @@ -1347,7 +1347,7 @@ void SwFootnoteBossFrm::InsertFootnote( SwFootnoteFrm* pNew ) // When changing pages, also the endnote flag must match. SwFootnoteContFrm *pCont = pNxtB && ( !bChgPage || pSibPage->IsEndNotePage() == bEndNote ) - ? pNxtB->FindNearestFootnoteCont( bDontLeave ) : 0; + ? pNxtB->FindNearestFootnoteCont( bDontLeave ) : nullptr; if ( pCont ) pSibling = static_cast<SwFootnoteFrm*>(pCont->Lower()); else @@ -1437,7 +1437,7 @@ void SwFootnoteBossFrm::AppendFootnote( SwContentFrm *pRef, SwTextFootnote *pAtt { SwPageDesc *pDesc = pDoc->GetEndNoteInfo().GetPageDesc( *pDoc ); pPage = ::InsertNewPage( *pDesc, pPage->GetUpper(), - !pPage->OnRightPage(), false, false, true, 0 ); + !pPage->OnRightPage(), false, false, true, nullptr ); pPage->SetEndNotePage( true ); bChgPage = true; } @@ -1621,7 +1621,7 @@ SwFootnoteFrm *SwFootnoteBossFrm::FindFootnote( const SwContentFrm *pRef, const pNd = pRef->GetAttrSet()->GetDoc()-> GetNodes().GoNextSection( &aIdx, true, false ); if ( !pNd ) - return 0; + return nullptr; SwIterator<SwFrm,SwContentNode> aIter( *pNd ); SwFrm* pFrm = aIter.First(); if( pFrm ) @@ -1640,15 +1640,15 @@ SwFootnoteFrm *SwFootnoteBossFrm::FindFootnote( const SwContentFrm *pRef, const // the HiddenFlag of the section is set, this causes // the GoNextSection-function leaves the footnote. if( pFootnote->GetAttr() != pAttr ) - return 0; + return nullptr; while ( pFootnote && pFootnote->GetMaster() ) pFootnote = pFootnote->GetMaster(); return pFootnote; } - } while ( 0 != (pFrm = aIter.Next()) ); + } while ( nullptr != (pFrm = aIter.Next()) ); - return 0; + return nullptr; } void SwFootnoteBossFrm::RemoveFootnote( const SwContentFrm *pRef, const SwTextFootnote *pAttr, @@ -1713,7 +1713,7 @@ void SwFootnoteBossFrm::CollectFootnotes( const SwContentFrm* _pRef, // previous page SwPageFrm* pPg; for ( SwFrm* pTmp = _pOld; - 0 != ( pPg = static_cast<SwPageFrm*>(pTmp->FindPageFrm()->GetPrev())) + nullptr != ( pPg = static_cast<SwPageFrm*>(pTmp->FindPageFrm()->GetPrev())) && pPg->IsEmptyPage() ; ) { @@ -1734,7 +1734,7 @@ void SwFootnoteBossFrm::CollectFootnotes( const SwContentFrm* _pRef, } } // OD 03.04.2003 #108446# - consider new parameter <_bCollectOnlyPreviousFootnotes> - SwFootnoteBossFrm* pRefBossFrm = NULL; + SwFootnoteBossFrm* pRefBossFrm = nullptr; if ( _bCollectOnlyPreviousFootnotes ) { pRefBossFrm = this; @@ -1808,7 +1808,7 @@ void SwFootnoteBossFrm::_CollectFootnotes( const SwContentFrm* _pRef, while( pNxtFootnote->GetMaster() ) pNxtFootnote = pNxtFootnote->GetMaster(); if( pNxtFootnote == _pFootnote ) - pNxtFootnote = NULL; + pNxtFootnote = nullptr; } } } @@ -1822,7 +1822,7 @@ void SwFootnoteBossFrm::_CollectFootnotes( const SwContentFrm* _pRef, if ( pNxtFootnote == _pFootnote ) { OSL_FAIL( "_CollectFootnote: Vicious circle" ); - pNxtFootnote = 0; + pNxtFootnote = nullptr; } // OD 03.04.2003 #108446# - determine, if found footnote has to be collected. @@ -1902,7 +1902,7 @@ void SwFootnoteBossFrm::_MoveFootnotes( SwFootnoteFrms &rFootnoteArr, bool bCalc // #i21478# - keep last inserted footnote in order to // format the content of the following one. - SwFootnoteFrm* pLastInsertedFootnote = 0L; + SwFootnoteFrm* pLastInsertedFootnote = nullptr; for ( size_t i = 0; i < rFootnoteArr.size(); ++i ) { SwFootnoteFrm *pFootnote = rFootnoteArr[i]; @@ -1994,7 +1994,7 @@ void SwFootnoteBossFrm::_MoveFootnotes( SwFootnoteFrms &rFootnoteArr, bool bCalc pFootnote->Cut(); SwFrm::DestroyFrm(pFootnote); // #i21478# - pFootnote = 0L; + pFootnote = nullptr; } } // #i49383# @@ -2012,7 +2012,7 @@ void SwFootnoteBossFrm::_MoveFootnotes( SwFootnoteFrms &rFootnoteArr, bool bCalc "DelFootnote and Master/Follow?" ); SwFrm::DestroyFrm(pFootnote); // #i21478# - pFootnote = 0L; + pFootnote = nullptr; } // #i21478# @@ -2147,14 +2147,14 @@ void SwFootnoteBossFrm::RearrangeFootnotes( const SwTwips nDeadLine, const bool } SwDoc *pDoc = GetFormat()->GetDoc(); const sal_uLong nFootnotePos = pAttr ? ::lcl_FindFootnotePos( pDoc, pAttr ) : 0; - SwFrm *pCnt = pFootnote ? pFootnote->ContainsAny() : 0; + SwFrm *pCnt = pFootnote ? pFootnote->ContainsAny() : nullptr; if ( pCnt ) { bool bMore = true; - bool bStart = pAttr == 0; // If no attribute is given, process all + bool bStart = pAttr == nullptr; // If no attribute is given, process all // #i49383# - disable unlock of position of // lower objects during format of footnote and footnote content. - SwFootnoteFrm* pLastFootnoteFrm( 0L ); + SwFootnoteFrm* pLastFootnoteFrm( nullptr ); // footnote frame needs to be locked, if <bLock> isn't set. bool bUnlockLastFootnoteFrm( false ); do @@ -2188,7 +2188,7 @@ void SwFootnoteBossFrm::RearrangeFootnotes( const SwTwips nDeadLine, const bool { pLastFootnoteFrm->Cut(); SwFrm::DestroyFrm(pLastFootnoteFrm); - pLastFootnoteFrm = 0L; + pLastFootnoteFrm = nullptr; } } if ( !bLock ) @@ -2237,7 +2237,7 @@ void SwFootnoteBossFrm::RearrangeFootnotes( const SwTwips nDeadLine, const bool // #i49383# OSL_ENSURE( pLastFootnoteFrm == pFootnoteFrm, "<SwFootnoteBossFrm::RearrangeFootnotes(..)> - <pLastFootnoteFrm> != <pFootnoteFrm>" ); - pLastFootnoteFrm = 0L; + pLastFootnoteFrm = nullptr; pFootnoteFrm->Cut(); SwFrm::DestroyFrm(pFootnoteFrm); } @@ -2260,7 +2260,7 @@ void SwFootnoteBossFrm::RearrangeFootnotes( const SwTwips nDeadLine, const bool } } } - SwSectionFrm *pDel = NULL; + SwSectionFrm *pDel = nullptr; if( pCnt->IsSctFrm() ) { SwFrm* pTmp = static_cast<SwSectionFrm*>(pCnt)->ContainsAny(); @@ -2370,15 +2370,15 @@ void SwPageFrm::UpdateFootnoteNum() if( pTmpBoss ) { SwPageFrm* pPage = pTmpBoss->FindPageFrm(); - pFootnote = NULL; + pFootnote = nullptr; lcl_NextFootnoteBoss( pTmpBoss, pPage, false ); - SwFootnoteContFrm *pCont = pTmpBoss ? pTmpBoss->FindNearestFootnoteCont() : NULL; + SwFootnoteContFrm *pCont = pTmpBoss ? pTmpBoss->FindNearestFootnoteCont() : nullptr; if ( pCont ) pFootnote = static_cast<SwFootnoteFrm*>(pCont->Lower()); } } if( pFootnote && pFootnote->GetRef() != pContent ) - pFootnote = NULL; + pFootnote = nullptr; } } } @@ -2402,7 +2402,7 @@ void SwFootnoteBossFrm::SetFootnoteDeadLine( const SwTwips nDeadLine ) else nMaxFootnoteHeight = -(pBody->Frm().*fnRect->fnBottomDist)( nDeadLine ); - const SwViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0; + const SwViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : nullptr; if( pSh && pSh->GetViewOptions()->getBrowseMode() ) nMaxFootnoteHeight += pBody->Grow( LONG_MAX, true ); if ( IsInSct() ) @@ -2440,7 +2440,7 @@ SwTwips SwFootnoteBossFrm::GetVarSpace() const OSL_ENSURE( !Lower() || !Lower()->GetNext() || Lower()->GetNext()-> IsFootnoteContFrm(), "FootnoteContainer expected" ); const SwFootnoteContFrm* pCont = Lower() ? - static_cast<const SwFootnoteContFrm*>(Lower()->GetNext()) : 0; + static_cast<const SwFootnoteContFrm*>(Lower()->GetNext()) : nullptr; if( pCont ) { const SwFootnoteFrm* pFootnote = static_cast<const SwFootnoteFrm*>(pCont->Lower()); @@ -2476,7 +2476,7 @@ SwTwips SwFootnoteBossFrm::GetVarSpace() const nRet = 0; if ( IsPageFrm() ) { - const SwViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0; + const SwViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : nullptr; if( pSh && pSh->GetViewOptions()->getBrowseMode() ) nRet += BROWSE_HEIGHT - Frm().Height(); } @@ -2576,8 +2576,8 @@ bool SwLayoutFrm::MoveLowerFootnotes( SwContentFrm *pStart, SwFootnoteBossFrm *p OSL_ENSURE( pOldBoss->IsInSct() == pNewBoss->IsInSct(), "MoveLowerFootnotes: Section confusion" ); SwFootnoteFrms *pFootnoteArr; - SwLayoutFrm* pNewChief = 0; - SwLayoutFrm* pOldChief = 0; + SwLayoutFrm* pNewChief = nullptr; + SwLayoutFrm* pOldChief = nullptr; bool bFoundCandidate = false; if (pStart && pOldBoss->IsInSct()) @@ -2602,11 +2602,11 @@ bool SwLayoutFrm::MoveLowerFootnotes( SwContentFrm *pStart, SwFootnoteBossFrm *p if( pFootnoteArr->empty() ) { delete pFootnoteArr; - pFootnoteArr = NULL; + pFootnoteArr = nullptr; } } else - pFootnoteArr = NULL; + pFootnoteArr = nullptr; if ( !aFootnoteArr.empty() || pFootnoteArr ) { @@ -2652,13 +2652,13 @@ bool SwContentFrm::MoveFootnoteCntFwd( bool bMakePage, SwFootnoteBossFrm *pOldBo //fix(9538): if the footnote has neighbors behind itself, remove them temporarily SwLayoutFrm *pNxt = static_cast<SwLayoutFrm*>(pFootnote->GetNext()); - SwLayoutFrm *pLst = 0; + SwLayoutFrm *pLst = nullptr; while ( pNxt ) { while ( pNxt->GetNext() ) pNxt = static_cast<SwLayoutFrm*>(pNxt->GetNext()); if ( pNxt == pLst ) - pNxt = 0; + pNxt = nullptr; else { pLst = pNxt; SwContentFrm *pCnt = pNxt->ContainsContent(); @@ -2689,7 +2689,7 @@ bool SwContentFrm::MoveFootnoteCntFwd( bool bMakePage, SwFootnoteBossFrm *pOldBo // If it is a container or the reference differs, create a new footnote and add // it into the container. // Create also a SectionFrame if currently in a area inside a footnote. - SwFootnoteFrm* pTmpFootnote = pNewUpper->IsFootnoteFrm() ? static_cast<SwFootnoteFrm*>(pNewUpper) : 0; + SwFootnoteFrm* pTmpFootnote = pNewUpper->IsFootnoteFrm() ? static_cast<SwFootnoteFrm*>(pNewUpper) : nullptr; if( !pTmpFootnote ) { OSL_ENSURE( pNewUpper->IsFootnoteContFrm(), "New Upper not a FootnoteCont."); @@ -2817,7 +2817,7 @@ SwContentFrm* SwFootnoteFrm::GetRefFromAttr() assert(pAttr && "invalid Attribute"); SwTextNode& rTNd = (SwTextNode&)pAttr->GetTextNode(); SwPosition aPos( rTNd, SwIndex( &rTNd, pAttr->GetStart() )); - SwContentFrm* pCFrm = rTNd.getLayoutFrm( getRootFrm(), 0, &aPos, false ); + SwContentFrm* pCFrm = rTNd.getLayoutFrm( getRootFrm(), nullptr, &aPos, false ); return pCFrm; } @@ -2827,7 +2827,7 @@ SwContentFrm* SwFootnoteFrm::GetRefFromAttr() */ SwContentFrm* SwFootnoteFrm::FindLastContent() { - SwContentFrm* pLastContentFrm( 0L ); + SwContentFrm* pLastContentFrm( nullptr ); // find last lower, which is a content frame or contains content. // hidden text frames, empty sections and empty tables have to be skipped. diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx index 626c8f35e474..fc2fd26b2419 100644 --- a/sw/source/core/layout/hffrm.cxx +++ b/sw/source/core/layout/hffrm.cxx @@ -741,7 +741,7 @@ void SwPageFrm::PrepareFooter() { // Remove footer if already present ::DelFlys( pLay, this ); SwViewShell *pShell; - if ( pLay->GetPrev() && 0 != (pShell = getRootFrm()->GetCurrShell()) && + if ( pLay->GetPrev() && nullptr != (pShell = getRootFrm()->GetCurrShell()) && pShell->VisArea().HasArea() ) pShell->InvalidateWindows( pShell->VisArea() ); pLay->Cut(); diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index e9bedbafa2af..842a6992a30b 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -261,8 +261,8 @@ void SwLayAction::PaintContent( const SwContentFrm *pCnt, SwLayAction::SwLayAction( SwRootFrm *pRt, SwViewShellImp *pI ) : pRoot( pRt ), pImp( pI ), - pOptTab( 0 ), - pWait( 0 ), + pOptTab( nullptr ), + pWait( nullptr ), nPreInvaPage( USHRT_MAX ), nStartTicks( std::clock() ), nInputType( VclInputFlags::NONE ), @@ -283,12 +283,12 @@ SwLayAction::SwLayAction( SwRootFrm *pRt, SwViewShellImp *pI ) : SwLayAction::~SwLayAction() { OSL_ENSURE( !pWait, "Wait object not destroyed" ); - pImp->m_pLayAction = 0; // unregister + pImp->m_pLayAction = nullptr; // unregister } void SwLayAction::Reset() { - pOptTab = 0; + pOptTab = nullptr; nStartTicks = std::clock(); nInputType = VclInputFlags::NONE; nEndPage = nPreInvaPage = nCheckPageNum = USHRT_MAX; @@ -331,7 +331,7 @@ void SwLayAction::Action(OutputDevice* pRenderContext) //TurboMode? Hands-off during idle-format if ( IsPaint() && !IsIdle() && TurboAction() ) { - delete pWait, pWait = 0; + delete pWait, pWait = nullptr; pRoot->ResetTurboFlag(); bActionInProgress = false; pRoot->DeleteEmptySct(); @@ -359,7 +359,7 @@ void SwLayAction::Action(OutputDevice* pRenderContext) } pRoot->DeleteEmptySct(); - delete pWait, pWait = 0; + delete pWait, pWait = nullptr; //Turbo-Action permitted again for all cases. pRoot->ResetTurboFlag(); @@ -482,7 +482,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext) nPercentPageNum = pPage->GetPhyPageNum(); ::SetProgressState( nPercentPageNum, pImp->GetShell()->GetDoc()->GetDocShell()); } - pOptTab = 0; + pOptTab = nullptr; // No Shortcut for Idle or CalcLayout if ( !IsIdle() && !IsComplete() && IsShortCut( pPage ) ) @@ -539,7 +539,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext) ( pPage->IsInvalid() || (IS_FLYS && IS_INVAFLY) ) ) { - PROTOCOL( pPage, PROT_FILE_INIT, 0, 0) + PROTOCOL( pPage, PROT_FILE_INIT, 0, nullptr) XCHECKPAGE; // #i81146# new loop control @@ -783,7 +783,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext) // reset flag for special interrupt content formatting. mbFormatContentOnInterrupt = false; } - pOptTab = 0; + pOptTab = nullptr; if( bNoLoop ) rLayoutAccess.GetLayouter()->EndLoopControl(); } @@ -791,7 +791,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext) bool SwLayAction::_TurboAction( const SwContentFrm *pCnt ) { - const SwPageFrm *pPage = 0; + const SwPageFrm *pPage = nullptr; if ( !pCnt->IsValid() || pCnt->IsCompletePaint() || pCnt->IsRetouche() ) { const SwRect aOldRect( pCnt->UnionFrm( true ) ); @@ -888,12 +888,12 @@ static const SwFrm *lcl_FindFirstInvaLay( const SwFrm *pFrm, long nBottom ) if (lcl_IsInvaLay(pFrm, nBottom)) return pFrm; const SwFrm *pTmp; - if ( 0 != (pTmp = lcl_FindFirstInvaLay( pFrm, nBottom )) ) + if ( nullptr != (pTmp = lcl_FindFirstInvaLay( pFrm, nBottom )) ) return pTmp; } pFrm = pFrm->GetNext(); } - return 0; + return nullptr; } static const SwFrm *lcl_FindFirstInvaContent( const SwLayoutFrm *pLay, long nBottom, @@ -926,7 +926,7 @@ static const SwFrm *lcl_FindFirstInvaContent( const SwLayoutFrm *pLay, long nBot if ( pFly->Frm().Top() <= nBottom ) return pFly; } - const SwFrm *pFrm = lcl_FindFirstInvaContent( pFly, nBottom, 0 ); + const SwFrm *pFrm = lcl_FindFirstInvaContent( pFly, nBottom, nullptr ); if ( pFrm && pFrm->Frm().Bottom() <= nBottom ) return pFrm; } @@ -934,12 +934,12 @@ static const SwFrm *lcl_FindFirstInvaContent( const SwLayoutFrm *pLay, long nBot } } if ( pCnt->Frm().Top() > nBottom && !pCnt->IsInTab() ) - return 0; + return nullptr; pCnt = pCnt->GetNextContentFrm(); if ( !pLay->IsAnLower( pCnt ) ) break; } - return 0; + return nullptr; } // #i37877# - consider drawing objects @@ -960,7 +960,7 @@ static const SwAnchoredObject* lcl_FindFirstInvaObj( const SwPageFrm* _pPage, return pFly; const SwFrm* pTmp; - if ( 0 != (pTmp = lcl_FindFirstInvaContent( pFly, _nBottom, 0 )) && + if ( nullptr != (pTmp = lcl_FindFirstInvaContent( pFly, _nBottom, nullptr )) && pTmp->Frm().Top() <= _nBottom ) return pFly; } @@ -973,7 +973,7 @@ static const SwAnchoredObject* lcl_FindFirstInvaObj( const SwPageFrm* _pPage, } } } - return 0; + return nullptr; } /* Returns True if the page lies directly below or right of the visible area. @@ -1011,7 +1011,7 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage ) } } else - FormatLayout( pSh ? pSh->GetOut() : 0, prPage ); + FormatLayout( pSh ? pSh->GetOut() : nullptr, prPage ); if ( IsAgain() ) return false; } @@ -1038,7 +1038,7 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage ) const SwLayoutFrm* pBody = p2ndPage->FindBodyCont(); if( p2ndPage->IsFootnotePage() && pBody ) pBody = static_cast<const SwLayoutFrm*>(pBody->GetNext()); - pContent = pBody ? pBody->ContainsContent() : 0; + pContent = pBody ? pBody->ContainsContent() : nullptr; while ( p2ndPage && !pContent ) { p2ndPage = static_cast<const SwPageFrm*>(p2ndPage->GetNext()); @@ -1047,7 +1047,7 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage ) pBody = p2ndPage->FindBodyCont(); if( p2ndPage->IsFootnotePage() && pBody ) pBody = static_cast<const SwLayoutFrm*>(pBody->GetNext()); - pContent = pBody ? pBody->ContainsContent() : 0; + pContent = pBody ? pBody->ContainsContent() : nullptr; } } if ( pContent ) @@ -1174,23 +1174,23 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage ) if ( !bRet && bBrowse ) { const long nBottom = rVis.Bottom(); - const SwAnchoredObject* pObj( 0L ); + const SwAnchoredObject* pObj( nullptr ); if ( prPage->GetSortedObjs() && (prPage->IsInvalidFlyLayout() || prPage->IsInvalidFlyContent()) && - 0 != (pObj = lcl_FindFirstInvaObj( prPage, nBottom )) && + nullptr != (pObj = lcl_FindFirstInvaObj( prPage, nBottom )) && pObj->GetObjRect().Top() <= nBottom ) { return false; } - const SwFrm* pFrm( 0L ); + const SwFrm* pFrm( nullptr ); if ( prPage->IsInvalidLayout() && - 0 != (pFrm = lcl_FindFirstInvaLay( prPage, nBottom )) && + nullptr != (pFrm = lcl_FindFirstInvaLay( prPage, nBottom )) && pFrm->Frm().Top() <= nBottom ) { return false; } if ( (prPage->IsInvalidContent() || prPage->IsInvalidFlyInCnt()) && - 0 != (pFrm = lcl_FindFirstInvaContent( prPage, nBottom, 0 )) && + nullptr != (pFrm = lcl_FindFirstInvaContent( prPage, nBottom, nullptr )) && pFrm->Frm().Top() <= nBottom ) { return false; @@ -1627,8 +1627,8 @@ bool SwLayAction::FormatContent( const SwPageFrm *pPage ) { // We do this so we don't have to search later on. const bool bNxtCnt = IsCalcLayout() && !pContent->GetFollow(); - const SwContentFrm *pContentNext = bNxtCnt ? pContent->GetNextContentFrm() : 0; - const SwContentFrm *pContentPrev = pContent->GetPrev() ? pContent->GetPrevContentFrm() : 0; + const SwContentFrm *pContentNext = bNxtCnt ? pContent->GetNextContentFrm() : nullptr; + const SwContentFrm *pContentPrev = pContent->GetPrev() ? pContent->GetPrevContentFrm() : nullptr; const SwLayoutFrm*pOldUpper = pContent->GetUpper(); const SwTabFrm *pTab = pContent->FindTabFrm(); @@ -2032,7 +2032,7 @@ bool SwLayIdle::DoIdleJob( IdleJobType eJob, bool bVisAreaOnly ) else pPage = static_cast<SwPageFrm*>(pRoot->Lower()); - pContentNode = NULL; + pContentNode = nullptr; nTextPos = COMPLETE_STRING; while ( pPage ) @@ -2308,7 +2308,7 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewShellImp *pI ) : SwLayIdle::~SwLayIdle() { - pImp->m_pIdleAct = 0; + pImp->m_pIdleAct = nullptr; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx index acfdc0e475b7..9cdba42517db 100644 --- a/sw/source/core/layout/laycache.cxx +++ b/sw/source/core/layout/laycache.cxx @@ -65,7 +65,7 @@ void SwLayoutCache::Read( SvStream &rStream ) if( !pImpl->Read( rStream ) ) { delete pImpl; - pImpl = 0; + pImpl = nullptr; } } } @@ -173,7 +173,7 @@ void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc ) if( pPage->GetPrev() ) { SwLayoutFrm* pLay = pPage->FindBodyCont(); - SwFrm* pTmp = pLay ? pLay->ContainsAny() : NULL; + SwFrm* pTmp = pLay ? pLay->ContainsAny() : nullptr; // We are only interested in paragraph or table frames, // a section frames contains paragraphs/tables. if( pTmp && pTmp->IsSctFrm() ) @@ -334,7 +334,7 @@ bool SwLayoutCache::CompareLayout( const SwDoc& rDoc ) const return false; const SwLayoutFrm* pLay = pPage->FindBodyCont(); - const SwFrm* pTmp = pLay ? pLay->ContainsAny() : NULL; + const SwFrm* pTmp = pLay ? pLay->ContainsAny() : nullptr; if( pTmp && pTmp->IsSctFrm() ) pTmp = static_cast<const SwSectionFrm*>(pTmp)->ContainsAny(); if( pTmp ) @@ -431,7 +431,7 @@ void SwLayoutCache::ClearImpl() if( !IsLocked() ) { delete pImpl; - pImpl = 0; + pImpl = nullptr; } } @@ -477,7 +477,7 @@ SwLayHelper::SwLayHelper( SwDoc *pD, SwFrm* &rpF, SwFrm* &rpP, SwPageFrm* &rpPg, , nFlyIdx( 0 ) , bFirst( bCache ) { - pImpl = pDoc->GetLayoutCache() ? pDoc->GetLayoutCache()->LockImpl() : NULL; + pImpl = pDoc->GetLayoutCache() ? pDoc->GetLayoutCache()->LockImpl() : nullptr; if( pImpl ) { nMaxParaPerPage = 1000; @@ -492,7 +492,7 @@ SwLayHelper::SwLayHelper( SwDoc *pD, SwFrm* &rpF, SwFrm* &rpP, SwPageFrm* &rpPg, if( nIndex >= pImpl->size() ) { pDoc->GetLayoutCache()->UnlockImpl(); - pImpl = NULL; + pImpl = nullptr; } } else @@ -519,7 +519,7 @@ sal_uLong SwLayHelper::CalcPageCount() { sal_uLong nPgCount; SwLayCacheImpl *pCache = pDoc->GetLayoutCache() ? - pDoc->GetLayoutCache()->LockImpl() : NULL; + pDoc->GetLayoutCache()->LockImpl() : nullptr; if( pCache ) { nPgCount = pCache->size() + 1; @@ -558,7 +558,7 @@ sal_uLong SwLayHelper::CalcPageCount() } if ( nNdCount < 1000 ) nPgCount = 0;// no progress bar for small documents - SwViewShell *pSh = 0; + SwViewShell *pSh = nullptr; if( rpLay && rpLay->getRootFrm() ) pSh = rpLay->getRootFrm()->GetCurrShell(); if( pSh && pSh->GetViewOptions()->getBrowseMode() ) @@ -579,7 +579,7 @@ sal_uLong SwLayHelper::CalcPageCount() */ bool SwLayHelper::CheckInsertPage() { - bool bEnd = 0 == rpPage->GetNext(); + bool bEnd = nullptr == rpPage->GetNext(); const SwAttrSet* pAttr = rpFrm->GetAttrSet(); const SvxFormatBreakItem& rBrk = pAttr->GetBreak(); const SwFormatPageDesc& rDesc = pAttr->GetPageDesc(); @@ -587,7 +587,7 @@ bool SwLayHelper::CheckInsertPage() // is a follow frame! const SwPageDesc* pDesc = rpFrm->IsFlowFrm() && SwFlowFrm::CastFlowFrm( rpFrm )->IsFollow() ? - 0 : + nullptr : rDesc.GetPageDesc(); bool bBrk = nParagraphCnt > nMaxParaPerPage || rbBreakAfter; @@ -790,14 +790,14 @@ bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex ) // Insert new headlines: sal_uInt16 nRowIdx = 0; - SwRowFrm* pHeadline = 0; + SwRowFrm* pHeadline = nullptr; while( nRowIdx < nRepeat ) { OSL_ENSURE( pTab->GetTable()->GetTabLines()[ nRowIdx ], "Table ohne Zeilen?" ); pHeadline = new SwRowFrm( *pTab->GetTable()->GetTabLines()[ nRowIdx ], pTab ); pHeadline->SetRepeatedHeadline( true ); - pHeadline->InsertBefore( pFoll, 0 ); + pHeadline->InsertBefore( pFoll, nullptr ); pHeadline->RegistFlys(); ++nRowIdx; @@ -808,7 +808,7 @@ bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex ) nRows = nRows + nRepeat; } else - pPrv = 0; + pPrv = nullptr; while( pRow && nRowCount < nOfst ) { pRow = pRow->GetNext(); @@ -846,7 +846,7 @@ bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex ) rpPrv->Frm().Height( rpPrv->GetUpper()->Prt().Height() ); bRet = true; - rpPrv = 0; + rpPrv = nullptr; nParagraphCnt = 0; if ( rpActualSection ) @@ -868,7 +868,7 @@ bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex ) bInit = true; } rpActualSection->SetSectionFrm( pSct ); - pSct->InsertBehind( rpLay, 0 ); + pSct->InsertBehind( rpLay, nullptr ); if( bInit ) pSct->Init(); pSct->Frm().Pos() = rpLay->Frm().Pos(); diff --git a/sw/source/core/layout/layouter.cxx b/sw/source/core/layout/layouter.cxx index b710bf8b7ad8..70e2fc8c0920 100644 --- a/sw/source/core/layout/layouter.cxx +++ b/sw/source/core/layout/layouter.cxx @@ -50,7 +50,7 @@ class SwEndnoter SwFootnoteFrms* pEndArr; public: explicit SwEndnoter( SwLayouter* pLay ) - : pMaster( pLay ), pSect( NULL ), pEndArr( NULL ) {} + : pMaster( pLay ), pSect( nullptr ), pEndArr( nullptr ) {} ~SwEndnoter() { delete pEndArr; } void CollectEndnotes( SwSectionFrm* pSct ); void CollectEndnote( SwFootnoteFrm* pFootnote ); @@ -125,7 +125,7 @@ void SwEndnoter::InsertEndnotes() return; if( !pEndArr || pEndArr->empty() ) { - pSect = NULL; + pSect = nullptr; return; } OSL_ENSURE( pSect->Lower() && pSect->Lower()->IsFootnoteBossFrm(), @@ -135,8 +135,8 @@ void SwEndnoter::InsertEndnotes() : static_cast<SwFootnoteBossFrm*>(pSect->Lower()); pBoss->_MoveFootnotes( *pEndArr ); delete pEndArr; - pEndArr = NULL; - pSect = NULL; + pEndArr = nullptr; + pSect = nullptr; } SwLooping::SwLooping( SwPageFrm* pPage ) @@ -203,12 +203,12 @@ void SwLooping::Control( SwPageFrm* pPage ) } SwLayouter::SwLayouter() - : mpEndnoter( NULL ), - mpLooping( NULL ), + : mpEndnoter( nullptr ), + mpLooping( nullptr ), // #i28701# - mpMovedFwdFrms( 0L ), + mpMovedFwdFrms( nullptr ), // #i35911# - mpObjsTmpConsiderWrapInfl( 0L ) + mpObjsTmpConsiderWrapInfl( nullptr ) { } @@ -218,10 +218,10 @@ SwLayouter::~SwLayouter() delete mpLooping; // #i28701# delete mpMovedFwdFrms; - mpMovedFwdFrms = 0L; + mpMovedFwdFrms = nullptr; // #i35911# delete mpObjsTmpConsiderWrapInfl; - mpObjsTmpConsiderWrapInfl = 0L; + mpObjsTmpConsiderWrapInfl = nullptr; } void SwLayouter::_CollectEndnotes( SwSectionFrm* pSect ) @@ -276,7 +276,7 @@ bool SwLayouter::StartLooping( SwPageFrm* pPage ) void SwLayouter::EndLoopControl() { delete mpLooping; - mpLooping = NULL; + mpLooping = nullptr; } void SwLayouter::CollectEndnotes( SwDoc* pDoc, SwSectionFrm* pSect ) diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx index 67ccf0243fc7..b579454fe4f6 100644 --- a/sw/source/core/layout/newfrm.cxx +++ b/sw/source/core/layout/newfrm.cxx @@ -39,11 +39,11 @@ #include <IDocumentFieldsAccess.hxx> #include <DocumentLayoutManager.hxx> -SwLayVout *SwRootFrm::mpVout = 0; +SwLayVout *SwRootFrm::mpVout = nullptr; bool SwRootFrm::mbInPaint = false; bool SwRootFrm::mbNoVirDev = false; -SwCache *SwFrm::mpCache = 0; +SwCache *SwFrm::mpCache = nullptr; long FirstMinusSecond( long nFirst, long nSecond ) { return nFirst - nSecond; } @@ -384,7 +384,7 @@ CurrShell::CurrShell( SwViewShell *pNew ) pRoot->mpCurrShells->insert( this ); } else - pPrev = 0; + pPrev = nullptr; } CurrShell::~CurrShell() @@ -397,7 +397,7 @@ CurrShell::~CurrShell() if ( pRoot->mpCurrShells->empty() && pRoot->mpWaitingCurrShell ) { pRoot->mpCurrShell = pRoot->mpWaitingCurrShell; - pRoot->mpWaitingCurrShell = 0; + pRoot->mpWaitingCurrShell = nullptr; } } } @@ -429,14 +429,14 @@ void SwRootFrm::DeRegisterShell( SwViewShell *pSh ) // Doesn't matter anymore if ( mpWaitingCurrShell == pSh ) - mpWaitingCurrShell = 0; + mpWaitingCurrShell = nullptr; // Remove references for ( SwCurrShells::iterator it = mpCurrShells->begin(); it != mpCurrShells->end(); ++it ) { CurrShell *pC = *it; if (pC->pPrev == pSh) - pC->pPrev = 0; + pC->pPrev = nullptr; } } @@ -452,7 +452,7 @@ void InitCurrShells( SwRootFrm *pRoot ) |*/ SwRootFrm::SwRootFrm( SwFrameFormat *pFormat, SwViewShell * pSh ) : SwLayoutFrm( pFormat->GetDoc()->MakeFrameFormat( - "Root", pFormat ), 0 ), + "Root", pFormat ), nullptr ), maPagesArea(), mnViewWidth( -1 ), mnColumns( 0 ), @@ -469,13 +469,13 @@ SwRootFrm::SwRootFrm( SwFrameFormat *pFormat, SwViewShell * pSh ) : mbCallbackActionEnabled ( false ), mbLayoutFreezed ( false ), mnBrowseWidth( MM50*4 ), //2cm minimum - mpTurbo( 0 ), - mpLastPage( 0 ), + mpTurbo( nullptr ), + mpLastPage( nullptr ), mpCurrShell( pSh ), - mpWaitingCurrShell( 0 ), - mpCurrShells(NULL), - mpDrawPage( 0 ), - mpDestroy( 0 ), + mpWaitingCurrShell( nullptr ), + mpCurrShells(nullptr), + mpDrawPage( nullptr ), + mpDestroy( nullptr ), mnPhyPageNums( 0 ), mnAccessibleShells( 0 ) { @@ -513,10 +513,10 @@ void SwRootFrm::Init( SwFrameFormat* pFormat ) SwNodeIndex aIndex( *pDoc->GetNodes().GetEndOfContent().StartOfSectionNode() ); SwContentNode *pNode = pDoc->GetNodes().GoNextSection( &aIndex, true, false ); // #123067# pNode = 0 can really happen - SwTableNode *pTableNd= pNode ? pNode->FindTableNode() : 0; + SwTableNode *pTableNd= pNode ? pNode->FindTableNode() : nullptr; // Get hold of PageDesc (either via FrameFormat of the first node or the initial one). - SwPageDesc *pDesc = 0; + SwPageDesc *pDesc = nullptr; ::boost::optional<sal_uInt16> oPgNum; if ( pTableNd ) @@ -545,7 +545,7 @@ void SwRootFrm::Init( SwFrameFormat* pFormat ) bool bFirst = !oPgNum || 1 == oPgNum.get(); // Create a page and put it in the layout - SwPageFrm *pPage = ::InsertNewPage( *pDesc, this, bOdd, bFirst, false, false, 0 ); + SwPageFrm *pPage = ::InsertNewPage( *pDesc, this, bOdd, bFirst, false, false, nullptr ); // Find the first page in the Bodytext section. SwLayoutFrm *pLay = pPage->FindBodyCont(); @@ -557,7 +557,7 @@ void SwRootFrm::Init( SwFrameFormat* pFormat ) //Remove masters that haven't been replaced yet from the list. RemoveMasterObjs( mpDrawPage ); if( rSettingAccess.get(DocumentSettingId::GLOBAL_DOCUMENT) ) - rFieldsAccess.UpdateRefFields( NULL ); + rFieldsAccess.UpdateRefFields( nullptr ); //b6433357: Update page fields after loading if ( !mpCurrShell || !mpCurrShell->Imp()->IsUpdateExpFields() ) { @@ -576,7 +576,7 @@ void SwRootFrm::Init( SwFrameFormat* pFormat ) void SwRootFrm::DestroyImpl() { mbTurboAllowed = false; - mpTurbo = 0; + mpTurbo = nullptr; // fdo#39510 crash on document close with footnotes // Object ownership in writer and esp. in layout are a mess: Before the // document/layout split SwDoc and SwRootFrm were essentially one object @@ -586,7 +586,7 @@ void SwRootFrm::DestroyImpl() // also searches backwards to find the master of footnotes, they must be // considered to be owned by the SwRootFrm and also be destroyed here, // before tearing down the (now footnote free) rest of the layout. - RemoveFootnotes(0, false, true); + RemoveFootnotes(nullptr, false, true); if(pBlink) pBlink->FrmDelete( this ); @@ -598,14 +598,14 @@ void SwRootFrm::DestroyImpl() pDoc->GetDocumentLayoutManager().ClearSwLayouterEntries(); } delete mpDestroy; - mpDestroy = 0; + mpDestroy = nullptr; // Remove references for ( SwCurrShells::iterator it = mpCurrShells->begin(); it != mpCurrShells->end(); ++it ) - (*it)->pRoot = 0; + (*it)->pRoot = nullptr; delete mpCurrShells; - mpCurrShells = 0; + mpCurrShells = nullptr; // Some accessible shells are left => problems on second SwFrm::Destroy call assert(0 == mnAccessibleShells); diff --git a/sw/source/core/layout/objectformatter.cxx b/sw/source/core/layout/objectformatter.cxx index 4419d40e031c..1f292a551487 100644 --- a/sw/source/core/layout/objectformatter.cxx +++ b/sw/source/core/layout/objectformatter.cxx @@ -91,7 +91,7 @@ class SwPageNumAndTypeOfAnchors inline SwAnchoredObject* operator[]( sal_uInt32 _nIndex ) { - SwAnchoredObject* bRetObj = 0L; + SwAnchoredObject* bRetObj = nullptr; if ( _nIndex < Count()) { @@ -140,7 +140,7 @@ SwObjectFormatter::SwObjectFormatter( const SwPageFrm& _rPageFrm, mbConsiderWrapOnObjPos( _rPageFrm.GetFormat()->getIDocumentSettingAccess().get(DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION) ), mpLayAction( _pLayAction ), // --> #i26945# - mpPgNumAndTypeOfAnchors( _bCollectPgNumOfAnchors ? new SwPageNumAndTypeOfAnchors() : 0L ) + mpPgNumAndTypeOfAnchors( _bCollectPgNumOfAnchors ? new SwPageNumAndTypeOfAnchors() : nullptr ) { } @@ -154,7 +154,7 @@ SwObjectFormatter* SwObjectFormatter::CreateObjFormatter( const SwPageFrm& _rPageFrm, SwLayAction* _pLayAction ) { - SwObjectFormatter* pObjFormatter = 0L; + SwObjectFormatter* pObjFormatter = nullptr; if ( _rAnchorFrm.IsTextFrm() ) { pObjFormatter = SwObjectFormatterTextFrm::CreateObjFormatter( @@ -397,7 +397,7 @@ void SwObjectFormatter::_FormatObj( SwAnchoredObject& _rAnchoredObj ) bool SwObjectFormatter::_FormatObjsAtFrm( SwTextFrm* _pMasterTextFrm ) { // --> #i26945# - SwFrm* pAnchorFrm( 0L ); + SwFrm* pAnchorFrm( nullptr ); if ( GetAnchorFrm().IsTextFrm() && static_cast<SwTextFrm&>(GetAnchorFrm()).IsFollow() && _pMasterTextFrm ) @@ -489,7 +489,7 @@ bool SwObjectFormatter::_FormatObjsAtFrm( SwTextFrm* _pMasterTextFrm ) */ SwAnchoredObject* SwObjectFormatter::GetCollectedObj( const sal_uInt32 _nIndex ) { - return mpPgNumAndTypeOfAnchors ? (*mpPgNumAndTypeOfAnchors)[_nIndex] : 0L; + return mpPgNumAndTypeOfAnchors ? (*mpPgNumAndTypeOfAnchors)[_nIndex] : nullptr; } /** accessor to 'anchor' page number of collected anchored object diff --git a/sw/source/core/layout/objectformatterlayfrm.cxx b/sw/source/core/layout/objectformatterlayfrm.cxx index 306ccf572cd8..10aca0df807f 100644 --- a/sw/source/core/layout/objectformatterlayfrm.cxx +++ b/sw/source/core/layout/objectformatterlayfrm.cxx @@ -45,10 +45,10 @@ SwObjectFormatterLayFrm* SwObjectFormatterLayFrm::CreateObjFormatter( !_rAnchorLayFrm.IsFlyFrm() ) { OSL_FAIL( "<SwObjectFormatterLayFrm::CreateObjFormatter(..)> - unexpected type of anchor frame " ); - return 0L; + return nullptr; } - SwObjectFormatterLayFrm* pObjFormatter = 0L; + SwObjectFormatterLayFrm* pObjFormatter = nullptr; // create object formatter, if floating screen objects are registered at // given anchor layout frame. diff --git a/sw/source/core/layout/objectformattertxtfrm.cxx b/sw/source/core/layout/objectformattertxtfrm.cxx index 6cd72b03015f..436cfcbc7bc8 100644 --- a/sw/source/core/layout/objectformattertxtfrm.cxx +++ b/sw/source/core/layout/objectformattertxtfrm.cxx @@ -75,10 +75,10 @@ SwObjectFormatterTextFrm* SwObjectFormatterTextFrm::CreateObjFormatter( const SwPageFrm& _rPageFrm, SwLayAction* _pLayAction ) { - SwObjectFormatterTextFrm* pObjFormatter = 0L; + SwObjectFormatterTextFrm* pObjFormatter = nullptr; // determine 'master' of <_rAnchorTextFrm>, if anchor frame is a follow text frame. - SwTextFrm* pMasterOfAnchorFrm = 0L; + SwTextFrm* pMasterOfAnchorFrm = nullptr; if ( _rAnchorTextFrm.IsFollow() ) { pMasterOfAnchorFrm = _rAnchorTextFrm.FindMaster(); @@ -178,7 +178,7 @@ bool SwObjectFormatterTextFrm::DoFormatObj( SwAnchoredObject& _rAnchoredObj, // #i26945# - check conditions for move forward of // anchor text frame // determine, if anchor text frame has previous frame - const bool bDoesAnchorHadPrev = ( mrAnchorTextFrm.GetIndPrev() != 0 ); + const bool bDoesAnchorHadPrev = ( mrAnchorTextFrm.GetIndPrev() != nullptr ); // #i40141# - use new method - it also formats the // section the anchor frame is in. @@ -343,7 +343,7 @@ bool SwObjectFormatterTextFrm::DoFormatObjs() ( !mrAnchorTextFrm.IsFollow() && _AtLeastOneObjIsTmpConsiderWrapInfluence() ) ) ) { - const bool bDoesAnchorHadPrev = ( mrAnchorTextFrm.GetIndPrev() != 0 ); + const bool bDoesAnchorHadPrev = ( mrAnchorTextFrm.GetIndPrev() != nullptr ); // Format anchor text frame after its objects are formatted. // Note: The format of the anchor frame also formats the invalid @@ -357,7 +357,7 @@ bool SwObjectFormatterTextFrm::DoFormatObjs() sal_uInt32 nToPageNum( 0L ); // #i43913# bool bInFollow( false ); - SwAnchoredObject* pObj = 0L; + SwAnchoredObject* pObj = nullptr; if ( !mrAnchorTextFrm.IsFollow() ) { pObj = _GetFirstObjWithMovedFwdAnchor( @@ -521,7 +521,7 @@ SwAnchoredObject* SwObjectFormatterTextFrm::_GetFirstObjWithMovedFwdAnchor( _nWrapInfluenceOnPosition == text::WrapInfluenceOnPosition::ONCE_CONCURRENT, "<SwObjectFormatterTextFrm::_GetFirstObjWithMovedFwdAnchor(..)> - invalid value for parameter <_nWrapInfluenceOnPosition>" ); - SwAnchoredObject* pRetAnchoredObj = 0L; + SwAnchoredObject* pRetAnchoredObj = nullptr; sal_uInt32 i = 0L; for ( ; i < CountOfCollected(); ++i ) @@ -639,7 +639,7 @@ bool SwObjectFormatterTextFrm::CheckMovedFwdCondition( // method <SwObjectFormatterTextFrm::_FormatAnchorFrmForCheckMoveFwd()> // #i44049# - format till a certain lower frame, if provided. static void lcl_FormatContentOfLayoutFrm( SwLayoutFrm* pLayFrm, - SwFrm* pLastLowerFrm = 0L ) + SwFrm* pLastLowerFrm = nullptr ) { SwFrm* pLowerFrm = pLayFrm->GetLower(); while ( pLowerFrm ) diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 6d698bdff1b2..4a43457cceec 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -155,7 +155,7 @@ void SwBodyFrm::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderAt SwPageFrm::SwPageFrm( SwFrameFormat *pFormat, SwFrm* pSib, SwPageDesc *pPgDsc ) : SwFootnoteBossFrm( pFormat, pSib ), - m_pSortedObjs( 0 ), + m_pSortedObjs( nullptr ), m_pDesc( pPgDsc ), m_nPhyPageNum( 0 ) { @@ -178,7 +178,7 @@ SwPageFrm::SwPageFrm( SwFrameFormat *pFormat, SwFrm* pSib, SwPageDesc *pPgDsc ) SwViewShell *pSh = getRootFrm()->GetCurrShell(); const bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode(); - vcl::RenderContext* pRenderContext = pSh ? pSh->GetOut() : 0; + vcl::RenderContext* pRenderContext = pSh ? pSh->GetOut() : nullptr; if ( bBrowseMode ) { Frm().Height( 0 ); @@ -239,16 +239,16 @@ void SwPageFrm::DestroyImpl() for ( size_t i = 0; i < m_pSortedObjs->size(); ++i ) { SwAnchoredObject* pAnchoredObj = (*m_pSortedObjs)[i]; - pAnchoredObj->SetPageFrm( 0L ); + pAnchoredObj->SetPageFrm( nullptr ); } delete m_pSortedObjs; - m_pSortedObjs = 0; // reset to zero to prevent problems when detaching the Flys + m_pSortedObjs = nullptr; // reset to zero to prevent problems when detaching the Flys } if ( !IsEmptyPage() ) //#59184# unnessesary for empty pages { // prevent access to destroyed pages - SwDoc *pDoc = GetFormat() ? GetFormat()->GetDoc() : NULL; + SwDoc *pDoc = GetFormat() ? GetFormat()->GetDoc() : nullptr; if( pDoc && !pDoc->IsInDtor() ) { if ( pSh ) @@ -279,7 +279,7 @@ void SwPageFrm::CheckGrid( bool bInvalidate ) bool bOld = m_bHasGrid; m_bHasGrid = true; SwTextGridItem const*const pGrid(GetGridItem(this)); - m_bHasGrid = 0 != pGrid; + m_bHasGrid = nullptr != pGrid; if( bInvalidate || bOld != m_bHasGrid ) { SwLayoutFrm* pBody = FindBodyCont(); @@ -373,7 +373,7 @@ static void lcl_MakeObjs( const SwFrameFormats &rTable, SwPageFrm *pPage ) if (FLY_AT_PAGE == rAnch.GetAnchorId()) { SwFormatAnchor aAnch( rAnch ); - aAnch.SetAnchor( 0 ); + aAnch.SetAnchor( nullptr ); pFormat->SetFormatAttr( aAnch ); } else @@ -382,8 +382,8 @@ static void lcl_MakeObjs( const SwFrameFormats &rTable, SwPageFrm *pPage ) // is it a border or a SdrObject? bool bSdrObj = RES_DRAWFRMFMT == pFormat->Which(); - SdrObject *pSdrObj = 0; - if ( bSdrObj && 0 == (pSdrObj = pFormat->FindSdrObject()) ) + SdrObject *pSdrObj = nullptr; + if ( bSdrObj && nullptr == (pSdrObj = pFormat->FindSdrObject()) ) { OSL_FAIL( "DrawObject not found." ); pFormat->GetDoc()->DelFrameFormat( pFormat ); @@ -543,7 +543,7 @@ void SwPageFrm::SwClientNotify(const SwModify& rModify, const SfxHint& rHint) SetMaxFootnoteHeight(LONG_MAX); SetColMaxFootnoteHeight(); // here, the page might be destroyed: - static_cast<SwRootFrm*>(GetUpper())->RemoveFootnotes(0, false, true); + static_cast<SwRootFrm*>(GetUpper())->RemoveFootnotes(nullptr, false, true); } else SwClient::SwClientNotify(rModify, rHint); @@ -616,7 +616,7 @@ void SwPageFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, Frm().Width ( std::max( rSz.GetWidth(), long(MINLAY) ) ); if ( GetUpper() ) - static_cast<SwRootFrm*>(GetUpper())->CheckViewLayout( 0, 0 ); + static_cast<SwRootFrm*>(GetUpper())->CheckViewLayout( nullptr, nullptr ); } // cleanup Window if( pSh && pSh->GetWin() && aOldPageFrmRect.HasArea() ) @@ -716,7 +716,7 @@ SwPageDesc *SwPageFrm::FindPageDesc() return pDoc->GetFootnoteInfo().GetPageDesc( *pDoc ); } - SwPageDesc *pRet = 0; + SwPageDesc *pRet = nullptr; //5. const SwViewShell *pSh = getRootFrm()->GetCurrShell(); @@ -755,12 +755,12 @@ SwPageDesc *SwPageFrm::FindPageDesc() // the same page description as its prev, just like after construction // of the empty page. pRet = GetPrev() ? static_cast<SwPageFrm*>(GetPrev())->GetPageDesc() : - GetNext() ? static_cast<SwPageFrm*>(GetNext())->GetPageDesc() : 0; + GetNext() ? static_cast<SwPageFrm*>(GetNext())->GetPageDesc() : nullptr; //2. if ( !pRet ) pRet = GetPrev() ? - static_cast<SwPageFrm*>(GetPrev())->GetPageDesc()->GetFollow() : 0; + static_cast<SwPageFrm*>(GetPrev())->GetPageDesc()->GetFollow() : nullptr; //4. if ( !pRet ) @@ -816,7 +816,7 @@ void SwPageFrm::Cut() { SwFlyFrm* pFly = static_cast<SwFlyAtCntFrm*>(pAnchoredObj); SwPageFrm *pAnchPage = pFly->GetAnchorFrm() ? - pFly->AnchorFrm()->FindPageFrm() : 0; + pFly->AnchorFrm()->FindPageFrm() : nullptr; if ( pAnchPage && (pAnchPage != this) ) { MoveFly( pFly, pAnchPage ); @@ -854,7 +854,7 @@ void SwPageFrm::Cut() RemoveFromLayout(); if ( pRootFrm ) - static_cast<SwRootFrm*>(pRootFrm)->CheckViewLayout( 0, 0 ); + static_cast<SwRootFrm*>(pRootFrm)->CheckViewLayout( nullptr, nullptr ); } void SwPageFrm::Paste( SwFrm* pParent, SwFrm* pSibling ) @@ -898,7 +898,7 @@ void SwPageFrm::Paste( SwFrm* pParent, SwFrm* pSibling ) if ( pSh ) pSh->SetFirstVisPageInvalid(); - getRootFrm()->CheckViewLayout( 0, 0 ); + getRootFrm()->CheckViewLayout( nullptr, nullptr ); } static void lcl_PrepFlyInCntRegister( SwContentFrm *pFrm ) @@ -968,7 +968,7 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, bool bNotifyFields, SwPageFrm** p assert(pStart && "no starting page."); SwViewShell *pSh = pStart->getRootFrm()->GetCurrShell(); - SwViewShellImp *pImp = pSh ? pSh->Imp() : 0; + SwViewShellImp *pImp = pSh ? pSh->Imp() : nullptr; if ( pImp && pImp->IsAction() && !pImp->GetLayAction().IsCheckPages() ) { @@ -1042,7 +1042,7 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, bool bNotifyFields, SwPageFrm** p else if ( pPage->IsEmptyPage() && !pFormatWish && //2. pDesc != pPage->GetPageDesc() ) { - pPage->SetPageDesc( pDesc, 0 ); + pPage->SetPageDesc( pDesc, nullptr ); } else if ( !pPage->IsEmptyPage() && //3. bActOdd != bOdd && @@ -1156,7 +1156,7 @@ namespace bool isDeleteForbidden(const SwPageFrm *pDel) { const SwLayoutFrm* pBody = pDel->FindBodyCont(); - const SwFrm* pBodyContent = pBody ? pBody->Lower() : NULL; + const SwFrm* pBodyContent = pBody ? pBody->Lower() : nullptr; return pBodyContent && pBodyContent->IsDeleteForbidden(); } } @@ -1165,7 +1165,7 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, bool bFootnote ) { SwRootFrm *pRoot = static_cast<SwRootFrm*>(pPrevPage->GetUpper()); SwPageFrm *pSibling = static_cast<SwPageFrm*>(pPrevPage->GetNext()); - SwPageDesc *pDesc = 0; + SwPageDesc *pDesc = nullptr; // insert right (odd) or left (even) page? bool bNextOdd = !pPrevPage->OnRightPage(); @@ -1244,7 +1244,7 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, bool bFootnote ) { CheckPageDescs( pSibling, false ); SwViewShell *pSh = getRootFrm()->GetCurrShell(); - SwViewShellImp *pImp = pSh ? pSh->Imp() : 0; + SwViewShellImp *pImp = pSh ? pSh->Imp() : nullptr; if ( pImp && pImp->IsAction() && !pImp->GetLayAction().IsCheckPages() ) { const sal_uInt16 nNum = pImp->GetLayAction().GetCheckPageNum(); @@ -1322,7 +1322,7 @@ void SwRootFrm::RemoveSuperfluous() // Check the corresponding last page if it is empty and stop loop at the last non-empty page. do { - bool bExistEssentialObjs = ( 0 != pPage->GetSortedObjs() ); + bool bExistEssentialObjs = ( nullptr != pPage->GetSortedObjs() ); if ( bExistEssentialObjs ) { // Only because the page has Flys does not mean that it is needed. If all Flys are @@ -1348,10 +1348,10 @@ void SwRootFrm::RemoveSuperfluous() // OD 19.06.2003 #108784# - optimization: check first, if essential objects // exists. - const SwLayoutFrm* pBody = 0; + const SwLayoutFrm* pBody = nullptr; if ( bExistEssentialObjs || pPage->FindFootnoteCont() || - ( 0 != ( pBody = pPage->FindBodyCont() ) && + ( nullptr != ( pBody = pPage->FindBodyCont() ) && ( pBody->ContainsContent() || // #i47580# // Do not delete page if there's an empty tabframe @@ -1371,7 +1371,7 @@ void SwRootFrm::RemoveSuperfluous() continue; } else - pPage = 0; + pPage = nullptr; } if ( pPage ) @@ -1495,7 +1495,7 @@ void SwRootFrm::AssertPageFlys( SwPageFrm *pPage ) nCnt != pPage->GetSortedObjs()->size(), "Object couldn't be reattached!" ); #else - rFormat.NotifyClients( 0, &rAnch ); + rFormat.NotifyClients( nullptr, &rAnch ); #endif // Do not increment index, in this case continue; @@ -2223,7 +2223,7 @@ const SwPageFrm& SwPageFrm::GetFormatPage() const // e.g. during insertion of a left page at the end of the document right // after a left page in an intermediate state a right empty page does not // have a next page frame. - if ( pRet == 0 ) + if ( pRet == nullptr ) { if ( OnRightPage() ) { @@ -2296,7 +2296,7 @@ SwTextGridItem const* GetGridItem(SwPageFrm const*const pPage) return &rGridItem; } } - return 0; + return nullptr; } sal_uInt16 GetGridWidth(SwTextGridItem const& rG, SwDoc const& rDoc) diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx index 666161e1b86e..cbac1bccf9b5 100644 --- a/sw/source/core/layout/pagedesc.cxx +++ b/sw/source/core/layout/pagedesc.cxx @@ -43,7 +43,7 @@ SwPageDesc::SwPageDesc(const OUString& rName, SwFrameFormat *pFormat, SwDoc *con , m_Left( pDoc->GetAttrPool(), rName, pFormat ) , m_FirstMaster( pDoc->GetAttrPool(), rName, pFormat ) , m_FirstLeft( pDoc->GetAttrPool(), rName, pFormat ) - , m_Depend( this, 0 ) + , m_Depend( this, nullptr ) , m_pFollow( this ) , m_nRegHeight( 0 ) , m_nRegAscent( 0 ) @@ -246,18 +246,18 @@ static const SwFrm* lcl_GetFrmOfNode( const SwNode& rNd ) nFrmType = FRM_TAB; } else - pMod = 0; + pMod = nullptr; Point aNullPt; - return pMod ? ::GetFrmOfModify( 0, *pMod, nFrmType, &aNullPt ) - : 0; + return pMod ? ::GetFrmOfModify( nullptr, *pMod, nFrmType, &aNullPt ) + : nullptr; } const SwPageDesc* SwPageDesc::GetPageDescOfNode(const SwNode& rNd) { - const SwPageDesc* pRet = 0; + const SwPageDesc* pRet = nullptr; const SwFrm* pChkFrm = lcl_GetFrmOfNode( rNd ); - if (pChkFrm && 0 != (pChkFrm = pChkFrm->FindPageFrm())) + if (pChkFrm && nullptr != (pChkFrm = pChkFrm->FindPageFrm())) pRet = static_cast<const SwPageFrm*>(pChkFrm)->GetPageDesc(); return pRet; } @@ -269,7 +269,7 @@ const SwFrameFormat* SwPageDesc::GetPageFormatOfNode( const SwNode& rNd, const SwFrameFormat* pRet; const SwFrm* pChkFrm = lcl_GetFrmOfNode( rNd ); - if( pChkFrm && 0 != ( pChkFrm = pChkFrm->FindPageFrm() )) + if( pChkFrm && nullptr != ( pChkFrm = pChkFrm->FindPageFrm() )) { const SwPageDesc* pPd = bCheckForThisPgDc ? this : static_cast<const SwPageFrm*>(pChkFrm)->GetPageDesc(); @@ -293,7 +293,7 @@ bool SwPageDesc::IsFollowNextPageOfNode( const SwNode& rNd ) const if( GetFollow() && this != GetFollow() ) { const SwFrm* pChkFrm = lcl_GetFrmOfNode( rNd ); - if( pChkFrm && 0 != ( pChkFrm = pChkFrm->FindPageFrm() ) && + if( pChkFrm && nullptr != ( pChkFrm = pChkFrm->FindPageFrm() ) && pChkFrm->IsPageFrm() && ( !pChkFrm->GetNext() || GetFollow() == static_cast<const SwPageFrm*>(pChkFrm->GetNext())->GetPageDesc() )) @@ -307,14 +307,14 @@ SwFrameFormat *SwPageDesc::GetLeftFormat(bool const bFirst) { return (nsUseOnPage::PD_LEFT & m_eUse) ? ((bFirst) ? &m_FirstLeft : &m_Left) - : 0; + : nullptr; } SwFrameFormat *SwPageDesc::GetRightFormat(bool const bFirst) { return (nsUseOnPage::PD_RIGHT & m_eUse) ? ((bFirst) ? &m_FirstMaster : &m_Master) - : 0; + : nullptr; } bool SwPageDesc::IsFirstShared() const @@ -352,7 +352,7 @@ SwPageDesc* SwPageDesc::GetByName(SwDoc& rDoc, const OUString& rName) } } - return 0; + return nullptr; } SwPageFootnoteInfo::SwPageFootnoteInfo() @@ -456,7 +456,7 @@ SwPageDescExt::operator SwPageDesc() const SwPageDesc * pPageDesc = m_pDoc->FindPageDesc(m_sFollow); - if ( 0 != pPageDesc ) + if ( nullptr != pPageDesc ) aResult.SetFollow(pPageDesc); return aResult; diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index b92c6e884839..15a04afdfb02 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -291,16 +291,16 @@ struct SwPaintProperties { SwPaintProperties() : bSFlyMetafile(false) - , pSFlyMetafileOut(0) - , pSGlobalShell(0) - , pSRetoucheFly(0) - , pSRetoucheFly2(0) - , pSFlyOnlyDraw(0) - , pBLines(0) - , pSLines(0) - , pSSubsLines(0) - , pSSpecSubsLines(0) - , pSProgress(0) + , pSFlyMetafileOut(nullptr) + , pSGlobalShell(nullptr) + , pSRetoucheFly(nullptr) + , pSRetoucheFly2(nullptr) + , pSFlyOnlyDraw(nullptr) + , pBLines(nullptr) + , pSLines(nullptr) + , pSSubsLines(nullptr) + , pSSpecSubsLines(nullptr) + , pSProgress(nullptr) , nSPixelSzW(0) , nSPixelSzH(0) , nSHalfPixelSzW(0) @@ -432,18 +432,18 @@ SwSavePaintStatics::SwSavePaintStatics() // Restoring globales to default gProp.bSFlyMetafile = false; - gProp.pSFlyMetafileOut = 0; - gProp.pSRetoucheFly = 0; - gProp.pSRetoucheFly2 = 0; + gProp.pSFlyMetafileOut = nullptr; + gProp.pSRetoucheFly = nullptr; + gProp.pSRetoucheFly2 = nullptr; gProp.nSPixelSzW = gProp.nSPixelSzH = gProp.nSHalfPixelSzW = gProp.nSHalfPixelSzH = gProp.nSMinDistPixelW = gProp.nSMinDistPixelH = 0; gProp.aSScaleX = gProp.aSScaleY = 1.0; - gProp.pBLines = 0; - gProp.pSLines = 0; - gProp.pSSubsLines = 0; - gProp.pSSpecSubsLines = 0L; - gProp.pSProgress = 0; + gProp.pBLines = nullptr; + gProp.pSLines = nullptr; + gProp.pSSubsLines = nullptr; + gProp.pSSpecSubsLines = nullptr; + gProp.pSProgress = nullptr; } SwSavePaintStatics::~SwSavePaintStatics() @@ -606,7 +606,7 @@ lcl_TryMergeBorderLine(BorderLinePrimitive2D const& rThis, return lcl_MergeBorderLines(rOther, rThis, start, end); } } - return 0; + return nullptr; } void BorderLines::AddBorderLine( @@ -635,7 +635,7 @@ SwLineRect::SwLineRect( const SwRect &rRect, const Color *pCol, const SvxBorderS bPainted( false ), nLock( 0 ) { - if ( pCol != NULL ) + if ( pCol != nullptr ) aColor = *pCol; } @@ -778,8 +778,8 @@ void SwLineRects::ConnectEdges( OutputDevice *pOut, SwPaintProperties& propertie SwLineRect &rR2 = *aCheck[k2]; if ( bVert ) { - SwLineRect *pLA = 0; - SwLineRect *pLB = 0; + SwLineRect *pLA = nullptr; + SwLineRect *pLB = nullptr; if ( rR1.Top() < rR2.Top() ) { pLA = &rR1; pLB = &rR2; @@ -819,8 +819,8 @@ void SwLineRects::ConnectEdges( OutputDevice *pOut, SwPaintProperties& propertie } else { - SwLineRect *pLA = 0; - SwLineRect *pLB = 0; + SwLineRect *pLA = nullptr; + SwLineRect *pLB = nullptr; if ( rR1.Left() < rR2.Left() ) { pLA = &rR1; pLB = &rR2; @@ -918,7 +918,7 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects, S { SwRect aNewSubsRect( aSubsLineRect ); aNewSubsRect.Bottom( nTmp ); - aLineRects.push_back( SwLineRect( aNewSubsRect, 0, aSubsLineRect.GetStyle(), 0, + aLineRects.push_back( SwLineRect( aNewSubsRect, nullptr, aSubsLineRect.GetStyle(), nullptr, aSubsLineRect.GetSubColor() ) ); } nTmp = rLine.Bottom()+properties.nSPixelSzH+1; @@ -926,7 +926,7 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects, S { SwRect aNewSubsRect( aSubsLineRect ); aNewSubsRect.Top( nTmp ); - aLineRects.push_back( SwLineRect( aNewSubsRect, 0, aSubsLineRect.GetStyle(), 0, + aLineRects.push_back( SwLineRect( aNewSubsRect, nullptr, aSubsLineRect.GetStyle(), nullptr, aSubsLineRect.GetSubColor() ) ); } aLineRects.erase(aLineRects.begin() + i); @@ -944,7 +944,7 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects, S { SwRect aNewSubsRect( aSubsLineRect ); aNewSubsRect.Right( nTmp ); - aLineRects.push_back( SwLineRect( aNewSubsRect, 0, aSubsLineRect.GetStyle(), 0, + aLineRects.push_back( SwLineRect( aNewSubsRect, nullptr, aSubsLineRect.GetStyle(), nullptr, aSubsLineRect.GetSubColor() ) ); } nTmp = rLine.Right()+properties.nSPixelSzW+1; @@ -952,7 +952,7 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects, S { SwRect aNewSubsRect( aSubsLineRect ); aNewSubsRect.Left( nTmp ); - aLineRects.push_back( SwLineRect( aNewSubsRect, 0, aSubsLineRect.GetStyle(), 0, + aLineRects.push_back( SwLineRect( aNewSubsRect, nullptr, aSubsLineRect.GetStyle(), nullptr, aSubsLineRect.GetSubColor() ) ); } aLineRects.erase(aLineRects.begin() + i); @@ -1016,13 +1016,13 @@ void SwLineRects::PaintLines( OutputDevice *pOut, SwPaintProperties &properties if ( aLineRects.size() != nLastCount ) { // #i16816# tagged pdf support - SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *pOut ); + SwTaggedPDFHelper aTaggedPDFHelper( nullptr, nullptr, nullptr, *pOut ); pOut->Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR ); pOut->SetFillColor(); pOut->SetLineColor(); ConnectEdges( pOut, properties ); - const Color *pLast = 0; + const Color *pLast = nullptr; bool bPaint2nd = false; size_t nMinCount = aLineRects.size(); @@ -1135,7 +1135,7 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut, if ( !aLineRects.empty() ) { // #i16816# tagged pdf support - SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *pOut ); + SwTaggedPDFHelper aTaggedPDFHelper( nullptr, nullptr, nullptr, *pOut ); // Remove all help line that are almost covered (tables) for (size_type i = 0; i != aLineRects.size(); ++i) @@ -1211,7 +1211,7 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut, if ( !rLRect.IsPainted() && !rLRect.IsLocked() ) { - const Color *pCol = 0; + const Color *pCol = nullptr; switch ( rLRect.GetSubColor() ) { case SUBCOL_PAGE: pCol = &SwViewOption::GetDocBoundariesColor(); break; @@ -1519,7 +1519,7 @@ static void lcl_CalcBorderRect( SwRect &rRect, const SwFrm *pFrm, } } - ::SwAlignRect( rRect, properties.pSGlobalShell, properties.pSGlobalShell ? properties.pSGlobalShell->GetOut() : 0 ); + ::SwAlignRect( rRect, properties.pSGlobalShell, properties.pSGlobalShell ? properties.pSGlobalShell->GetOut() : nullptr ); } /** @@ -1703,7 +1703,7 @@ static void lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage, } } if (gProp.pSRetoucheFly == gProp.pSRetoucheFly2) - gProp.pSRetoucheFly = 0; + gProp.pSRetoucheFly = nullptr; } static void lcl_implDrawGraphicBackgrd( const SvxBrushItem& _rBackgrdBrush, @@ -1945,7 +1945,7 @@ bool DrawFillAttributes( basegfx::B2DHomMatrix(), rOut.GetViewTransformation(), aPaintRange, - 0, + nullptr, 0.0, uno::Sequence< beans::PropertyValue >()); drawinglayer::processor2d::BaseProcessor2D* pProcessor = drawinglayer::processor2d::createProcessor2DFromOutputDevice( @@ -1995,7 +1995,7 @@ void DrawGraphic( } OUString referer; SfxObjectShell * sh = rSh.GetDoc()->GetPersist(); - if (sh != 0 && sh->HasName()) { + if (sh != nullptr && sh->HasName()) { referer = sh->GetMedium()->GetName(); } const Graphic* pGrf = pBrush->GetGraphic(referer); @@ -2004,7 +2004,7 @@ void DrawGraphic( ePos = pBrush->GetGraphicPos(); if( pGrf->IsSupportedGraphic() ) // don't the use the specific output device! Bug 94802 - aGrfSize = ::GetGraphicSizeTwip( *pGrf, 0 ); + aGrfSize = ::GetGraphicSizeTwip( *pGrf, nullptr ); } } else @@ -2123,7 +2123,7 @@ void DrawGraphic( aAlignedPaintRect.SVRect(), aGrf.SSize(), Size( aPaintOffset.X(), aPaintOffset.Y() ), - NULL, GraphicManagerDrawFlags::STANDARD, + nullptr, GraphicManagerDrawFlags::STANDARD, ::std::max( 128, static_cast<int>( sqrt(sqrt( Abitmap)) + .5 ) ) ); } // reset clipping at output device @@ -2563,7 +2563,7 @@ void SwTabFrmPainter::HandleFrame( const SwLayoutFrm& rLayoutFrm ) void SwTabFrmPainter::PaintLines(OutputDevice& rDev, const SwRect& rRect) const { // #i16816# tagged pdf support - SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, rDev ); + SwTaggedPDFHelper aTaggedPDFHelper( nullptr, nullptr, nullptr, rDev ); SwLineEntryMap::const_iterator aIter = maHoriLines.begin(); bool bHori = true; @@ -2573,7 +2573,7 @@ void SwTabFrmPainter::PaintLines(OutputDevice& rDev, const SwRect& rRect) const // high contrast mode: // overrides the color of non-subsidiary lines. - const Color* pHCColor = 0; + const Color* pHCColor = nullptr; DrawModeFlags nOldDrawMode = rDev.GetDrawMode(); if( gProp.pSGlobalShell->GetWin() && Application::GetSettings().GetStyleSettings().GetHighContrastMode() ) @@ -2682,7 +2682,7 @@ void SwTabFrmPainter::PaintLines(OutputDevice& rDev, const SwRect& rRect) const } // subsidiary lines - const Color* pTmpColor = 0; + const Color* pTmpColor = nullptr; if (0 == aStyles[ 0 ].GetWidth()) { if (isTableBoundariesEnabled() && gProp.pSGlobalShell->GetWin()) @@ -3029,7 +3029,7 @@ void SwTabFrmPainter::Insert( SwLineEntry& rNew, bool bHori ) const SwTwips nKey = rNew.mnKey; SwLineEntryMap::iterator aMapIter = pLine2->find( nKey ); - SwLineEntrySet* pLineSet = aMapIter != pLine2->end() ? &((*aMapIter).second) : 0; + SwLineEntrySet* pLineSet = aMapIter != pLine2->end() ? &((*aMapIter).second) : nullptr; if ( !pLineSet ) { SwLineEntrySet aNewSet; @@ -3176,7 +3176,7 @@ void SwRootFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, S { OSL_ENSURE( Lower() && Lower()->IsPageFrm(), "Lower of root is no page." ); - PROTOCOL( this, PROT_FILE_INIT, 0, 0) + PROTOCOL( this, PROT_FILE_INIT, 0, nullptr) bool bResetRootPaint = false; SwViewShell *pSh = mpCurrShell; @@ -3196,7 +3196,7 @@ void SwRootFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, S else SwRootFrm::mbInPaint = bResetRootPaint = true; - SwSavePaintStatics *pStatics = 0; + SwSavePaintStatics *pStatics = nullptr; if ( gProp.pSGlobalShell ) pStatics = new SwSavePaintStatics(); gProp.pSGlobalShell = pSh; @@ -3272,7 +3272,7 @@ void SwRootFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, S SwEditWin& rEditWin = pWrtSh->GetView().GetEditWin(); SwFrameControlsManager& rMngr = rEditWin.GetFrameControlsManager(); const SwPageFrm* pHiddenPage = pPage; - while ( pHiddenPage->GetPrev() != NULL ) + while ( pHiddenPage->GetPrev() != nullptr ) { pHiddenPage = static_cast< const SwPageFrm* >( pHiddenPage->GetPrev() ); SwFrameControlPtr pControl = rMngr.GetControl( PageBreak, pHiddenPage ); @@ -3384,7 +3384,7 @@ void SwRootFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, S // collect sub-lines pPage->RefreshSubsidiary( aPaintRect ); // paint special sub-lines - gProp.pSSpecSubsLines->PaintSubsidiary( pSh->GetOut(), NULL, gProp ); + gProp.pSSpecSubsLines->PaintSubsidiary( pSh->GetOut(), nullptr, gProp ); } pPage->Paint( rRenderContext, aPaintRect ); @@ -3519,8 +3519,8 @@ void SwRootFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, S delete pStatics; else { - gProp.pSProgress = 0; - gProp.pSGlobalShell = 0; + gProp.pSProgress = nullptr; + gProp.pSGlobalShell = nullptr; } const_cast<SwRootFrm*>(this)->SetCallbackActionEnabled( bOldAction ); @@ -3590,7 +3590,7 @@ void SwLayoutFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, { // #i16816# tagged pdf support Frm_Info aFrmInfo( *this ); - SwTaggedPDFHelper aTaggedPDFHelper( 0, &aFrmInfo, 0, rRenderContext ); + SwTaggedPDFHelper aTaggedPDFHelper( nullptr, &aFrmInfo, nullptr, rRenderContext ); const SwFrm *pFrm = Lower(); if ( !pFrm ) @@ -3607,7 +3607,7 @@ void SwLayoutFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, pFrm = Lower(); } - const SwPageFrm *pPage = 0; + const SwPageFrm *pPage = nullptr; const bool bWin = gProp.pSGlobalShell->GetWin() != nullptr; while ( IsAnLower( pFrm ) ) @@ -3917,7 +3917,7 @@ void SwPageFrm::PaintDecorators( ) const { const SwFrm* pHeaderFrm = Lower(); if ( !pHeaderFrm->IsHeaderFrm() ) - pHeaderFrm = NULL; + pHeaderFrm = nullptr; long nHeaderYOff = aBodyRect.Top(); Point nOutputOff = rEditWin.LogicToPixel( Point( nXOff, nHeaderYOff ) ); @@ -3963,8 +3963,8 @@ bool SwFlyFrm::IsBackgroundTransparent() const if ( !bBackgroundTransparent && static_cast<const SwFlyFrameFormat*>(GetFormat())->IsBackgroundBrushInherited() ) { - const SvxBrushItem* pBackgrdBrush = 0; - const Color* pSectionTOXColor = 0; + const SvxBrushItem* pBackgrdBrush = nullptr; + const Color* pSectionTOXColor = nullptr; SwRect aDummyRect; //UUUU drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFillAttributes; @@ -4010,7 +4010,7 @@ bool SwFlyFrm::IsPaint( SdrObject *pObj, const SwViewShell *pSh ) { SdrObjUserCall *pUserCall; - if ( 0 == ( pUserCall = GetUserCall(pObj) ) ) + if ( nullptr == ( pUserCall = GetUserCall(pObj) ) ) return true; //Attribute dependent, don't paint for printer or Preview @@ -4022,7 +4022,7 @@ bool SwFlyFrm::IsPaint( SdrObject *pObj, const SwViewShell *pSh ) if ( bPaint ) { //The paint may be prevented by the superior Flys. - SwFrm *pAnch = 0; + SwFrm *pAnch = nullptr; if ( dynamic_cast< const SwFlyDrawObj *>( pObj ) != nullptr ) // i#117962# { bPaint = false; @@ -4050,11 +4050,11 @@ bool SwFlyFrm::IsPaint( SdrObject *pObj, const SwViewShell *pSh ) // OD 13.10.2003 #i19919# - consider 'virtual' drawing objects // OD 2004-03-29 #i26791# SwDrawContact* pDrawContact = dynamic_cast<SwDrawContact*>(pUserCall); - pAnch = pDrawContact ? pDrawContact->GetAnchorFrm(pObj) : NULL; + pAnch = pDrawContact ? pDrawContact->GetAnchorFrm(pObj) : nullptr; if ( pAnch ) { if ( !pAnch->GetValidPosFlag() ) - pAnch = 0; + pAnch = nullptr; else if ( sal_IntPtr(pSh->GetOut()) == sal_IntPtr(pSh->getIDocumentDeviceAccess().getPrinter( false ))) { //HACK: we have to omit some of the objects for printing, @@ -4064,7 +4064,7 @@ bool SwFlyFrm::IsPaint( SdrObject *pObj, const SwViewShell *pSh ) //page over which they float position wise gets printed. const SwPageFrm *pPage = pAnch->FindPageFrm(); if ( !pPage->Frm().IsOver( pObj->GetCurrentBoundRect() ) ) - pAnch = 0; + pAnch = nullptr; } } else @@ -4140,7 +4140,7 @@ void SwFlyFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, Sw const SwPageFrm* pPage = FindPageFrm(); const SwNoTextFrm *pNoText = Lower() && Lower()->IsNoTextFrm() - ? static_cast<const SwNoTextFrm*>(Lower()) : 0; + ? static_cast<const SwNoTextFrm*>(Lower()) : nullptr; bool bIsChart = false; //#i102950# don't paint additional borders for charts //check whether we have a chart @@ -4330,7 +4330,7 @@ void SwFlyFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, Sw // Add subsidiary lines of fly frame and its lowers RefreshLaySubsidiary( pPage, aRect ); // paint subsidiary lines of fly frame and its lowers - gProp.pSSpecSubsLines->PaintSubsidiary( &rRenderContext, NULL, gProp ); + gProp.pSSpecSubsLines->PaintSubsidiary( &rRenderContext, nullptr, gProp ); gProp.pSSubsLines->PaintSubsidiary( &rRenderContext, gProp.pSLines, gProp ); if ( !bSubsLineRectsCreated ) // unlock subsidiary lines @@ -4677,7 +4677,7 @@ void SwFrm::PaintBorderLine( const SwRect& rRect, SwRect aOut( rOutRect ); aOut._Intersection( rRect ); - const SwTabFrm *pTab = IsCellFrm() ? FindTabFrm() : 0; + const SwTabFrm *pTab = IsCellFrm() ? FindTabFrm() : nullptr; sal_uInt8 nSubCol = ( IsCellFrm() || IsRowFrm() ) ? SUBCOL_TAB : ( IsInSct() ? SUBCOL_SECT : ( IsInFly() ? SUBCOL_FLY : SUBCOL_PAGE ) ); @@ -4821,7 +4821,7 @@ static void lcl_SubTopBottom( SwRect& _iorRect, static sal_uInt16 lcl_GetLineWidth( const SvxBorderLine* pLine ) { - if ( pLine != NULL ) + if ( pLine != nullptr ) return pLine->GetScaledWidth(); return 0; @@ -4895,17 +4895,17 @@ static void lcl_MakeBorderLine(SwRect const& rRect, return; double const nExtentLeftStart = (isLeftOrTopBorder == isVertical) - ? lcl_GetExtent(pStartNeighbour, 0) - : lcl_GetExtent(0, pStartNeighbour); + ? lcl_GetExtent(pStartNeighbour, nullptr) + : lcl_GetExtent(nullptr, pStartNeighbour); double const nExtentLeftEnd = (isLeftOrTopBorder == isVertical) - ? lcl_GetExtent(pEndNeighbour, 0) - : lcl_GetExtent(0, pEndNeighbour); + ? lcl_GetExtent(pEndNeighbour, nullptr) + : lcl_GetExtent(nullptr, pEndNeighbour); double const nExtentRightStart = (isLeftOrTopBorder == isVertical) - ? lcl_GetExtent(0, pStartNeighbour) - : lcl_GetExtent(pStartNeighbour, 0); + ? lcl_GetExtent(nullptr, pStartNeighbour) + : lcl_GetExtent(pStartNeighbour, nullptr); double const nExtentRightEnd = (isLeftOrTopBorder == isVertical) - ? lcl_GetExtent(0, pEndNeighbour) - : lcl_GetExtent(pEndNeighbour, 0); + ? lcl_GetExtent(nullptr, pEndNeighbour) + : lcl_GetExtent(pEndNeighbour, nullptr); double const nLeftWidth = rBorder.GetOutWidth(); double const nRightWidth = rBorder.GetInWidth(); @@ -4938,7 +4938,7 @@ static void lcl_PaintLeftRightLine( const bool _bLeft, { const SvxBoxItem& rBox = _rAttrs.GetBox(); const bool bR2L = _rFrm.IsCellFrm() && _rFrm.IsRightToLeft(); - const SvxBorderLine* pLeftRightBorder = 0; + const SvxBorderLine* pLeftRightBorder = nullptr; const SvxBorderLine* pTopBorder = rBox.GetTop(); const SvxBorderLine* pBottomBorder = rBox.GetBottom(); @@ -4983,8 +4983,8 @@ static void lcl_PaintLeftRightLine( const bool _bLeft, ::lcl_ExtendLeftAndRight( aRect, _rFrm, _rAttrs, _rRectFn ); // No Top / bottom borders for joint borders - if ( _rAttrs.JoinedWithPrev( _rFrm ) ) pTopBorder = NULL; - if ( _rAttrs.JoinedWithNext( _rFrm ) ) pBottomBorder = NULL; + if ( _rAttrs.JoinedWithPrev( _rFrm ) ) pTopBorder = nullptr; + if ( _rAttrs.JoinedWithNext( _rFrm ) ) pBottomBorder = nullptr; } if ( !pLeftRightBorder->GetInWidth() ) @@ -5019,7 +5019,7 @@ static void lcl_PaintTopBottomLine( const bool _bTop, SwPaintProperties& properties) { const SvxBoxItem& rBox = _rAttrs.GetBox(); - const SvxBorderLine* pTopBottomBorder = 0; + const SvxBorderLine* pTopBottomBorder = nullptr; if ( _bTop ) { @@ -5223,7 +5223,7 @@ static const SwFrm* lcl_HasNextCell( const SwFrm& rFrm ) } while ( pTmpFrm->IsCellFrm() ); - return 0; + return nullptr; } /** @@ -5301,10 +5301,10 @@ static const SwFrm* lcl_GetCellFrmForBorderAttrs( const SwFrm* _pCellFrm if ( bCellNeedsAttribute ) { // determine, if cell frame has no borders inside the table. - const SwFrm* pNextCell = 0; + const SwFrm* pNextCell = nullptr; bool bNoBordersInside = false; - if ( bCellAtLeftBorder && ( 0 != ( pNextCell = lcl_HasNextCell( *_pCellFrm ) ) ) ) + if ( bCellAtLeftBorder && ( nullptr != ( pNextCell = lcl_HasNextCell( *_pCellFrm ) ) ) ) { SwBorderAttrAccess aAccess( SwFrm::GetCache(), pNextCell ); const SwBorderAttrs &rBorderAttrs = *aAccess.Get(); @@ -5445,8 +5445,8 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage, //-hack has to be used. const bool bb4779636HackActive = true; - const SwFrm* pCellFrmForBottomBorderAttrs = 0; - const SwFrm* pCellFrmForTopBorderAttrs = 0; + const SwFrm* pCellFrmForBottomBorderAttrs = nullptr; + const SwFrm* pCellFrmForTopBorderAttrs = nullptr; bool bFoundCellForTopOrBorderAttrs = false; if ( bb4779636HackActive && IsCellFrm() ) { @@ -6102,7 +6102,7 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin return; // #i16816# tagged pdf support - SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *_pViewShell->GetOut() ); + SwTaggedPDFHelper aTaggedPDFHelper( nullptr, nullptr, nullptr, *_pViewShell->GetOut() ); static vcl::DeleteOnDeinit< drawinglayer::primitive2d::DiscreteShadow > shadowMaskObj ( new drawinglayer::primitive2d::DiscreteShadow( SW_RES( BMP_PAGE_SHADOW_MASK ) )); @@ -6425,7 +6425,7 @@ void SwFrm::PaintBaBo( const SwRect& rRect, const SwPageFrm *pPage, OutputDevice *pOut = gProp.pSGlobalShell->GetOut(); // #i16816# tagged pdf support - SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *pOut ); + SwTaggedPDFHelper aTaggedPDFHelper( nullptr, nullptr, nullptr, *pOut ); // OD 2004-04-23 #116347# pOut->Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR ); @@ -6493,12 +6493,12 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage, SwViewShell *pSh = gProp.pSGlobalShell; // #i16816# tagged pdf support - SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *pSh->GetOut() ); + SwTaggedPDFHelper aTaggedPDFHelper( nullptr, nullptr, nullptr, *pSh->GetOut() ); const SvxBrushItem* pItem; // OD 05.09.2002 #102912# // temporary background brush for a fly frame without a background brush - SvxBrushItem* pTmpBackBrush = 0; + SvxBrushItem* pTmpBackBrush = nullptr; const Color* pCol; SwRect aOrigBackRect; const bool bPageFrm = IsPageFrm(); @@ -6586,7 +6586,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage, if ( aRect.HasArea() ) { - SvxBrushItem* pNewItem = 0; + SvxBrushItem* pNewItem = nullptr; if( pCol ) { @@ -6730,7 +6730,7 @@ void SwPageFrm::RefreshSubsidiary( const SwRect &rRect ) const { // OD 20.12.2002 #106318# - paint special subsidiary lines // and delete its container - gProp.pSSpecSubsLines->PaintSubsidiary( gProp.pSGlobalShell->GetOut(), NULL, gProp ); + gProp.pSSpecSubsLines->PaintSubsidiary( gProp.pSGlobalShell->GetOut(), nullptr, gProp ); DELETEZ( gProp.pSSpecSubsLines ); gProp.pSSubsLines->PaintSubsidiary( gProp.pSGlobalShell->GetOut(), gProp.pSLines, gProp ); @@ -6827,7 +6827,7 @@ static void lcl_RefreshLine( const SwLayoutFrm *pLay, if ( pMyFly ) { aIter.Current( pMyFly->GetVirtDrawObj() ); - while ( 0 != (pMyFly = pMyFly->GetAnchorFrm()->FindFlyFrm()) ) + while ( nullptr != (pMyFly = pMyFly->GetAnchorFrm()->FindFlyFrm()) ) { if ( aIter()->GetOrdNum() > pMyFly->GetVirtDrawObj()->GetOrdNum() ) aIter.Current( pMyFly->GetVirtDrawObj() ); @@ -6839,7 +6839,7 @@ static void lcl_RefreshLine( const SwLayoutFrm *pLay, while ( aIter() ) { const SwVirtFlyDrawObj *pObj = static_cast<const SwVirtFlyDrawObj*>(aIter()); - const SwFlyFrm *pFly = pObj ? pObj->GetFlyFrm() : 0; + const SwFlyFrm *pFly = pObj ? pObj->GetFlyFrm() : nullptr; //I certainly won't avoid myself, even if I'm placed _inside_ the //fly I won't avoid it. @@ -6887,8 +6887,8 @@ static void lcl_RefreshLine( const SwLayoutFrm *pLay, SwRect aRect( aP1, aP2 ); // OD 18.11.2002 #99672# - use parameter <pSubsLines> instead of // global variable <gProp.pSSubsLines>. - pSubsLines->AddLineRect( aRect, 0, table::BorderLineStyle::SOLID, - 0, nSubColor, gProp ); + pSubsLines->AddLineRect( aRect, nullptr, table::BorderLineStyle::SOLID, + nullptr, nSubColor, gProp ); } aP1 = aP2; (aP1.*pDirPt)() += 1; @@ -6991,8 +6991,8 @@ void SwPageFrm::PaintSubsidiaryLines( const SwPageFrm *, if ( !gProp.pSGlobalShell->IsHeaderFooterEdit() ) { const SwFrm* pLay = Lower(); - const SwFrm* pFootnoteCont = NULL; - const SwFrm* pPageBody = NULL; + const SwFrm* pFootnoteCont = nullptr; + const SwFrm* pPageBody = nullptr; while ( pLay && !( pFootnoteCont && pPageBody ) ) { if ( pLay->IsFootnoteContFrm( ) ) @@ -7017,8 +7017,8 @@ void SwColumnFrm::PaintSubsidiaryLines( const SwPageFrm *, const SwRect & ) const { const SwFrm* pLay = Lower(); - const SwFrm* pFootnoteCont = NULL; - const SwFrm* pColBody = NULL; + const SwFrm* pFootnoteCont = nullptr; + const SwFrm* pColBody = nullptr; while ( pLay && !( pFootnoteCont && pColBody ) ) { if ( pLay->IsFootnoteContFrm( ) ) @@ -7194,15 +7194,15 @@ void SwLayoutFrm::PaintSubsidiaryLines( const SwPageFrm *pPage, if ( aOriginal.Left() == aOut.Left() ) { const SwRect aRect( aOut.Pos(), aLB ); - pUsedSubsLines->AddLineRect( aRect, 0, - table::BorderLineStyle::SOLID, 0, nSubColor, gProp ); + pUsedSubsLines->AddLineRect( aRect, nullptr, + table::BorderLineStyle::SOLID, nullptr, nSubColor, gProp ); } // OD 14.11.2002 #104821# - in vertical layout set page/column break at right if ( aOriginal.Right() == nRight ) { const SwRect aRect( aRT, aRB ); - pUsedSubsLines->AddLineRect( aRect, 0, - table::BorderLineStyle::SOLID, 0, nSubColor, gProp ); + pUsedSubsLines->AddLineRect( aRect, nullptr, + table::BorderLineStyle::SOLID, nullptr, nSubColor, gProp ); } } // OD 14.11.2002 #104822# - adjust control for drawing top and bottom lines @@ -7212,14 +7212,14 @@ void SwLayoutFrm::PaintSubsidiaryLines( const SwPageFrm *pPage, { // OD 14.11.2002 #104821# - in horizontal layout set page/column break at top const SwRect aRect( aOut.Pos(), aRT ); - pUsedSubsLines->AddLineRect( aRect, 0, - table::BorderLineStyle::SOLID, 0, nSubColor, gProp ); + pUsedSubsLines->AddLineRect( aRect, nullptr, + table::BorderLineStyle::SOLID, nullptr, nSubColor, gProp ); } if ( aOriginal.Bottom() == nBottom ) { const SwRect aRect( aLB, aRB ); - pUsedSubsLines->AddLineRect( aRect, 0, - table::BorderLineStyle::SOLID, 0, nSubColor, gProp ); + pUsedSubsLines->AddLineRect( aRect, nullptr, + table::BorderLineStyle::SOLID, nullptr, nSubColor, gProp ); } } } @@ -7323,9 +7323,9 @@ const Color SwPageFrm::GetDrawBackgrdColor() const { OUString referer; SwViewShell * sh1 = getRootFrm()->GetCurrShell(); - if (sh1 != 0) { + if (sh1 != nullptr) { SfxObjectShell * sh2 = sh1->GetDoc()->GetPersist(); - if (sh2 != 0 && sh2->HasName()) { + if (sh2 != nullptr && sh2->HasName()) { referer = sh2->GetMedium()->GetName(); } } @@ -7353,8 +7353,8 @@ const Color SwPageFrm::GetDrawBackgrdColor() const /// create/return font used to paint the "empty page" string const vcl::Font& SwPageFrm::GetEmptyPageFont() { - static vcl::Font* pEmptyPgFont = 0; - if ( 0 == pEmptyPgFont ) + static vcl::Font* pEmptyPgFont = nullptr; + if ( nullptr == pEmptyPgFont ) { pEmptyPgFont = new vcl::Font; pEmptyPgFont->SetSize( Size( 0, 80 * 20 )); // == 80 pt @@ -7397,7 +7397,7 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const SwViewShell *pSh = getRootFrm()->GetCurrShell(); // #i16816# tagged pdf support - SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *pSh->GetOut() ); + SwTaggedPDFHelper aTaggedPDFHelper( nullptr, nullptr, nullptr, *pSh->GetOut() ); for ( size_t i = 0; i < aRegion.size(); ++i ) { @@ -7417,11 +7417,11 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const SwViewObjectContactRedirector aSwRedirector( *pSh ); // <-- - pSh->Imp()->PaintLayer( rIDDMA.GetHellId(), 0, + pSh->Imp()->PaintLayer( rIDDMA.GetHellId(), nullptr, aRetouchePart, &aPageBackgrdColor, pPage->IsRightToLeft(), &aSwRedirector ); - pSh->Imp()->PaintLayer( rIDDMA.GetHeavenId(), 0, + pSh->Imp()->PaintLayer( rIDDMA.GetHeavenId(), nullptr, aRetouchePart, &aPageBackgrdColor, pPage->IsRightToLeft(), &aSwRedirector ); @@ -7489,8 +7489,8 @@ bool SwFrm::GetBackgroundBrush( const SwFrm *pFrm = this; SwViewShell *pSh = getRootFrm()->GetCurrShell(); const SwViewOption *pOpt = pSh->GetViewOptions(); - rpBrush = 0; - rpCol = NULL; + rpBrush = nullptr; + rpCol = nullptr; do { if ( pFrm->IsPageFrm() && !pOpt->IsPageBack() ) return false; @@ -7644,7 +7644,7 @@ Graphic SwFlyFrameFormat::MakeGraphic( ImageMap* pMap ) SwIterator<SwFrm,SwFormat> aIter( *this ); SwFrm *pFirst = aIter.First(); SwViewShell *pSh; - if ( pFirst && 0 != ( pSh = pFirst->getRootFrm()->GetCurrShell()) ) + if ( pFirst && nullptr != ( pSh = pFirst->getRootFrm()->GetCurrShell()) ) { SwViewShell *pOldGlobal = gProp.pSGlobalShell; gProp.pSGlobalShell = pSh; @@ -7690,7 +7690,7 @@ Graphic SwFlyFrameFormat::MakeGraphic( ImageMap* pMap ) vcl::Window *pWin = pSh->GetWin(); sal_uInt16 nZoom = pSh->GetViewOptions()->GetZoom(); - ::SetOutDevAndWin( pSh, pDev, 0, 100 ); + ::SetOutDevAndWin( pSh, pDev, nullptr, 100 ); gProp.bSFlyMetafile = true; gProp.pSFlyMetafileOut = pWin; @@ -7705,7 +7705,7 @@ Graphic SwFlyFrameFormat::MakeGraphic( ImageMap* pMap ) // --> OD #i76669# SwViewObjectContactRedirector aSwRedirector( *pSh ); // <-- - pImp->PaintLayer( rIDDMA.GetHellId(), 0, aOut, &aPageBackgrdColor, + pImp->PaintLayer( rIDDMA.GetHellId(), nullptr, aOut, &aPageBackgrdColor, pFlyPage->IsRightToLeft(), &aSwRedirector ); gProp.pSLines->PaintLines( pDev, gProp ); @@ -7713,14 +7713,14 @@ Graphic SwFlyFrameFormat::MakeGraphic( ImageMap* pMap ) pFly->Paint( *pDev, aOut ); gProp.pSLines->PaintLines( pDev, gProp ); // OD 30.08.2002 #102450# - add 3rd parameter - pImp->PaintLayer( rIDDMA.GetHeavenId(), 0, aOut, &aPageBackgrdColor, + pImp->PaintLayer( rIDDMA.GetHeavenId(), nullptr, aOut, &aPageBackgrdColor, pFlyPage->IsRightToLeft(), &aSwRedirector ); gProp.pSLines->PaintLines( pDev, gProp ); DELETEZ( gProp.pSLines ); - gProp.pSFlyOnlyDraw = 0; + gProp.pSFlyOnlyDraw = nullptr; - gProp.pSFlyMetafileOut = 0; + gProp.pSFlyMetafileOut = nullptr; gProp.bSFlyMetafile = false; ::SetOutDevAndWin( pSh, pOld, pWin, nZoom ); @@ -7736,7 +7736,7 @@ Graphic SwFlyFrameFormat::MakeGraphic( ImageMap* pMap ) OSL_ENSURE( pNoteURL, "MakeGraphic: Good Bye, NoteURL." ); pNoteURL->FillImageMap( pMap, pFly->Frm().Pos(), aMap ); delete pNoteURL; - pNoteURL = NULL; + pNoteURL = nullptr; } gProp.pSGlobalShell = pOldGlobal; } diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index 898b85bcc6b4..f32e2b263218 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -190,7 +190,7 @@ void SwSectionFrm::DelEmpty( bool bRemove ) if( !GetFollow() && !pMaster->IsColLocked() ) pMaster->InvalidateSize(); } - SetFollow(0); + SetFollow(nullptr); if( pUp ) { Frm().Height( 0 ); @@ -205,7 +205,7 @@ void SwSectionFrm::DelEmpty( bool bRemove ) } else if( getRootFrm() ) getRootFrm()->InsertEmptySct( this ); - m_pSection = NULL; // like this a reanimation is virtually impossible though + m_pSection = nullptr; // like this a reanimation is virtually impossible though } } @@ -223,7 +223,7 @@ void SwSectionFrm::_Cut( bool bRemove ) SwPageFrm *pPage = FindPageFrm(); InvalidatePage( pPage ); SwFrm *pFrm = GetNext(); - SwFrm* pPrepFrm = NULL; + SwFrm* pPrepFrm = nullptr; while( pFrm && pFrm->IsSctFrm() && !static_cast<SwSectionFrm*>(pFrm)->GetSection() ) pFrm = pFrm->GetNext(); if( pFrm ) @@ -244,7 +244,7 @@ void SwSectionFrm::_Cut( bool bRemove ) { InvalidateNextPos(); // Someone has to take over the retouching: predecessor or Upper - if ( 0 != (pFrm = GetPrev()) ) + if ( nullptr != (pFrm = GetPrev()) ) { pFrm->SetRetouche(); pFrm->Prepare( PREP_WIDOWS_ORPHANS ); if ( pFrm->IsContentFrm() ) @@ -269,7 +269,7 @@ void SwSectionFrm::_Cut( bool bRemove ) { pUp->Cut(); SwFrm::DestroyFrm(pUp); - pUp = NULL; + pUp = nullptr; } } if( pPrepFrm ) @@ -310,7 +310,7 @@ void SwSectionFrm::Paste( SwFrm* pParent, SwFrm* pSibling ) if ( pTableFrm && pSect->IsAnLower( pTableFrm ) ) { - pSect = 0; + pSect = nullptr; } } @@ -324,7 +324,7 @@ void SwSectionFrm::Paste( SwFrm* pParent, SwFrm* pSibling ) // for the content of the next column to be moved correctly to the // newly created pSect by the InsertGroup SwColumnFrm *pCol = static_cast<SwColumnFrm*>(pParent->GetUpper()); - while( !pSibling && 0 != ( pCol = static_cast<SwColumnFrm*>(pCol->GetNext()) ) ) + while( !pSibling && nullptr != ( pCol = static_cast<SwColumnFrm*>(pCol->GetNext()) ) ) pSibling = static_cast<SwLayoutFrm*>(static_cast<SwColumnFrm*>(pCol)->Lower())->Lower(); if( pSibling ) { @@ -332,7 +332,7 @@ void SwSectionFrm::Paste( SwFrm* pParent, SwFrm* pSibling ) // be attached to the pSibling-chain in order to be // taken along SwFrm *pTmp = pSibling; - while ( 0 != ( pCol = static_cast<SwColumnFrm*>(pCol->GetNext()) ) ) + while ( nullptr != ( pCol = static_cast<SwColumnFrm*>(pCol->GetNext()) ) ) { while ( pTmp->GetNext() ) pTmp = pTmp->GetNext(); @@ -347,7 +347,7 @@ void SwSectionFrm::Paste( SwFrm* pParent, SwFrm* pSibling ) // if pParent is decomposed into two parts, its Follow has to be attached // to the new second part pSect->SetFollow( static_cast<SwSectionFrm*>(pParent)->GetFollow() ); - static_cast<SwSectionFrm*>(pParent)->SetFollow( NULL ); + static_cast<SwSectionFrm*>(pParent)->SetFollow( nullptr ); if( pSect->GetFollow() ) pParent->_InvalidateSize(); @@ -364,7 +364,7 @@ void SwSectionFrm::Paste( SwFrm* pParent, SwFrm* pSibling ) } } else - InsertGroupBefore( pParent, pSibling, NULL ); + InsertGroupBefore( pParent, pSibling, nullptr ); _InvalidateAll(); SwPageFrm *pPage = FindPageFrm(); @@ -452,7 +452,7 @@ void SwSectionFrm::MergeNext( SwSectionFrm* pNxt ) ::RestoreContent( pTmp, pLay, pLast, true ); } SetFollow( pNxt->GetFollow() ); - pNxt->SetFollow( NULL ); + pNxt->SetFollow( nullptr ); pNxt->Cut(); SwFrm::DestroyFrm(pNxt); InvalidateSize(); @@ -483,7 +483,7 @@ bool SwSectionFrm::SplitSect( SwFrm* pFrm, bool bApres ) pNew->InsertBehind( pSect->GetUpper(), pSect ); pNew->Init(); SWRECTFN( this ) - (pNew->*fnRect->fnMakePos)( NULL, pSect, true ); + (pNew->*fnRect->fnMakePos)( nullptr, pSect, true ); // OD 25.03.2003 #108339# - restore content: // determine layout frame for restoring content after the initialization // of the section frame. In the section initialization the columns are @@ -493,13 +493,13 @@ bool SwSectionFrm::SplitSect( SwFrm* pFrm, bool bApres ) // Search for last layout frame, e.g. for columned sections. while( pLay->Lower() && pLay->Lower()->IsLayoutFrm() ) pLay = static_cast<SwLayoutFrm*>(pLay->Lower()); - ::RestoreContent( pSav, pLay, NULL, true ); + ::RestoreContent( pSav, pLay, nullptr, true ); } _InvalidateSize(); if( HasFollow() ) { pNew->SetFollow( GetFollow() ); - SetFollow( NULL ); + SetFollow( nullptr ); } return true; } @@ -547,23 +547,23 @@ static SwContentFrm* lcl_GetNextContentFrm( const SwLayoutFrm* pLay, bool bFwd ) } const SwFrm* pFrm = pLay; - SwContentFrm *pContentFrm = 0; + SwContentFrm *pContentFrm = nullptr; bool bGoingUp = true; do { - const SwFrm *p = 0; + const SwFrm *p = nullptr; bool bGoingFwdOrBwd = false; - bool bGoingDown = !bGoingUp && ( 0 != ( p = pFrm->IsLayoutFrm() ? static_cast<const SwLayoutFrm*>(pFrm)->Lower() : 0 ) ); + bool bGoingDown = !bGoingUp && ( nullptr != ( p = pFrm->IsLayoutFrm() ? static_cast<const SwLayoutFrm*>(pFrm)->Lower() : nullptr ) ); if ( !bGoingDown ) { - bGoingFwdOrBwd = ( 0 != ( p = pFrm->IsFlyFrm() ? + bGoingFwdOrBwd = ( nullptr != ( p = pFrm->IsFlyFrm() ? ( bFwd ? static_cast<const SwFlyFrm*>(pFrm)->GetNextLink() : static_cast<const SwFlyFrm*>(pFrm)->GetPrevLink() ) : ( bFwd ? pFrm->GetNext() :pFrm->GetPrev() ) ) ); if ( !bGoingFwdOrBwd ) { - bGoingUp = (0 != (p = pFrm->GetUpper() ) ); + bGoingUp = (nullptr != (p = pFrm->GetUpper() ) ); if ( !bGoingUp ) - return 0; + return nullptr; } } @@ -574,7 +574,7 @@ static SwContentFrm* lcl_GetNextContentFrm( const SwLayoutFrm* pLay, bool bFwd ) p = p->GetNext(); pFrm = p; - } while ( 0 == (pContentFrm = (pFrm->IsContentFrm() ? const_cast<SwContentFrm*>(static_cast<const SwContentFrm*>(pFrm)) : 0) )); + } while ( nullptr == (pContentFrm = (pFrm->IsContentFrm() ? const_cast<SwContentFrm*>(static_cast<const SwContentFrm*>(pFrm)) : nullptr) )); return pContentFrm; } @@ -589,8 +589,8 @@ void SwSectionFrm::MoveContentAndDelete( SwSectionFrm* pDel, bool bSave ) SwFrm* pPrv = pDel->GetPrev(); SwLayoutFrm* pUp = pDel->GetUpper(); // OD 27.03.2003 #i12711# - initialize local pointer variables. - SwSectionFrm* pPrvSct = NULL; - SwSectionFrm* pNxtSct = NULL; + SwSectionFrm* pPrvSct = nullptr; + SwSectionFrm* pNxtSct = nullptr; SwSectionFormat* pParent = static_cast<SwSectionFormat*>(pDel->GetFormat())->GetParent(); if( pDel->IsInTab() && pParent ) { @@ -598,7 +598,7 @@ void SwSectionFrm::MoveContentAndDelete( SwSectionFrm* pDel, bool bSave ) // If we are within a table, we can only have broken up sections that // are inside as well, but not a section that contains the whole table. if( pTab->IsInSct() && pParent == pTab->FindSctFrm()->GetFormat() ) - pParent = NULL; + pParent = nullptr; } // If our Format has a parent, we have probably broken up another // SectionFrm, which has to be checked. To do so we first acquire the @@ -609,18 +609,18 @@ void SwSectionFrm::MoveContentAndDelete( SwSectionFrm* pDel, bool bSave ) if ( pParent ) { SwFrm* pPrvContent = lcl_GetNextContentFrm( pDel, false ); - pPrvSct = pPrvContent ? pPrvContent->FindSctFrm() : NULL; + pPrvSct = pPrvContent ? pPrvContent->FindSctFrm() : nullptr; SwFrm* pNxtContent = lcl_GetNextContentFrm( pDel, true ); - pNxtSct = pNxtContent ? pNxtContent->FindSctFrm() : NULL; + pNxtSct = pNxtContent ? pNxtContent->FindSctFrm() : nullptr; } else { - pParent = NULL; - pPrvSct = pNxtSct = NULL; + pParent = nullptr; + pPrvSct = pNxtSct = nullptr; } // Now the content is put aside and the frame is destroyed - SwFrm *pSave = bSave ? ::SaveContent( pDel ) : NULL; + SwFrm *pSave = bSave ? ::SaveContent( pDel ) : nullptr; bool bOldFootnote = true; if( pSave && pUp->IsFootnoteFrm() ) { @@ -634,9 +634,9 @@ void SwSectionFrm::MoveContentAndDelete( SwSectionFrm* pDel, bool bSave ) if( pNxtSct && pNxtSct->GetFormat() == pParent ) { // Here we can insert outselves at the beginning pUp = FIRSTLEAF( pNxtSct ); - pPrv = NULL; + pPrv = nullptr; if( pPrvSct && !( pPrvSct->GetFormat() == pParent ) ) - pPrvSct = NULL; // In order that nothing is merged + pPrvSct = nullptr; // In order that nothing is merged } else if( pPrvSct && pPrvSct->GetFormat() == pParent ) { // Wonderful, here we can insert ourselves at the end @@ -649,7 +649,7 @@ void SwSectionFrm::MoveContentAndDelete( SwSectionFrm* pDel, bool bSave ) } // In order to perform the insertion after the last one pPrv = pUp->GetLastLower(); - pPrvSct = NULL; // Such that nothing is merged + pPrvSct = nullptr; // Such that nothing is merged } else { @@ -666,9 +666,9 @@ void SwSectionFrm::MoveContentAndDelete( SwSectionFrm* pDel, bool bSave ) SWRECTFN( pUp ) (pPrvSct->*fnRect->fnMakePos)( pUp, pPrv, true ); pUp = FIRSTLEAF( pPrvSct ); - pPrv = NULL; + pPrv = nullptr; } - pPrvSct = NULL; // Such that nothing will be merged + pPrvSct = nullptr; // Such that nothing will be merged } } // The content is going to be inserted.. @@ -762,7 +762,7 @@ const SwSectionFormat* SwSectionFrm::_GetEndSectFormat() const if( dynamic_cast< const SwSectionFormat *>( pFormat->GetRegisteredIn()) != nullptr ) pFormat = static_cast<const SwSectionFormat*>(pFormat->GetRegisteredIn()); else - return NULL; + return nullptr; } return pFormat; } @@ -799,8 +799,8 @@ static void lcl_FindContentFrm( SwContentFrm* &rpContentFrm, SwFootnoteFrm* &rpF SwContentFrm *SwSectionFrm::FindLastContent( sal_uInt8 nMode ) { - SwContentFrm *pRet = NULL; - SwFootnoteFrm *pFootnoteFrm = NULL; + SwContentFrm *pRet = nullptr; + SwFootnoteFrm *pFootnoteFrm = nullptr; SwSectionFrm *pSect = this; if( nMode ) { @@ -863,7 +863,7 @@ static SwFootnoteFrm* lcl_FindEndnote( SwSectionFrm* &rpSect, bool &rbEmpty, "InsertEndnotes: Where's my column?" ); // i73332: Columned section in endnote - SwColumnFrm* pCol = 0; + SwColumnFrm* pCol = nullptr; if(pSect->Lower() && pSect->Lower()->IsColumnFrm()) pCol = static_cast<SwColumnFrm*>(pSect->Lower()); @@ -886,7 +886,7 @@ static SwFootnoteFrm* lcl_FindEndnote( SwSectionFrm* &rpSect, bool &rbEmpty, if( pLayouter ) pLayouter->CollectEndnote( pRet ); else - return 0; + return nullptr; } else return pRet; // Found @@ -897,10 +897,10 @@ static SwFootnoteFrm* lcl_FindEndnote( SwSectionFrm* &rpSect, bool &rbEmpty, pCol = static_cast<SwColumnFrm*>(pCol->GetNext()); } rpSect = pSect; - pSect = pLayouter ? pSect->GetFollow() : NULL; + pSect = pLayouter ? pSect->GetFollow() : nullptr; rbEmpty = true; } - return NULL; + return nullptr; } static void lcl_ColumnRefresh( SwSectionFrm* pSect, bool bFollow ) @@ -927,7 +927,7 @@ static void lcl_ColumnRefresh( SwSectionFrm* pSect, bool bFollow ) if( bFollow ) pSect = pSect->GetFollow(); else - pSect = NULL; + pSect = nullptr; } } @@ -943,7 +943,7 @@ void SwSectionFrm::CollectEndnotes( SwLayouter* pLayouter ) // pSect is the last sectionfrm without endnotes or the this-pointer // the first sectionfrm with endnotes may be destroyed, when the endnotes // is cutted - while( 0 != (pFootnote = lcl_FindEndnote( pSect, bEmpty, pLayouter )) ) + while( nullptr != (pFootnote = lcl_FindEndnote( pSect, bEmpty, pLayouter )) ) pLayouter->CollectEndnote( pFootnote ); if( pLayouter->HasEndnotes() ) lcl_ColumnRefresh( this, true ); @@ -992,7 +992,7 @@ void SwSectionFrm::_CheckClipping( bool bGrow, bool bMaximize ) SwSectionFrm *pSect = this; bool bEmpty = false; SwLayoutFrm* pFootnote = IsEndnAtEnd() ? - lcl_FindEndnote( pSect, bEmpty, NULL ) : NULL; + lcl_FindEndnote( pSect, bEmpty, nullptr ) : nullptr; if( pFootnote ) { pFootnote = pFootnote->FindFootnoteBossFrm(); @@ -1096,7 +1096,7 @@ class ExtraFormatToPositionObjs { // release keep locked position of lower floating screen objects SwPageFrm* pPageFrm = mpSectFrm->FindPageFrm(); - SwSortedObjs* pObjs = pPageFrm ? pPageFrm->GetSortedObjs() : 0L; + SwSortedObjs* pObjs = pPageFrm ? pPageFrm->GetSortedObjs() : nullptr; if ( pObjs ) { for ( size_t i = 0; i < pObjs->size(); ++i ) @@ -1127,10 +1127,10 @@ class ExtraFormatToPositionObjs } } SwLayoutFrm* pLayoutFrm = dynamic_cast<SwLayoutFrm*>(&rFrm); - if ( pLayoutFrm != 0 ) + if ( pLayoutFrm != nullptr ) { SwFrm* pLowerFrm = pLayoutFrm->GetLower(); - while ( pLowerFrm != 0 ) + while ( pLowerFrm != nullptr ) { InitObjs( *pLowerFrm ); @@ -1190,7 +1190,7 @@ class ExtraFormatToPositionObjs // keep locked position of lower floating screen objects SwPageFrm* pPageFrm = mpSectFrm->FindPageFrm(); - SwSortedObjs* pObjs = pPageFrm ? pPageFrm->GetSortedObjs() : 0L; + SwSortedObjs* pObjs = pPageFrm ? pPageFrm->GetSortedObjs() : nullptr; if ( pObjs ) { for ( size_t i = 0; i < pObjs->size(); ++i ) @@ -1223,7 +1223,7 @@ void SwSectionFrm::Format( vcl::RenderContext* pRenderContext, const SwBorderAtt SWRECTFN( this ) if ( !mbValidPrtArea ) { - PROTOCOL( this, PROT_PRTAREA, 0, 0 ) + PROTOCOL( this, PROT_PRTAREA, 0, nullptr ) mbValidPrtArea = true; SwTwips nUpper = CalcUpperSpace(); @@ -1243,7 +1243,7 @@ void SwSectionFrm::Format( vcl::RenderContext* pRenderContext, const SwBorderAtt if ( !mbValidSize ) { - PROTOCOL_ENTER( this, PROT_SIZE, 0, 0 ) + PROTOCOL_ENTER( this, PROT_SIZE, 0, nullptr ) const long nOldHeight = (Frm().*fnRect->fnGetHeight)(); bool bOldLock = IsColLocked(); ColLock(); @@ -1275,7 +1275,7 @@ void SwSectionFrm::Format( vcl::RenderContext* pRenderContext, const SwBorderAtt // which still have a width of 0. const bool bHasColumns = Lower() && Lower()->IsColumnFrm(); if ( bHasColumns && Lower()->GetNext() ) - AdjustColumns( 0, false ); + AdjustColumns( nullptr, false ); if( GetUpper() ) { @@ -1442,7 +1442,7 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage ) // Inside a section, in tables, or sections of headers/footers, there can be only // one column shift be made, one of the above shortcuts should have applied! if( GetUpper()->IsInTab() || FindFooterOrHeader() ) - return 0; + return nullptr; SwSectionFrm *pSect = FindSctFrm(); bool bWrongPage = false; @@ -1466,7 +1466,7 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage ) { SwFrm* pTmp; if( !pSect->GetUpper()->IsColBodyFrm() || - 0 == ( pTmp = pSect->GetUpper()->GetUpper()->GetNext() ) ) + nullptr == ( pTmp = pSect->GetUpper()->GetUpper()->GetNext() ) ) pTmp = pSect->FindPageFrm()->GetNext(); if( pTmp ) // is now the next column or page { @@ -1501,11 +1501,11 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage ) SwLayoutFrm *pLayLeaf; // A shortcut for TabFrms such that not all cells need to be visited if( bWrongPage ) - pLayLeaf = 0; + pLayLeaf = nullptr; else if( IsTabFrm() ) { SwContentFrm* pTmpCnt = static_cast<SwTabFrm*>(this)->FindLastContent(); - pLayLeaf = pTmpCnt ? pTmpCnt->GetUpper() : 0; + pLayLeaf = pTmpCnt ? pTmpCnt->GetUpper() : nullptr; } else { @@ -1517,7 +1517,7 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage ) } } - SwLayoutFrm *pOldLayLeaf = 0; // Such that in case of newly + SwLayoutFrm *pOldLayLeaf = nullptr; // Such that in case of newly // created pages, the search is // not started over at the beginning @@ -1531,7 +1531,7 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage ) SwPageFrm* pNxtPg = pLayLeaf->FindPageFrm(); if ( !bFootnotePage && pNxtPg->IsFootnotePage() ) { // If I reached the end note pages it's over - pLayLeaf = 0; + pLayLeaf = nullptr; continue; } // Once inBody always inBody, don't step into tables and not into other sections @@ -1550,9 +1550,9 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage ) { if( bWrongPage ) break; // there's a column between me and my right page - pLayLeaf = 0; + pLayLeaf = nullptr; bWrongPage = true; - pOldLayLeaf = 0; + pOldLayLeaf = nullptr; continue; } } @@ -1592,7 +1592,7 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage ) pNew->InsertBefore( pLayLeaf, pLayLeaf->Lower() ); pNew->Init(); SWRECTFN( pNew ) - (pNew->*fnRect->fnMakePos)( pLayLeaf, NULL, true ); + (pNew->*fnRect->fnMakePos)( pLayLeaf, nullptr, true ); // If our section frame has a successor then that has to be // moved behind the new Follow of the section frames @@ -1600,7 +1600,7 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage ) if( pTmp && pTmp != pSect->GetFollow() ) { SwFlowFrm* pNxt; - SwContentFrm* pNxtContent = NULL; + SwContentFrm* pNxtContent = nullptr; if( pTmp->IsContentFrm() ) { pNxt = static_cast<SwContentFrm*>(pTmp); @@ -1616,7 +1616,7 @@ SwLayoutFrm *SwFrm::GetNextSctLeaf( MakePageType eMakePage ) OSL_ENSURE( pTmp->IsTabFrm(), "GetNextSctLeaf: Wrong Type" ); pNxt = static_cast<SwTabFrm*>(pTmp); } - while( !pNxtContent && 0 != ( pTmp = pTmp->GetNext() ) ) + while( !pNxtContent && nullptr != ( pTmp = pTmp->GetNext() ) ) { if( pTmp->IsContentFrm() ) pNxtContent = static_cast<SwContentFrm*>(pTmp); @@ -1658,7 +1658,7 @@ SwLayoutFrm *SwFrm::GetPrevSctLeaf( MakePageType ) else if( GetUpper()->IsColBodyFrm() ) pCol = GetUpper()->GetUpper(); else - pCol = NULL; + pCol = nullptr; bool bJump = false; if( pCol ) { @@ -1682,7 +1682,7 @@ SwLayoutFrm *SwFrm::GetPrevSctLeaf( MakePageType ) pCol = static_cast<SwLayoutFrm*>(pCol->Lower()); } else - pCol = NULL; + pCol = nullptr; } if( bJump ) // Did we skip a blank page? @@ -1714,7 +1714,7 @@ SwLayoutFrm *SwFrm::GetPrevSctLeaf( MakePageType ) { SwFrm *pPrv; - if( 0 != ( pPrv = pSect->GetIndPrev() ) ) + if( nullptr != ( pPrv = pSect->GetIndPrev() ) ) { // Mooching, half dead SectionFrms shouldn't confuse us while( pPrv && pPrv->IsSctFrm() && !static_cast<SwSectionFrm*>(pPrv)->GetSection() ) @@ -1728,7 +1728,7 @@ SwLayoutFrm *SwFrm::GetPrevSctLeaf( MakePageType ) const bool bFly = IsInFly(); SwLayoutFrm *pLayLeaf = GetPrevLayoutLeaf(); - SwLayoutFrm *pPrevLeaf = 0; + SwLayoutFrm *pPrevLeaf = nullptr; while ( pLayLeaf ) { @@ -1777,7 +1777,7 @@ SwLayoutFrm *SwFrm::GetPrevSctLeaf( MakePageType ) pLayLeaf = pPrevLeaf; } - SwSectionFrm* pNew = NULL; + SwSectionFrm* pNew = nullptr; // At first go to the end of the layout sheet SwFrm *pTmp = pLayLeaf->Lower(); if( pTmp ) @@ -1797,7 +1797,7 @@ SwLayoutFrm *SwFrm::GetPrevSctLeaf( MakePageType ) if( !pNew ) { pNew = new SwSectionFrm( *pSect, true ); - pNew->InsertBefore( pLayLeaf, NULL ); + pNew->InsertBefore( pLayLeaf, nullptr ); pNew->Init(); SWRECTFN( pNew ) (pNew->*fnRect->fnMakePos)( pLayLeaf, pNew->GetPrev(), true ); @@ -2127,7 +2127,7 @@ bool SwSectionFrm::MoveAllowed( const SwFrm* pFrm) const if( IsInTab() || ( !IsInDocBody() && FindFooterOrHeader() ) ) return false; // It doesn't work in tables/headers/footers if( IsInFly() ) // In column based or chained frames - return 0 != const_cast<SwFrm*>(static_cast<SwFrm const *>(GetUpper()))->GetNextLeaf( MAKEPAGE_NONE ); + return nullptr != const_cast<SwFrm*>(static_cast<SwFrm const *>(GetUpper()))->GetNextLeaf( MAKEPAGE_NONE ); return true; } @@ -2140,7 +2140,7 @@ bool SwSectionFrm::MoveAllowed( const SwFrm* pFrm) const */ SwFrm* SwFrm::_GetIndPrev() const { - SwFrm *pRet = NULL; + SwFrm *pRet = nullptr; // #i79774# // Do not assert, if the frame has a direct previous frame, because it // could be an empty section frame. The caller has to assure, that the @@ -2149,7 +2149,7 @@ SwFrm* SwFrm::_GetIndPrev() const OSL_ENSURE( /*!pPrev &&*/ IsInSct(), "Why?" ); const SwFrm* pSct = GetUpper(); if( !pSct ) - return NULL; + return nullptr; if( pSct->IsSctFrm() ) pRet = pSct->GetIndPrev(); else if( pSct->IsColBodyFrm() && (pSct = pSct->GetUpper()->GetUpper())->IsSctFrm() ) @@ -2163,7 +2163,7 @@ SwFrm* SwFrm::_GetIndPrev() const OSL_ENSURE( pCol->GetLower() && pCol->GetLower()->IsBodyFrm(), "GetIndPrev(): Where's the body?"); if( static_cast<const SwLayoutFrm*>(static_cast<const SwLayoutFrm*>(pCol)->Lower())->Lower() ) - return NULL; + return nullptr; pCol = pCol->GetPrev(); } pRet = pSct->GetIndPrev(); @@ -2180,7 +2180,7 @@ SwFrm* SwFrm::_GetIndNext() OSL_ENSURE( !mpNext && IsInSct(), "Why?" ); SwFrm* pSct = GetUpper(); if( !pSct ) - return NULL; + return nullptr; if( pSct->IsSctFrm() ) return pSct->GetIndNext(); if( pSct->IsColBodyFrm() && (pSct = pSct->GetUpper()->GetUpper())->IsSctFrm() ) @@ -2193,12 +2193,12 @@ SwFrm* SwFrm::_GetIndNext() OSL_ENSURE( pCol->GetLower() && pCol->GetLower()->IsBodyFrm(), "GetIndNext(): Where's the body?"); if( static_cast<SwLayoutFrm*>(static_cast<SwLayoutFrm*>(pCol)->Lower())->Lower() ) - return NULL; + return nullptr; pCol = pCol->GetNext(); } return pSct->GetIndNext(); } - return NULL; + return nullptr; } bool SwSectionFrm::IsDescendantFrom( const SwSectionFormat* pFormat ) const @@ -2439,7 +2439,7 @@ bool SwSectionFrm::ToMaximize( bool bCheckFollow ) const return false; const SwFootnoteContFrm* pCont = ContainsFootnoteCont(); if( !IsEndnAtEnd() ) - return 0 != pCont; + return nullptr != pCont; bool bRet = false; while( pCont && !bRet ) { @@ -2454,7 +2454,7 @@ bool SwSectionFrm::ToMaximize( bool bCheckFollow ) const /// Check every Column for FootnoteContFrms. SwFootnoteContFrm* SwSectionFrm::ContainsFootnoteCont( const SwFootnoteContFrm* pCont ) const { - SwFootnoteContFrm* pRet = NULL; + SwFootnoteContFrm* pRet = nullptr; const SwLayoutFrm* pLay; if( pCont ) { @@ -2465,7 +2465,7 @@ SwFootnoteContFrm* SwSectionFrm::ContainsFootnoteCont( const SwFootnoteContFrm* else if( Lower() && Lower()->IsColumnFrm() ) pLay = static_cast<const SwLayoutFrm*>(Lower()); else - pLay = NULL; + pLay = nullptr; while ( !pRet && pLay ) { if( pLay->Lower() && pLay->Lower()->GetNext() ) diff --git a/sw/source/core/layout/softpagebreak.cxx b/sw/source/core/layout/softpagebreak.cxx index ae8cd8235eba..ca1ad036e209 100644 --- a/sw/source/core/layout/softpagebreak.cxx +++ b/sw/source/core/layout/softpagebreak.cxx @@ -118,7 +118,7 @@ bool SwTableLine::hasSoftPageBreak() const // No soft page break at the first page of the document if( pPage && !pPage->GetPrev() ) return false; - const SwContentFrm* pFirst = pPage ? pPage->FindFirstBodyContent() : NULL; + const SwContentFrm* pFirst = pPage ? pPage->FindFirstBodyContent() : nullptr; // No soft page break for // tables which does not contain the first body content of the page if( !pFirst || !pTab->IsAnLower( pFirst->FindTabFrm() ) ) diff --git a/sw/source/core/layout/sortedobjs.cxx b/sw/source/core/layout/sortedobjs.cxx index 2a6dfb1180f9..d01f6d583af7 100644 --- a/sw/source/core/layout/sortedobjs.cxx +++ b/sw/source/core/layout/sortedobjs.cxx @@ -46,7 +46,7 @@ size_t SwSortedObjs::size() const SwAnchoredObject* SwSortedObjs::operator[]( size_t _nIndex ) const { - SwAnchoredObject* pAnchoredObj = 0L; + SwAnchoredObject* pAnchoredObj = nullptr; if ( _nIndex >= size() ) { diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx index 462aef106c8c..1e1db225397d 100644 --- a/sw/source/core/layout/ssfrm.cxx +++ b/sw/source/core/layout/ssfrm.cxx @@ -226,8 +226,8 @@ void SwFrm::CheckDirChange() } SwFrm* pFrm = static_cast<SwLayoutFrm*>(this)->Lower(); - const SwFormatCol* pCol = NULL; - SwLayoutFrm* pBody = 0; + const SwFormatCol* pCol = nullptr; + SwLayoutFrm* pBody = nullptr; if( pFrm ) { if( IsPageFrm() ) @@ -367,7 +367,7 @@ void SwFrm::DestroyImpl() } } delete mpDrawObjs; - mpDrawObjs = 0; + mpDrawObjs = nullptr; } } @@ -422,7 +422,7 @@ SwContentFrm::SwContentFrm( SwContentNode * const pContent, SwFrm* pSib ) : void SwContentFrm::DestroyImpl() { const SwContentNode* pCNd; - if( 0 != ( pCNd = dynamic_cast<SwContentNode*>( GetRegisteredIn() ) ) && + if( nullptr != ( pCNd = dynamic_cast<SwContentNode*>( GetRegisteredIn() ) ) && !pCNd->GetDoc()->IsInDtor() ) { //Unregister from root if I'm still in turbo there. diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 8378ab0b7323..06cc87d79f9e 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -82,7 +82,7 @@ SwTabFrm::SwTabFrm( SwTable &rTab, SwFrm* pSib ) //Create the lines and insert them. const SwTableLines &rLines = rTab.GetTabLines(); - SwFrm *pTmpPrev = 0; + SwFrm *pTmpPrev = nullptr; for ( size_t i = 0; i < rLines.size(); ++i ) { SwRowFrm *pNew = new SwRowFrm( *rLines[i], this ); @@ -140,7 +140,7 @@ SwTabFrm* SwTabFrm::GetFollowFlowLineFor() if (pPrevTabFrm->HasFollowFlowLine() && pPrevTabFrm->GetFollow() == this) return pPrevTabFrm; } - return NULL; + return nullptr; } void SwTabFrm::DestroyImpl() @@ -157,12 +157,12 @@ void SwTabFrm::DestroyImpl() // deleted. if ( this == pColumnCacheLastTabFrm ) { - pColumnCacheLastTable = NULL; - pColumnCacheLastTabFrm = NULL; - pColumnCacheLastCellFrm= NULL; - pRowCacheLastTable = NULL; - pRowCacheLastTabFrm = NULL; - pRowCacheLastCellFrm= NULL; + pColumnCacheLastTable = nullptr; + pColumnCacheLastTabFrm = nullptr; + pColumnCacheLastCellFrm= nullptr; + pRowCacheLastTable = nullptr; + pRowCacheLastTabFrm = nullptr; + pRowCacheLastCellFrm= nullptr; } SwLayoutFrm::DestroyImpl(); @@ -250,7 +250,7 @@ static SwRowFrm* lcl_InsertNewFollowFlowLine( SwTabFrm& rTab, const SwFrm& rTmpR // additionally the objects are moved 'out of range'. static void lcl_InvalidateLowerObjs( SwLayoutFrm& _rLayoutFrm, const bool _bMoveObjsOutOfRange = false, - SwPageFrm* _pPageFrm = 0L ) + SwPageFrm* _pPageFrm = nullptr ) { // determine page frame, if needed if ( !_pPageFrm ) @@ -427,7 +427,7 @@ static void lcl_MoveRowContent( SwRowFrm& rSourceLine, SwRowFrm& rDestLine ) { // move complete row: pTmpSourceRow->RemoveFromLayout(); - pTmpSourceRow->InsertBefore( pCurrDestCell, 0 ); + pTmpSourceRow->InsertBefore( pCurrDestCell, nullptr ); } pTmpSourceRow = static_cast<SwRowFrm*>(pCurrSourceCell->Lower()); @@ -461,7 +461,7 @@ static void lcl_MoveFootnotes( SwTabFrm& rSource, SwTabFrm& rDest, SwLayoutFrm& { SwFootnoteBossFrm* pOldBoss = rSource.FindFootnoteBossFrm( true ); SwFootnoteBossFrm* pNewBoss = rDest.FindFootnoteBossFrm( true ); - rRowFrm.MoveLowerFootnotes( 0, pOldBoss, pNewBoss, true ); + rRowFrm.MoveLowerFootnotes( nullptr, pOldBoss, pNewBoss, true ); } } @@ -548,7 +548,7 @@ static void lcl_PreprocessRowsInCells( SwTabFrm& rTab, SwRowFrm& rLastLine, pNewRow->SetFollowFlowRow( true ); pNewRow->SetFollowRow( pTmpLastLineRow->GetFollowRow() ); pTmpLastLineRow->SetFollowRow( pNewRow ); - pNewRow->InsertBehind( pCurrFollowFlowLineCell, 0 ); + pNewRow->InsertBehind( pCurrFollowFlowLineCell, nullptr ); pTmpLastLineRow = static_cast<SwRowFrm*>(pTmpLastLineRow->GetNext()); } @@ -558,7 +558,7 @@ static void lcl_PreprocessRowsInCells( SwTabFrm& rTab, SwRowFrm& rLastLine, SwRowFrm* pTmp = static_cast<SwRowFrm*>(pTmpLastLineRow->GetNext()); lcl_MoveFootnotes( rTab, *rTab.GetFollow(), *pTmpLastLineRow ); pTmpLastLineRow->RemoveFromLayout(); - pTmpLastLineRow->InsertBefore( pCurrFollowFlowLineCell, 0 ); + pTmpLastLineRow->InsertBefore( pCurrFollowFlowLineCell, nullptr ); pTmpLastLineRow->Shrink( ( pTmpLastLineRow->Frm().*fnRect->fnGetHeight)() ); pCurrFollowFlowLineCell->Grow( ( pTmpLastLineRow->Frm().*fnRect->fnGetHeight)() ); pTmpLastLineRow = pTmp; @@ -581,7 +581,7 @@ static void lcl_PostprocessRowsInCells( SwTabFrm& rTab, SwRowFrm& rLastLine ) { SwRowFrm* pRowFrm = static_cast<SwRowFrm*>(pCurrMasterCell->GetLastLower()); - if ( NULL != pRowFrm->GetPrev() && !pRowFrm->ContainsContent() ) + if ( nullptr != pRowFrm->GetPrev() && !pRowFrm->ContainsContent() ) { OSL_ENSURE( pRowFrm->GetFollowRow(), "Deleting row frame without follow" ); @@ -642,7 +642,7 @@ static bool lcl_RecalcSplitLine( SwRowFrm& rLastLine, SwRowFrm& rFollowLine, // Lock this tab frame and its follow bool bUnlockMaster = false; bool bUnlockFollow = false; - SwTabFrm* pMaster = rTab.IsFollow() ? rTab.FindMaster() : 0; + SwTabFrm* pMaster = rTab.IsFollow() ? rTab.FindMaster() : nullptr; if ( pMaster && !pMaster->IsJoinLocked() ) { bUnlockMaster = true; @@ -789,7 +789,7 @@ static long lcl_GetMaximumLayoutRowSpan( const SwRowFrm& rRow ) } pCurrentRowFrm = bNextRow ? static_cast<const SwRowFrm*>(pCurrentRowFrm->GetNext() ) : - 0; + nullptr; } return nRet; @@ -1102,7 +1102,7 @@ bool SwTabFrm::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKee *GetTable()->GetTabLines()[ nRowCount ], this ); pHeadline->SetRepeatedHeadline( true ); bDontCreateObjects = false; - pHeadline->InsertBefore( pFoll, 0 ); + pHeadline->InsertBefore( pFoll, nullptr ); SwPageFrm *pPage = pHeadline->FindPageFrm(); const SwFrameFormats *pTable = GetFormat()->GetDoc()->GetSpzFrameFormats(); @@ -1122,8 +1122,8 @@ bool SwTabFrm::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKee } } - SwRowFrm* pLastRow = 0; // will point to the last remaining line in master - SwRowFrm* pFollowRow = 0; // points to either the follow flow line of the + SwRowFrm* pLastRow = nullptr; // will point to the last remaining line in master + SwRowFrm* pFollowRow = nullptr; // points to either the follow flow line of the // first regular line in the follow if ( bSplitRowAllowed ) @@ -1367,7 +1367,7 @@ bool SwContentFrm::CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave, // FME 2007-08-30 #i81146# new loop control int nLoopControlRuns = 0; const int nLoopControlMax = 10; - const SwModify* pLoopControlCond = 0; + const SwModify* pLoopControlCond = nullptr; while ( pCnt && pDontLeave->IsAnLower( pCnt ) ) { @@ -1447,7 +1447,7 @@ static bool lcl_InnerCalcLayout( SwFrm *pFrm, long nBottom, bool _bOnlyRowsAndCells ) { - vcl::RenderContext* pRenderContext = pFrm->getRootFrm()->GetCurrShell() ? pFrm->getRootFrm()->GetCurrShell()->GetOut() : 0; + vcl::RenderContext* pRenderContext = pFrm->getRootFrm()->GetCurrShell() ? pFrm->getRootFrm()->GetCurrShell()->GetOut() : nullptr; // LONG_MAX == nBottom means we have to calculate all bool bAll = LONG_MAX == nBottom; bool bRet = false; @@ -1681,13 +1681,13 @@ SwFrm* sw_FormatNextContentForKeep( SwTabFrm* pTabFrm ) namespace { bool AreAllRowsKeepWithNext( const SwRowFrm* pFirstRowFrm ) { - bool bRet = pFirstRowFrm != 0 && + bool bRet = pFirstRowFrm != nullptr && pFirstRowFrm->ShouldRowKeepWithNext(); - while ( bRet && pFirstRowFrm->GetNext() != 0 ) + while ( bRet && pFirstRowFrm->GetNext() != nullptr ) { pFirstRowFrm = dynamic_cast<const SwRowFrm*>(pFirstRowFrm->GetNext()); - bRet = pFirstRowFrm != 0 && + bRet = pFirstRowFrm != nullptr && pFirstRowFrm->ShouldRowKeepWithNext(); } @@ -1708,7 +1708,7 @@ void SwTabFrm::MakeAll(vcl::RenderContext* pRenderContext) return; } - PROTOCOL_ENTER( this, PROT_MAKEALL, 0, 0 ) + PROTOCOL_ENTER( this, PROT_MAKEALL, 0, nullptr ) LockJoin(); //I don't want to be destroyed on the way. SwLayNotify aNotify( this ); //does the notification in the DTor @@ -1808,7 +1808,7 @@ void SwTabFrm::MakeAll(vcl::RenderContext* pRenderContext) if ( nRepeat ) { if( GetFollow() && !GetFollow()->IsJoinLocked() && - 0 == GetFirstNonHeadlineRow() ) + nullptr == GetFirstNonHeadlineRow() ) { if ( HasFollowFlowLine() ) RemoveFollowFlowLine(); @@ -1878,7 +1878,7 @@ void SwTabFrm::MakeAll(vcl::RenderContext* pRenderContext) aNotify.SetLowersComplete( false ); } SwFrm *pPre; - if ( bKeep || (0 != (pPre = FindPrev()) && + if ( bKeep || (nullptr != (pPre = FindPrev()) && pPre->GetAttrSet()->GetKeep().GetValue()) ) { m_bCalcLowers = true; @@ -1941,7 +1941,7 @@ void SwTabFrm::MakeAll(vcl::RenderContext* pRenderContext) pMaster->InvalidatePos(); } } - SwFootnoteBossFrm *pOldBoss = bFootnotesInDoc ? FindFootnoteBossFrm( true ) : 0; + SwFootnoteBossFrm *pOldBoss = bFootnotesInDoc ? FindFootnoteBossFrm( true ) : nullptr; bool bReformat; if ( MoveBwd( bReformat ) ) { @@ -1949,7 +1949,7 @@ void SwTabFrm::MakeAll(vcl::RenderContext* pRenderContext) bMovedBwd = true; aNotify.SetLowersComplete( false ); if ( bFootnotesInDoc ) - MoveLowerFootnotes( 0, pOldBoss, 0, true ); + MoveLowerFootnotes( nullptr, pOldBoss, nullptr, true ); if ( bReformat || bKeep ) { long nOldTop = (Frm().*fnRect->fnGetTop)(); @@ -1971,7 +1971,7 @@ void SwTabFrm::MakeAll(vcl::RenderContext* pRenderContext) mbValidPrtArea = false; Format( getRootFrm()->GetCurrShell()->GetOut(), pAttrs ); } - lcl_RecalcTable( *this, 0, aNotify ); + lcl_RecalcTable( *this, nullptr, aNotify ); m_bLowersFormatted = true; if ( bKeep && KEEPTAB ) { @@ -1982,7 +1982,7 @@ void SwTabFrm::MakeAll(vcl::RenderContext* pRenderContext) // Thus, find next content, table or section // and, if a section is found, get its first // content. - if ( 0 != sw_FormatNextContentForKeep( this ) && !GetNext() ) + if ( nullptr != sw_FormatNextContentForKeep( this ) && !GetNext() ) { mbValidPos = false; } @@ -2077,7 +2077,7 @@ void SwTabFrm::MakeAll(vcl::RenderContext* pRenderContext) { const bool bMoveFootnotes = bFootnotesInDoc && !GetFollow()->IsJoinLocked(); - SwFootnoteBossFrm *pOldBoss = 0; + SwFootnoteBossFrm *pOldBoss = nullptr; if ( bMoveFootnotes ) pOldBoss = pRowToMove->FindFootnoteBossFrm( true ); @@ -2096,7 +2096,7 @@ void SwTabFrm::MakeAll(vcl::RenderContext* pRenderContext) //Displace the footnotes! if ( bMoveFootnotes ) - if ( static_cast<SwLayoutFrm*>(pRowToMove)->MoveLowerFootnotes( 0, pOldBoss, FindFootnoteBossFrm( true ), true ) ) + if ( static_cast<SwLayoutFrm*>(pRowToMove)->MoveLowerFootnotes( nullptr, pOldBoss, FindFootnoteBossFrm( true ), true ) ) GetUpper()->Calc(pRenderContext); pRowToMove = pNextRow; @@ -2162,7 +2162,7 @@ void SwTabFrm::MakeAll(vcl::RenderContext* pRenderContext) { if (m_bCalcLowers) { - lcl_RecalcTable( *this, 0, aNotify ); + lcl_RecalcTable( *this, nullptr, aNotify ); m_bLowersFormatted = true; m_bCalcLowers = false; } @@ -2185,7 +2185,7 @@ void SwTabFrm::MakeAll(vcl::RenderContext* pRenderContext) { if (m_bCalcLowers && IsValid()) { - lcl_RecalcTable( *this, 0, aNotify ); + lcl_RecalcTable( *this, nullptr, aNotify ); m_bLowersFormatted = true; m_bCalcLowers = false; } @@ -2204,7 +2204,7 @@ void SwTabFrm::MakeAll(vcl::RenderContext* pRenderContext) if (m_bCalcLowers && IsValid()) { - lcl_RecalcTable( *this, 0, aNotify ); + lcl_RecalcTable( *this, nullptr, aNotify ); m_bLowersFormatted = true; m_bCalcLowers = false; if( !IsValid() ) @@ -2495,7 +2495,7 @@ void SwTabFrm::MakeAll(vcl::RenderContext* pRenderContext) (Frm().*fnRect->fnBottomDist)( (GetUpper()->*fnRect->fnGetPrtBottom)()); if ( nDistToUpperPrtBottom >= 0 || bTryToSplit ) { - lcl_RecalcTable( *this, 0, aNotify ); + lcl_RecalcTable( *this, nullptr, aNotify ); m_bLowersFormatted = true; m_bCalcLowers = false; } @@ -2539,7 +2539,7 @@ bool SwTabFrm::CalcFlyOffsets( SwTwips& rUpper, const IDocumentSettingAccess& rIDSA = GetFormat()->getIDocumentSettingAccess(); const bool bWrapAllowed = rIDSA.get(DocumentSettingId::USE_FORMER_TEXT_WRAPPING) || - ( !IsInFootnote() && 0 == FindFooterOrHeader() ); + ( !IsInFootnote() && nullptr == FindFooterOrHeader() ); if ( pPage->GetSortedObjs() && bWrapAllowed ) { @@ -2614,7 +2614,7 @@ bool SwTabFrm::CalcFlyOffsets( SwTwips& rUpper, // #148493# If bConsiderWrapOnObjPos is set, // we want to consider the fly if it is located in the header and // the table is located in the body: - ( !bConsiderWrapOnObjPos || 0 != pThisHeaderFooterFrm || !pFlyHeaderFooterFrm->IsHeaderFrm() ) ) + ( !bConsiderWrapOnObjPos || nullptr != pThisHeaderFooterFrm || !pFlyHeaderFooterFrm->IsHeaderFrm() ) ) bConsiderFly = false; } @@ -3033,7 +3033,7 @@ void SwTabFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) if ( nInvFlags & 0x40 ) _InvalidatePos(); SwFrm *pTmp; - if ( 0 != (pTmp = GetIndNext()) ) + if ( nullptr != (pTmp = GetIndNext()) ) { if ( nInvFlags & 0x04 ) { @@ -3044,7 +3044,7 @@ void SwTabFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) if ( nInvFlags & 0x10 ) pTmp->SetCompletePaint(); } - if ( nInvFlags & 0x08 && 0 != (pTmp = GetPrev()) ) + if ( nInvFlags & 0x08 && nullptr != (pTmp = GetPrev()) ) { pTmp->_InvalidatePrt(); if ( pTmp->IsContentFrm() ) @@ -3072,8 +3072,8 @@ void SwTabFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, if ( IsFollow() ) { // Delete remaining headlines: - SwRowFrm* pLowerRow = 0; - while ( 0 != ( pLowerRow = static_cast<SwRowFrm*>(Lower()) ) && pLowerRow->IsRepeatedHeadline() ) + SwRowFrm* pLowerRow = nullptr; + while ( nullptr != ( pLowerRow = static_cast<SwRowFrm*>(Lower()) ) && pLowerRow->IsRepeatedHeadline() ) { pLowerRow->Cut(); SwFrm::DestroyFrm(pLowerRow); @@ -3219,8 +3219,8 @@ SwContentFrm *SwTabFrm::FindLastContent() const SwFrm* pRow = pRet->GetUpper(); while ( pRow && !pRow->GetUpper()->IsTabFrm() ) pRow = pRow->GetUpper(); - const SwContentFrm* pContentFrm = pRow ? static_cast<const SwLayoutFrm*>(pRow)->ContainsContent() : NULL; - pRet = 0; + const SwContentFrm* pContentFrm = pRow ? static_cast<const SwLayoutFrm*>(pRow)->ContainsContent() : nullptr; + pRet = nullptr; while ( pContentFrm && static_cast<const SwLayoutFrm*>(pRow)->IsAnLower( pContentFrm ) ) { @@ -3375,7 +3375,7 @@ void SwTabFrm::Cut() { InvalidateNextPos(); //Someone has to do the retouch: predecessor or upper - if ( 0 != (pFrm = GetPrev()) ) + if ( nullptr != (pFrm = GetPrev()) ) { pFrm->SetRetouche(); pFrm->Prepare( PREP_WIDOWS_ORPHANS ); pFrm->_InvalidatePos(); @@ -3407,7 +3407,7 @@ void SwTabFrm::Cut() if ( pUp ) { OSL_ENSURE( !pUp->IsFootnoteFrm(), "Table in Footnote." ); - SwSectionFrm *pSct = 0; + SwSectionFrm *pSct = nullptr; // #126020# - adjust check for empty section // #130797# - correct fix #126020# if ( !pUp->Lower() && pUp->IsInSct() && @@ -3503,7 +3503,7 @@ bool SwTabFrm::Prepare( const PrepareHint eHint, const void *, bool ) SwRowFrm::SwRowFrm(const SwTableLine &rLine, SwFrm* pSib, bool bInsertContent) : SwLayoutFrm( rLine.GetFrameFormat(), pSib ) , m_pTabLine( &rLine ) - , m_pFollowRow( 0 ) + , m_pFollowRow( nullptr ) // #i29550# , mnTopMarginForLowers( 0 ) , mnBottomMarginForLowers( 0 ) @@ -3518,7 +3518,7 @@ SwRowFrm::SwRowFrm(const SwTableLine &rLine, SwFrm* pSib, bool bInsertContent) //Create the boxes and insert them. const SwTableBoxes &rBoxes = rLine.GetTabBoxes(); - SwFrm *pTmpPrev = 0; + SwFrm *pTmpPrev = nullptr; for ( size_t i = 0; i < rBoxes.size(); ++i ) { SwCellFrm *pNew = new SwCellFrm( *rBoxes[i], this, bInsertContent ); @@ -3552,7 +3552,7 @@ void SwRowFrm::RegistFlys( SwPageFrm *pPage ) void SwRowFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) { bool bAttrSetChg = pNew && RES_ATTRSET_CHG == pNew->Which(); - const SfxPoolItem *pItem = 0; + const SfxPoolItem *pItem = nullptr; if( bAttrSetChg ) { @@ -3601,7 +3601,7 @@ long CalcHeightWithFlys( const SwFrm *pFrm ) while( pTmp ) { // #i26945# - consider follow text frames - const SwSortedObjs* pObjs( 0L ); + const SwSortedObjs* pObjs( nullptr ); bool bIsFollow( false ); if ( pTmp->IsTextFrm() && static_cast<const SwTextFrm*>(pTmp)->IsFollow() ) { @@ -3613,7 +3613,7 @@ long CalcHeightWithFlys( const SwFrm *pFrm ) if ( pTmpFrm->GetPrev() && pTmpFrm->GetPrev()->IsTextFrm() && static_cast<const SwTextFrm*>(pTmpFrm->GetPrev())->GetFollow() && static_cast<const SwTextFrm*>(pTmpFrm->GetPrev())->GetFollow() != pTmp ) - pMaster = 0; + pMaster = nullptr; else pMaster = pTmpFrm->FindMaster(); @@ -3728,7 +3728,7 @@ static SwTwips lcl_CalcTopAndBottomMargin( const SwLayoutFrm& rCell, const SwBor // cell height. static SwTwips lcl_CalcMinCellHeight( const SwLayoutFrm *_pCell, const bool _bConsiderObjs, - const SwBorderAttrs *pAttrs = 0 ) + const SwBorderAttrs *pAttrs = nullptr ) { SWRECTFN( _pCell ) SwTwips nHeight = 0; @@ -3958,7 +3958,7 @@ void SwRowFrm::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderAtt const sal_uInt16 nBottomLineSize = lcl_GetBottomLineSize( *this ); const sal_uInt16 nBottomLineDist = lcl_GetBottomLineDist( *this ); - const SwRowFrm* pPreviousRow = 0; + const SwRowFrm* pPreviousRow = nullptr; // #i32456# // In order to calculate the top printing area for the lower cell @@ -3967,7 +3967,7 @@ void SwRowFrm::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderAtt // of this row. The best way to find the 'previous' row is to // use the table structure: const SwTable* pTable = pTabFrm->GetTable(); - const SwTableLine* pPrevTabLine = 0; + const SwTableLine* pPrevTabLine = nullptr; const SwRowFrm* pTmpRow = this; while ( pTmpRow && !pPrevTabLine ) @@ -3992,7 +3992,7 @@ void SwRowFrm::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderAtt pTmpRow = pTmpRow->GetUpper()->GetUpper() && pTmpRow->GetUpper()->GetUpper()->IsRowFrm() ? static_cast<const SwRowFrm*>( pTmpRow->GetUpper()->GetUpper() ) : - 0; + nullptr; } } @@ -4107,7 +4107,7 @@ void SwRowFrm::AdjustCells( const SwTwips nHeight, const bool bHeight ) while ( pFrm ) { - SwFrm* pNotify = 0; + SwFrm* pNotify = nullptr; SwCellFrm* pCellFrm = static_cast<SwCellFrm*>(pFrm); @@ -4128,8 +4128,8 @@ void SwRowFrm::AdjustCells( const SwTwips nHeight, const bool bHeight ) } } - SwCellFrm* pToAdjust = 0; - SwFrm* pToAdjustRow = 0; + SwCellFrm* pToAdjust = nullptr; + SwFrm* pToAdjustRow = nullptr; // If current frame is covered frame, we still want to adjust the // height of the cell starting the row span @@ -4412,7 +4412,7 @@ SwCellFrm::SwCellFrm(const SwTableBox &rBox, SwFrm* pSib, bool bInsertContent) else { const SwTableLines &rLines = rBox.GetTabLines(); - SwFrm *pTmpPrev = 0; + SwFrm *pTmpPrev = nullptr; for ( size_t i = 0; i < rLines.size(); ++i ) { SwRowFrm *pNew = new SwRowFrm( *rLines[i], this, bInsertContent ); @@ -4738,7 +4738,7 @@ void SwCellFrm::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderAt // 1. sum of widths of cells up to this cell (in model) const SwTableLine* pTabLine = GetTabBox()->GetUpper(); const SwTableBoxes& rBoxes = pTabLine->GetTabBoxes(); - const SwTableBox* pTmpBox = 0; + const SwTableBox* pTmpBox = nullptr; SwTwips nSumWidth = 0; size_t i = 0; @@ -4823,11 +4823,11 @@ void SwCellFrm::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderAt // From now on, all operations are related to the table cell. SWREFRESHFN( this ) - SwPageFrm* pPg = 0; + SwPageFrm* pPg = nullptr; if ( !FindTabFrm()->IsRebuildLastLine() && text::VertOrientation::NONE != rOri.GetVertOrient() && // #158225# no vertical alignment of covered cells !IsCoveredCell() && - (pPg = FindPageFrm())!=NULL ) + (pPg = FindPageFrm())!=nullptr ) { if ( !Lower()->IsContentFrm() && !Lower()->IsSctFrm() && !Lower()->IsTabFrm() ) { @@ -4922,7 +4922,7 @@ void SwCellFrm::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderAt void SwCellFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) { bool bAttrSetChg = pNew && RES_ATTRSET_CHG == pNew->Which(); - const SfxPoolItem *pItem = 0; + const SfxPoolItem *pItem = nullptr; if( bAttrSetChg ) static_cast<const SwAttrSetChg*>(pNew)->GetChgSet()->GetItemState( RES_VERT_ORIENT, false, &pItem); @@ -4993,7 +4993,7 @@ long SwCellFrm::GetLayoutRowSpan() const if ( nRet < 1 ) { const SwFrm* pRow = GetUpper(); - const SwTabFrm* pTab = pRow ? static_cast<const SwTabFrm*>(pRow->GetUpper()) : NULL; + const SwTabFrm* pTab = pRow ? static_cast<const SwTabFrm*>(pRow->GetUpper()) : nullptr; if ( pTab && pTab->IsFollow() && pRow == pTab->GetFirstNonHeadlineRow() ) nRet = -nRet; @@ -5186,7 +5186,7 @@ static SwTwips lcl_CalcHeightOfFirstContentLine( const SwRowFrm& rSourceLine ) ( !pTmp->IsTextFrm() || !static_cast<const SwTextFrm*>(pTmp)->IsFollow() ) ) { - nTmpHeight += SwFlowFrm::CastFlowFrm(pTmp)->CalcUpperSpace( NULL, pLast); + nTmpHeight += SwFlowFrm::CastFlowFrm(pTmp)->CalcUpperSpace( nullptr, pLast); nTmpHeight += SwFlowFrm::CastFlowFrm(pTmp)->CalcLowerSpace(); } // #115759# - consider additional lower diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 738da43a1505..ecf536ec64e8 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -68,7 +68,7 @@ namespace { bool bBackgroundMatches = ( bInBackground && bSearchBackground ) || ( !bInBackground && !bSearchBackground ); - const SwFlyFrm* pFly = pObj ? pObj->GetFlyFrm() : 0; + const SwFlyFrm* pFly = pObj ? pObj->GetFlyFrm() : nullptr; if ( pFly && bBackgroundMatches && ( ( pCMS && pCMS->m_bSetInReadOnly ) || !pFly->IsProtected() ) && @@ -132,11 +132,11 @@ public: void Exit( const SwFlyFrm *pFly ) { if ( pFly == pEntry ) - pEntry = pStk1 = pStk2 = 0; + pEntry = pStk1 = pStk2 = nullptr; } }; -static SwCrsrOszControl aOszCtrl = { 0, 0, 0 }; +static SwCrsrOszControl aOszCtrl = { nullptr, nullptr, nullptr }; /** Searches the ContentFrm owning the PrtArea containing the point. */ bool SwLayoutFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint, @@ -406,7 +406,7 @@ bool SwRootFrm::FillSelection( SwSelectionList& aSelList, const SwRect& rRect) c pPage = pPage->GetNext(); } else - pPage = 0; + pPage = nullptr; } return !aSelList.isEmpty(); } @@ -426,7 +426,7 @@ bool SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint, Point aOldPoint = rPoint; // search for page containing rPoint. The borders around the pages are considered - const SwPageFrm* pPage = GetPageAtPos( rPoint, 0, true ); + const SwPageFrm* pPage = GetPageAtPos( rPoint, nullptr, true ); // #i95626# // special handling for <rPoint> beyond root frames area @@ -557,7 +557,7 @@ bool SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint, while ( aIter() && !bRet ) { const SwVirtFlyDrawObj* pObj = static_cast<const SwVirtFlyDrawObj*>(aIter()); - const SwFlyFrm* pFly = pObj ? pObj->GetFlyFrm() : 0; + const SwFlyFrm* pFly = pObj ? pObj->GetFlyFrm() : nullptr; if ( pFly && pFly->Frm().IsInside( rPoint ) && Frm().IsInside( pFly->Frm() ) ) { @@ -639,7 +639,7 @@ typedef const SwContentFrm *(*GetNxtPrvCnt)( const SwContentFrm* ); /// Frame in repeated headline? static bool lcl_IsInRepeatedHeadline( const SwFrm *pFrm, - const SwTabFrm** ppTFrm = 0 ) + const SwTabFrm** ppTFrm = nullptr ) { const SwTabFrm *pTab = pFrm->FindTabFrm(); if( ppTFrm ) @@ -687,7 +687,7 @@ static bool lcl_UpDown( SwPaM *pPam, const SwContentFrm *pStart, OSL_ENSURE( &pPam->GetNode() == pStart->GetNode(), "lcl_UpDown doesn't work for others." ); - const SwContentFrm *pCnt = 0; + const SwContentFrm *pCnt = nullptr; //We have to cheat a little bit during a table selection: Go to the //beginning of the cell while going up and go to the end of the cell while @@ -709,7 +709,7 @@ static bool lcl_UpDown( SwPaM *pPam, const SwContentFrm *pStart, static_cast<const SwCellFrm*>(pCell)->GetPreviousCell(); const SwContentFrm* pTmpStart = pStart; - while ( pTmpCell && 0 != ( pTmpStart = pTmpCell->ContainsContent() ) ) + while ( pTmpCell && nullptr != ( pTmpStart = pTmpCell->ContainsContent() ) ) { pCell = pTmpCell; pTmpCell = bFwd ? @@ -729,7 +729,7 @@ static bool lcl_UpDown( SwPaM *pPam, const SwContentFrm *pStart, pCnt = ::lcl_MissProtectedFrames( pCnt, fnNxtPrv, true, bInReadOnly, bTableSel ); const SwTabFrm *pStTab = pStart->FindTabFrm(); - const SwTabFrm *pTable = 0; + const SwTabFrm *pTable = nullptr; const bool bTab = pStTab || (pCnt && pCnt->IsInTab()); bool bEnd = !bTab; @@ -747,7 +747,7 @@ static bool lcl_UpDown( SwPaM *pPam, const SwContentFrm *pStart, Point aCenter = aRect.Center(); nX = bVert ? aCenter.Y() : aCenter.X(); - pTable = pCnt ? pCnt->FindTabFrm() : 0; + pTable = pCnt ? pCnt->FindTabFrm() : nullptr; if ( !pTable ) pTable = pStTab; @@ -844,7 +844,7 @@ static bool lcl_UpDown( SwPaM *pPam, const SwContentFrm *pStart, pCntUp = pCntUp->GetUpper(); } if ( !bSame ) - pCnt = 0; + pCnt = nullptr; else if ( pCnt && pCnt->IsTextFrm() && static_cast<const SwTextFrm*>(pCnt)->IsHiddenNow() ) // i73332 { pCnt = (*fnNxtPrv)( pCnt ); @@ -963,7 +963,7 @@ sal_uInt16 SwRootFrm::GetCurrPage( const SwPaM *pActualCrsr ) const { OSL_ENSURE( pActualCrsr, "got no page cursor" ); SwFrm const*const pActFrm = pActualCrsr->GetPoint()->nNode.GetNode(). - GetContentNode()->getLayoutFrm( this, 0, + GetContentNode()->getLayoutFrm( this, nullptr, pActualCrsr->GetPoint(), false ); return pActFrm->FindPageFrm()->GetPhyPageNum(); @@ -978,7 +978,7 @@ sal_uInt16 SwRootFrm::GetCurrPage( const SwPaM *pActualCrsr ) const */ sal_uInt16 SwRootFrm::SetCurrPage( SwCursor* pToSet, sal_uInt16 nPageNum ) { - vcl::RenderContext* pRenderContext = GetCurrShell() ? GetCurrShell()->GetOut() : 0; + vcl::RenderContext* pRenderContext = GetCurrShell() ? GetCurrShell()->GetOut() : nullptr; OSL_ENSURE( Lower() && Lower()->IsPageFrm(), "No page available." ); SwPageFrm *pPage = static_cast<SwPageFrm*>(Lower()); @@ -1045,11 +1045,11 @@ SwLayoutFrm *GetNextFrm( const SwLayoutFrm *pFrm ) { SwLayoutFrm *pNext = (pFrm->GetNext() && pFrm->GetNext()->IsLayoutFrm()) ? - const_cast<SwLayoutFrm*>(static_cast<const SwLayoutFrm*>(pFrm->GetNext())) : 0; + const_cast<SwLayoutFrm*>(static_cast<const SwLayoutFrm*>(pFrm->GetNext())) : nullptr; // #i39402# in case of an empty page if(pNext && !pNext->ContainsContent()) pNext = (pNext->GetNext() && pNext->GetNext()->IsLayoutFrm()) ? - static_cast<SwLayoutFrm*>(pNext->GetNext()) : 0; + static_cast<SwLayoutFrm*>(pNext->GetNext()) : nullptr; return pNext; } @@ -1062,11 +1062,11 @@ SwLayoutFrm *GetPrevFrm( const SwLayoutFrm *pFrm ) { SwLayoutFrm *pPrev = (pFrm->GetPrev() && pFrm->GetPrev()->IsLayoutFrm()) ? - const_cast<SwLayoutFrm*>(static_cast<const SwLayoutFrm*>(pFrm->GetPrev())) : 0; + const_cast<SwLayoutFrm*>(static_cast<const SwLayoutFrm*>(pFrm->GetPrev())) : nullptr; // #i39402# in case of an empty page if(pPrev && !pPrev->ContainsContent()) pPrev = (pPrev->GetPrev() && pPrev->GetPrev()->IsLayoutFrm()) ? - static_cast<SwLayoutFrm*>(pPrev->GetPrev()) : 0; + static_cast<SwLayoutFrm*>(pPrev->GetPrev()) : nullptr; return pPrev; } @@ -1088,11 +1088,11 @@ bool GetFrmInPage( const SwContentFrm *pCnt, SwWhichPage fnWhichPage, //First find the requested page, at first the current, then the one which //was requests through fnWichPage. const SwLayoutFrm *pLayoutFrm = pCnt->FindPageFrm(); - if ( !pLayoutFrm || (0 == (pLayoutFrm = (*fnWhichPage)(pLayoutFrm))) ) + if ( !pLayoutFrm || (nullptr == (pLayoutFrm = (*fnWhichPage)(pLayoutFrm))) ) return false; //Now the desired ContentFrm below the page - if( 0 == (pCnt = (*fnPosPage)(pLayoutFrm)) ) + if( nullptr == (pCnt = (*fnPosPage)(pLayoutFrm)) ) return false; else { @@ -1158,13 +1158,13 @@ static const SwLayoutFrm* lcl_Inside( const SwContentFrm *pCnt, Point& rPt ) { if( rPt.Y() >= pUp->Frm().Top() && rPt.Y() <= pUp->Frm().Bottom() ) return pUp; - return NULL; + return nullptr; } if( pUp->IsFootnoteContFrm() ) - return pUp->Frm().IsInside( rPt ) ? pUp : NULL; + return pUp->Frm().IsInside( rPt ) ? pUp : nullptr; pUp = pUp->GetUpper(); } - return NULL; + return nullptr; } /** Search for the nearest Content to pass. @@ -1195,7 +1195,7 @@ const SwContentFrm *SwLayoutFrm::GetContentPos( Point& rPoint, pContent = pContent->GetNextContentFrm(); const SwContentFrm *pActual= pContent; - const SwLayoutFrm *pInside = NULL; + const SwLayoutFrm *pInside = nullptr; sal_uInt16 nMaxPage = GetPhyPageNum() + (bDefaultExpand ? 1 : 0); Point aPoint = rPoint; sal_uInt64 nDistance = SAL_MAX_UINT64; @@ -1284,7 +1284,7 @@ const SwContentFrm *SwLayoutFrm::GetContentPos( Point& rPoint, { ++nMaxPage; if( !pStart->GetPrev()->IsLayoutFrm() ) - return 0; + return nullptr; pStart = static_cast<const SwLayoutFrm*>(pStart->GetPrev()); pContent = pStart->IsInDocBody() ? pStart->ContainsContent() @@ -1296,7 +1296,7 @@ const SwContentFrm *SwLayoutFrm::GetContentPos( Point& rPoint, while ( pContent && !pContent->IsInDocBody() ) pContent = pContent->GetNextContentFrm(); if ( !pContent ) - return 0; // There is no document content yet! + return nullptr; // There is no document content yet! } } else @@ -1305,7 +1305,7 @@ const SwContentFrm *SwLayoutFrm::GetContentPos( Point& rPoint, if ( pStart->GetPrev() ) { if( !pStart->GetPrev()->IsLayoutFrm() ) - return 0; + return nullptr; pStart = static_cast<const SwLayoutFrm*>(pStart->GetPrev()); pContent = pStart->ContainsContent(); } @@ -1328,7 +1328,7 @@ const SwContentFrm *SwLayoutFrm::GetContentPos( Point& rPoint, if ( pTab->IsFollow() && pTab->IsInHeadline( *pActual ) ) { const_cast<SwCrsrMoveState*>(pCMS)->m_bStop = true; - return 0; + return nullptr; } } @@ -1494,7 +1494,7 @@ class DisableCallbackAction */ Point SwRootFrm::GetNextPrevContentPos( const Point& rPoint, bool bNext ) const { - vcl::RenderContext* pRenderContext = GetCurrShell() ? GetCurrShell()->GetOut() : 0; + vcl::RenderContext* pRenderContext = GetCurrShell() ? GetCurrShell()->GetOut() : nullptr; // #123110# - disable creation of an action by a callback // event during processing of this method. Needed because formatting is // triggered by this method. @@ -1623,7 +1623,7 @@ SwPageFrm* SwRootFrm::GetPageByPageNum( sal_uInt16 _nPageNum ) const } else { - return 0; + return nullptr; } } @@ -1726,7 +1726,7 @@ bool SwFrm::WannaRightPage() const return true; const SwFrm *pFlow = pPage->FindFirstBodyContent(); - const SwPageDesc *pDesc = 0; + const SwPageDesc *pDesc = nullptr; ::boost::optional<sal_uInt16> oPgNum; if ( pFlow ) { @@ -1822,14 +1822,14 @@ sal_uInt16 SwFrm::GetVirtPageNum() const //Because searching backwards needs a lot of time we search specific using //the dependencies. From the PageDescs we get the attributes and from the //attributes we get the sections. - const SwPageFrm *pVirtPage = 0; - const SwFrm *pFrm = 0; + const SwPageFrm *pVirtPage = nullptr; + const SwFrm *pFrm = nullptr; const SfxItemPool &rPool = pPage->GetFormat()->GetDoc()->GetAttrPool(); sal_uInt32 nMaxItems = rPool.GetItemCount2( RES_PAGEDESC ); for( sal_uInt32 n = 0; n < nMaxItems; ++n ) { const SfxPoolItem* pItem = rPool.GetItem2( RES_PAGEDESC, n ); - if ( 0 == pItem ) + if ( nullptr == pItem ) continue; const SwFormatPageDesc *pDesc = static_cast<const SwFormatPageDesc*>(pItem); @@ -1891,11 +1891,11 @@ bool SwRootFrm::MakeTableCrsrs( SwTableCursor& rTableCrsr ) const SwContentNode* pTmpStartNode = rTableCrsr.GetContentNode(); const SwContentNode* pTmpEndNode = rTableCrsr.GetContentNode(false); - const SwFrm* pTmpStartFrm = pTmpStartNode ? pTmpStartNode->getLayoutFrm( this, &aPtPt, 0, false ) : 0; - const SwFrm* pTmpEndFrm = pTmpEndNode ? pTmpEndNode->getLayoutFrm( this, &aMkPt, 0, false ) : 0; + const SwFrm* pTmpStartFrm = pTmpStartNode ? pTmpStartNode->getLayoutFrm( this, &aPtPt, nullptr, false ) : nullptr; + const SwFrm* pTmpEndFrm = pTmpEndNode ? pTmpEndNode->getLayoutFrm( this, &aMkPt, nullptr, false ) : nullptr; - const SwLayoutFrm* pStart = pTmpStartFrm ? pTmpStartFrm->GetUpper() : 0; - const SwLayoutFrm* pEnd = pTmpEndFrm ? pTmpEndFrm->GetUpper() : 0; + const SwLayoutFrm* pStart = pTmpStartFrm ? pTmpStartFrm->GetUpper() : nullptr; + const SwLayoutFrm* pEnd = pTmpEndFrm ? pTmpEndFrm->GetUpper() : nullptr; OSL_ENSURE( pStart && pEnd, "MakeTableCrsrs: Good to have the code robust here!" ); @@ -2054,7 +2054,7 @@ void SwRootFrm::CalcFrmRects(SwShellCrsr &rCrsr) if (pObj) aSortObjs.Insert( *(const_cast<SwAnchoredObject*>(pObj)) ); const SwAnchoredObject* pObj2 = pEndFrm->FindFlyFrm(); OSL_ENSURE( pObj2, "SwRootFrm::CalcFrmRects(..) - FlyFrame missing - looks like an invalid selection" ); - if ( pObj2 != NULL && pObj2 != pObj ) + if ( pObj2 != nullptr && pObj2 != pObj ) { aSortObjs.Insert( *(const_cast<SwAnchoredObject*>(pObj2)) ); } @@ -2124,7 +2124,7 @@ void SwRootFrm::CalcFrmRects(SwShellCrsr &rCrsr) SwRect aStRect, aEndRect; pStartFrm->GetCharRect( aStRect, *pStartPos, &aTmpState ); Sw2LinesPos *pSt2Pos = aTmpState.m_p2Lines; - aTmpState.m_p2Lines = NULL; + aTmpState.m_p2Lines = nullptr; aTmpState.m_nCursorBidiLevel = pEndFrm->IsRightToLeft() ? 1 : 0; pEndFrm->GetCharRect( aEndRect, *pEndPos, &aTmpState ); @@ -2484,9 +2484,9 @@ void SwRootFrm::CalcFrmRects(SwShellCrsr &rCrsr) //Now the frames between, if there are any bool const bBody = pStartFrm->IsInDocBody(); const SwTableBox* pCellBox = pStartFrm->GetUpper()->IsCellFrm() ? - static_cast<const SwCellFrm*>(pStartFrm->GetUpper())->GetTabBox() : 0; + static_cast<const SwCellFrm*>(pStartFrm->GetUpper())->GetTabBox() : nullptr; if (pSh->IsSelectAll()) - pCellBox = 0; + pCellBox = nullptr; const SwContentFrm *pContent = pStartFrm->GetNextContentFrm(); SwRect aPrvRect; @@ -2505,9 +2505,9 @@ void SwRootFrm::CalcFrmRects(SwShellCrsr &rCrsr) // If pStartFrm is inside a SwCellFrm, consider only frames which are inside the // same cell frame (or its follow cell) const SwTableBox* pTmpCellBox = pContent->GetUpper()->IsCellFrm() ? - static_cast<const SwCellFrm*>(pContent->GetUpper())->GetTabBox() : 0; + static_cast<const SwCellFrm*>(pContent->GetUpper())->GetTabBox() : nullptr; if (pSh->IsSelectAll()) - pTmpCellBox = 0; + pTmpCellBox = nullptr; if ( bBody == pContent->IsInDocBody() && ( !pCellBox || pCellBox == pTmpCellBox ) ) { @@ -2585,8 +2585,8 @@ void SwRootFrm::CalcFrmRects(SwShellCrsr &rCrsr) const SwVirtFlyDrawObj* pObj = pFly->GetVirtDrawObj(); const SwFormatSurround &rSur = pFly->GetFormat()->GetSurround(); const SwPosition* anchoredAt = pAnchoredObj->GetFrameFormat().GetAnchor().GetContentAnchor(); - bool inSelection = ( anchoredAt != NULL && *pStartPos <= *anchoredAt && *anchoredAt < *pEndPos ); - if( anchoredAt != NULL && *anchoredAt == *pEndPos ) + bool inSelection = ( anchoredAt != nullptr && *pStartPos <= *anchoredAt && *anchoredAt < *pEndPos ); + if( anchoredAt != nullptr && *anchoredAt == *pEndPos ) { const SwNodes& nodes = anchoredAt->GetDoc()->GetNodes(); if( *pEndPos == SwPosition( nodes.GetEndOfContent())) diff --git a/sw/source/core/layout/virtoutp.cxx b/sw/source/core/layout/virtoutp.cxx index 8d69905e947f..28b2d6f00dfe 100644 --- a/sw/source/core/layout/virtoutp.cxx +++ b/sw/source/core/layout/virtoutp.cxx @@ -163,7 +163,7 @@ void SwLayVout::Enter( SwViewShell *pShell, SwRect &rRect, bool bOn ) if( bOn ) { pSh = pShell; - pOut = NULL; + pOut = nullptr; OutputDevice *pO = pSh->GetOut(); // We don't cheat on printers or virtual output devices... if( OUTDEV_WINDOW != pO->GetOutDevType() ) @@ -182,7 +182,7 @@ void SwLayVout::Enter( SwViewShell *pShell, SwRect &rRect, bool bOn ) // Does the rectangle fit in our buffer? if( !DoesFit( aTmpRect.GetSize() ) ) { - pOut = NULL; + pOut = nullptr; return; } @@ -212,7 +212,7 @@ void SwLayVout::_Flush() pOut->DrawOutDev( aRect.Pos(), aRect.SSize(), aRect.Pos(), aRect.SSize(), *pVirDev ); SetOutDev( pSh, pOut ); - pOut = NULL; + pOut = nullptr; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/virtoutp.hxx b/sw/source/core/layout/virtoutp.hxx index f855b4e828b1..1b00c40208e3 100644 --- a/sw/source/core/layout/virtoutp.hxx +++ b/sw/source/core/layout/virtoutp.hxx @@ -42,7 +42,7 @@ private: bool DoesFit( const Size &rOut ); public: - SwLayVout() : pSh(0), pOut(0), pVirDev(0), aSize(0, VIRTUALHEIGHT), nCount(0) {} + SwLayVout() : pSh(nullptr), pOut(nullptr), pVirDev(nullptr), aSize(0, VIRTUALHEIGHT), nCount(0) {} ~SwLayVout() { pVirDev.disposeAndClear(); } /// OD 27.09.2002 #103636# - change 2nd parameter <rRect> - no longer <const> diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index fbf706e7f331..81827714315b 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -256,7 +256,7 @@ void SwFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) if ( nInvFlags & 0x08 ) SetCompletePaint(); SwFrm *pNxt; - if ( nInvFlags & 0x30 && 0 != (pNxt = GetNext()) ) + if ( nInvFlags & 0x30 && nullptr != (pNxt = GetNext()) ) { pNxt->InvalidatePage( pPage ); if ( nInvFlags & 0x10 ) @@ -307,8 +307,8 @@ void SwFrm::_UpdateAttrFrm( const SfxPoolItem *pOld, const SfxPoolItem *pNew, { if ( IsRowFrm() ) { - bool bInFollowFlowRow = 0 != IsInFollowFlowRow(); - if ( bInFollowFlowRow || 0 != IsInSplitTableRow() ) + bool bInFollowFlowRow = nullptr != IsInFollowFlowRow(); + if ( bInFollowFlowRow || nullptr != IsInSplitTableRow() ) { SwTabFrm* pTab = FindTabFrm(); if ( bInFollowFlowRow ) @@ -532,7 +532,7 @@ void SwFrm::InsertBefore( SwLayoutFrm* pParent, SwFrm* pBehind ) mpNext = pBehind; if( pBehind ) { //Insert before pBehind. - if( 0 != (mpPrev = pBehind->mpPrev) ) + if( nullptr != (mpPrev = pBehind->mpPrev) ) mpPrev->mpNext = this; else mpUpper->m_pLower = this; @@ -568,7 +568,7 @@ void SwFrm::InsertBehind( SwLayoutFrm *pParent, SwFrm *pBefore ) if ( pBefore ) { //Insert after pBefore - if ( 0 != (mpNext = pBefore->mpNext) ) + if ( nullptr != (mpNext = pBefore->mpNext) ) mpNext->mpPrev = this; pBefore->mpNext = this; } @@ -634,10 +634,10 @@ bool SwFrm::InsertGroupBefore( SwFrm* pParent, SwFrm* pBehind, SwFrm* pSct ) if( pBehind ) { // Insert before pBehind. if( pBehind->GetPrev() ) - pBehind->GetPrev()->mpNext = NULL; + pBehind->GetPrev()->mpNext = nullptr; else pBehind->GetUpper()->m_pLower = nullptr; - pBehind->mpPrev = NULL; + pBehind->mpPrev = nullptr; SwLayoutFrm* pTmp = static_cast<SwLayoutFrm*>(pSct); if( pTmp->Lower() ) { @@ -673,7 +673,7 @@ bool SwFrm::InsertGroupBefore( SwFrm* pParent, SwFrm* pBehind, SwFrm* pSct ) pLast->mpNext = pBehind; if( pBehind ) { // Insert before pBehind. - if( 0 != (mpPrev = pBehind->mpPrev) ) + if( nullptr != (mpPrev = pBehind->mpPrev) ) mpPrev->mpNext = this; else mpUpper->m_pLower = this; @@ -712,8 +712,8 @@ void SwFrm::RemoveFromLayout() mpNext->mpPrev = mpPrev; // Remove link - mpNext = mpPrev = 0; - mpUpper = 0; + mpNext = mpPrev = nullptr; + mpUpper = nullptr; } void SwContentFrm::Paste( SwFrm* pParent, SwFrm* pSibling) @@ -751,7 +751,7 @@ void SwContentFrm::Paste( SwFrm* pParent, SwFrm* pSibling) if( pNxt->IsSctFrm() ) pNxt = static_cast<SwSectionFrm*>(pNxt)->ContainsContent(); if( pNxt && pNxt->IsTextFrm() && pNxt->IsInFootnote() ) - pNxt->Prepare( PREP_FTN, 0, false ); + pNxt->Prepare( PREP_FTN, nullptr, false ); } if ( Frm().Height() ) @@ -791,11 +791,11 @@ void SwContentFrm::Paste( SwFrm* pParent, SwFrm* pSibling) if( pFrm && pFrm->IsSctFrm() ) pFrm = static_cast<SwSectionFrm*>(pFrm)->ContainsAny(); if( pFrm ) - pFrm->Prepare( PREP_QUOVADIS, 0, false ); + pFrm->Prepare( PREP_QUOVADIS, nullptr, false ); if( !GetNext() ) { pFrm = FindFootnoteFrm()->GetNext(); - if( pFrm && 0 != (pFrm=static_cast<SwLayoutFrm*>(pFrm)->ContainsAny()) ) + if( pFrm && nullptr != (pFrm=static_cast<SwLayoutFrm*>(pFrm)->ContainsAny()) ) pFrm->_InvalidatePrt(); } } @@ -806,7 +806,7 @@ void SwContentFrm::Paste( SwFrm* pParent, SwFrm* pSibling) { while ( pNxt && pNxt->IsInTab() ) { - if( 0 != (pNxt = pNxt->FindTabFrm()) ) + if( nullptr != (pNxt = pNxt->FindTabFrm()) ) pNxt = pNxt->FindNextCnt(); } if ( pNxt ) @@ -833,7 +833,7 @@ void SwContentFrm::Cut() { pFrm->_InvalidatePrt(); if( IsInFootnote() ) - pFrm->Prepare( PREP_QUOVADIS, 0, false ); + pFrm->Prepare( PREP_QUOVADIS, nullptr, false ); } // #i26250# - invalidate printing area of previous // table frame. @@ -848,7 +848,7 @@ void SwContentFrm::Cut() { while ( pNxt && pNxt->IsInTab() ) { - if( 0 != (pNxt = pNxt->FindTabFrm()) ) + if( nullptr != (pNxt = pNxt->FindTabFrm()) ) pNxt = pNxt->FindNextCnt(); } if ( pNxt ) @@ -859,7 +859,7 @@ void SwContentFrm::Cut() } } - if( 0 != (pFrm = GetIndNext()) ) + if( nullptr != (pFrm = GetIndNext()) ) { // The old follow may have calculated a gap to the predecessor which // now becomes obsolete or different as it becomes the first one itself @@ -877,7 +877,7 @@ void SwContentFrm::Cut() } } if( pFrm && IsInFootnote() ) - pFrm->Prepare( PREP_ERGOSUM, 0, false ); + pFrm->Prepare( PREP_ERGOSUM, nullptr, false ); if( IsInSct() && !GetPrev() ) { SwSectionFrm* pSct = FindSctFrm(); @@ -892,7 +892,7 @@ void SwContentFrm::Cut() { InvalidateNextPos(); //Someone needs to do the retouching: predecessor or upper - if ( 0 != (pFrm = GetPrev()) ) + if ( nullptr != (pFrm = GetPrev()) ) { pFrm->SetRetouche(); pFrm->Prepare( PREP_WIDOWS_ORPHANS ); pFrm->_InvalidatePos(); @@ -922,7 +922,7 @@ void SwContentFrm::Cut() if ( IsInTab() ) { SwTabFrm* pThisTab = FindTabFrm(); - SwTabFrm* pMasterTab = pThisTab && pThisTab->IsFollow() ? pThisTab->FindMaster() : 0; + SwTabFrm* pMasterTab = pThisTab && pThisTab->IsFollow() ? pThisTab->FindMaster() : nullptr; if ( pMasterTab ) { pMasterTab->_InvalidatePos(); @@ -936,7 +936,7 @@ void SwContentFrm::Cut() RemoveFromLayout(); if ( pUp ) { - SwSectionFrm *pSct = 0; + SwSectionFrm *pSct = nullptr; if ( !pUp->Lower() && ( ( pUp->IsFootnoteFrm() && !pUp->IsColLocked() ) || ( pUp->IsInSct() && @@ -1049,7 +1049,7 @@ void SwLayoutFrm::Paste( SwFrm* pParent, SwFrm* pSibling) if( !IsColumnFrm() ) { SwFrm *pFrm = GetIndNext(); - if( 0 != pFrm ) + if( nullptr != pFrm ) { pFrm->_InvalidatePos(); if( IsInFootnote() ) @@ -1057,15 +1057,15 @@ void SwLayoutFrm::Paste( SwFrm* pParent, SwFrm* pSibling) if( pFrm->IsSctFrm() ) pFrm = static_cast<SwSectionFrm*>(pFrm)->ContainsAny(); if( pFrm ) - pFrm->Prepare( PREP_ERGOSUM, 0, false ); + pFrm->Prepare( PREP_ERGOSUM, nullptr, false ); } } - if ( IsInFootnote() && 0 != ( pFrm = GetIndPrev() ) ) + if ( IsInFootnote() && nullptr != ( pFrm = GetIndPrev() ) ) { if( pFrm->IsSctFrm() ) pFrm = static_cast<SwSectionFrm*>(pFrm)->ContainsAny(); if( pFrm ) - pFrm->Prepare( PREP_QUOVADIS, 0, false ); + pFrm->Prepare( PREP_QUOVADIS, nullptr, false ); } } @@ -1384,7 +1384,7 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, bool bTst ) Prt().SSize().Height() = nOldFrmHeight; if ( pUp->GetUpper() ) - static_cast<SwRootFrm*>(pUp->GetUpper())->CheckViewLayout( 0, 0 ); + static_cast<SwRootFrm*>(pUp->GetUpper())->CheckViewLayout( nullptr, nullptr ); //static_cast<SwPageFrm*>(pUp)->AdjustRootSize( CHG_CHGPAGE, &aOldRect ); Frm().SSize().Height() = nOldFrmHeight; @@ -1406,7 +1406,7 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, bool bTst ) SwTwips nReal = 0, nAdd = 0; - SwFrm *pFrm = 0; + SwFrm *pFrm = nullptr; SWRECTFN( this ) if( IsBodyFrm() ) @@ -1507,7 +1507,7 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, bool bTst ) if( nReal < 0 && pFrm->IsInSct() ) { SwLayoutFrm* pUp = pFrm->GetUpper(); - if( pUp && 0 != ( pUp = pUp->GetUpper() ) && pUp->IsSctFrm() && + if( pUp && nullptr != ( pUp = pUp->GetUpper() ) && pUp->IsSctFrm() && !pUp->IsColLocked() ) pUp->InvalidateSize(); } @@ -1754,7 +1754,7 @@ SwTwips SwContentFrm::GrowFrm( SwTwips nDist, bool bTst, bool bInfo ) (Frm().*fnRect->fnSetHeight)( nOld + nDist ); if( IsVertical()&& !IsVertLR() && !IsReverse() ) Frm().Pos().X() -= nDist; - SwTabFrm *pTab = (nOld && IsInTab()) ? FindTabFrm() : NULL; + SwTabFrm *pTab = (nOld && IsInTab()) ? FindTabFrm() : nullptr; if (pTab) { if ( pTab->GetTable()->GetHTMLTableLayout() && @@ -1842,7 +1842,7 @@ SwTwips SwContentFrm::ShrinkFrm( SwTwips nDist, bool bTst, bool bInfo ) if( IsVertical() && !IsVertLR() ) Frm().Pos().X() += nDist; nDist = nRstHeight; - SwTabFrm *pTab = IsInTab() ? FindTabFrm() : NULL; + SwTabFrm *pTab = IsInTab() ? FindTabFrm() : nullptr; if (pTab) { if ( pTab->GetTable()->GetHTMLTableLayout() && @@ -1874,7 +1874,7 @@ SwTwips SwContentFrm::ShrinkFrm( SwTwips nDist, bool bTst, bool bInfo ) bool bInvalidate = true; const SwRect aRect( Frm() ); const SwPageFrm* pPage = FindPageFrm(); - const SwSortedObjs* pSorted = pPage ? pPage->GetSortedObjs() : 0; + const SwSortedObjs* pSorted = pPage ? pPage->GetSortedObjs() : nullptr; if( pSorted ) { for ( size_t i = 0; i < pSorted->size(); ++i ) @@ -2264,7 +2264,7 @@ SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, bool bTst, bool bInfo ) if ( -1 == rEndCell.GetTabBox()->getRowSpan() ) pToGrow = rEndCell.GetUpper(); else - pToGrow = 0; + pToGrow = nullptr; } nGrow = pToGrow ? pToGrow->Grow( nReal, bTst, bInfo ) : 0; @@ -2511,7 +2511,7 @@ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, bool bTst, bool bInfo ) if( IsFootnoteFrm() && !static_cast<SwFootnoteFrm*>(this)->GetAttr()->GetFootnote().IsEndNote() && ( GetFormat()->GetDoc()->GetFootnoteInfo().ePos != FTNPOS_CHAPTER || ( IsInSct() && FindSctFrm()->IsFootnoteAtEnd() ) ) && - 0 != (pCnt = static_cast<SwFootnoteFrm*>(this)->GetRefFromAttr() ) ) + nullptr != (pCnt = static_cast<SwFootnoteFrm*>(this)->GetRefFromAttr() ) ) { if ( pCnt->IsFollow() ) { // If we are in an other column/page than the frame with the @@ -2591,7 +2591,7 @@ void SwLayoutFrm::ChgLowersProp( const Size& rOldSize ) if( pLowerFrm->IsSctFrm() ) pLowerFrm = static_cast<SwSectionFrm*>(pLowerFrm)->GetSection() && !static_cast<SwSectionFrm*>(pLowerFrm)->ToMaximize( false ) ? - static_cast<SwSectionFrm*>(pLowerFrm)->FindLastContent() : NULL; + static_cast<SwSectionFrm*>(pLowerFrm)->FindLastContent() : nullptr; // continue with found last lower, probably the last content of a section if ( pLowerFrm ) @@ -2905,7 +2905,7 @@ void SwLayoutFrm::ChgLowersProp( const Size& rOldSize ) Lower()->IsColumnFrm() ) { // get column attribute - const SwFormatCol* pColAttr = NULL; + const SwFormatCol* pColAttr = nullptr; if ( IsPageBodyFrm() ) { OSL_ENSURE( GetUpper()->IsPageFrm(), "Upper is not page frame" ); @@ -3142,7 +3142,7 @@ static long lcl_CalcMinColDiff( SwLayoutFrm *pLayFrm ) } //Skip empty columns! pCol = static_cast<SwLayoutFrm*>(pCol->GetNext()); - while ( pCol && 0 == (pFrm = pCol->Lower()) ) + while ( pCol && nullptr == (pFrm = pCol->Lower()) ) pCol = static_cast<SwLayoutFrm*>(pCol->GetNext()); } while ( pFrm && pCol ); @@ -3198,8 +3198,8 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs, bool bEnd = false; bool bBackLock = false; SwViewShell *pSh = getRootFrm()->GetCurrShell(); - SwViewShellImp *pImp = pSh ? pSh->Imp() : 0; - vcl::RenderContext* pRenderContext = pSh ? pSh->GetOut() : 0; + SwViewShellImp *pImp = pSh ? pSh->Imp() : nullptr; + vcl::RenderContext* pRenderContext = pSh ? pSh->GetOut() : nullptr; { // Underlying algorithm // We try to find the optimal height for the column. @@ -3284,7 +3284,7 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs, // #i3317# - reset temporarly consideration // of wrapping style influence SwPageFrm* pPageFrm = FindPageFrm(); - SwSortedObjs* pObjs = pPageFrm ? pPageFrm->GetSortedObjs() : 0L; + SwSortedObjs* pObjs = pPageFrm ? pPageFrm->GetSortedObjs() : nullptr; if ( pObjs ) { for ( size_t i = 0; i < pObjs->size(); ++i ) @@ -3333,7 +3333,7 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs, // OD 28.03.2003 #108446# - check for all column content and all columns while ( bMinDiff && pCol ) { - bMinDiff = 0 != pCol->ContainsContent(); + bMinDiff = nullptr != pCol->ContainsContent(); pCol = static_cast<SwLayoutFrm*>(pCol->GetNext()); } pCol = static_cast<SwLayoutFrm*>(Lower()); @@ -3480,7 +3480,7 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs, // #i3317# - reset temporarly consideration // of wrapping style influence SwPageFrm* pTmpPageFrm = FindPageFrm(); - SwSortedObjs* pTmpObjs = pTmpPageFrm ? pTmpPageFrm->GetSortedObjs() : 0L; + SwSortedObjs* pTmpObjs = pTmpPageFrm ? pTmpPageFrm->GetSortedObjs() : nullptr; if ( pTmpObjs ) { for ( size_t i = 0; i < pTmpObjs->size(); ++i ) @@ -3542,7 +3542,7 @@ static SwContentFrm* lcl_InvalidateSection( SwFrm *pCnt, sal_uInt8 nInv ) // Exception: If a table is directly passed. if( ( ( pCnt->IsInTab() && !pSect->IsInTab() ) || ( pCnt->IsInFootnote() && !pSect->IsInFootnote() ) ) && !pCnt->IsTabFrm() ) - return NULL; + return nullptr; if( nInv & INV_SIZE ) pSect->_InvalidateSize(); if( nInv & INV_POS ) @@ -3551,7 +3551,7 @@ static SwContentFrm* lcl_InvalidateSection( SwFrm *pCnt, sal_uInt8 nInv ) pSect->_InvalidatePrt(); SwFlowFrm *pFoll = pSect->GetFollow(); // Temporary separation from follow - pSect->SetFollow( NULL ); + pSect->SetFollow( nullptr ); SwContentFrm* pRet = pSect->FindLastContent(); pSect->SetFollow( pFoll ); return pRet; @@ -3574,8 +3574,8 @@ static void lcl_InvalidateAllContent( SwContentFrm *pCnt, sal_uInt8 nInv ); static void lcl_InvalidateContent( SwContentFrm *pCnt, sal_uInt8 nInv ) { - SwContentFrm *pLastTabCnt = NULL; - SwContentFrm *pLastSctCnt = NULL; + SwContentFrm *pLastTabCnt = nullptr; + SwContentFrm *pLastSctCnt = nullptr; while ( pCnt ) { if( nInv & INV_SECTION ) @@ -3586,7 +3586,7 @@ static void lcl_InvalidateContent( SwContentFrm *pCnt, sal_uInt8 nInv ) if( !pLastSctCnt ) pLastSctCnt = lcl_InvalidateSection( pCnt, nInv ); if( pLastSctCnt == pCnt ) - pLastSctCnt = NULL; + pLastSctCnt = nullptr; } #if OSL_DEBUG_LEVEL > 0 else @@ -3607,12 +3607,12 @@ static void lcl_InvalidateContent( SwContentFrm *pCnt, sal_uInt8 nInv ) if( !pLastTabCnt ) { pLastTabCnt = lcl_InvalidateTable( pCnt->FindTabFrm(), nInv ); - pLastSctCnt = NULL; + pLastSctCnt = nullptr; } if( pLastTabCnt == pCnt ) { - pLastTabCnt = NULL; - pLastSctCnt = NULL; + pLastTabCnt = nullptr; + pLastSctCnt = nullptr; } } #if OSL_DEBUG_LEVEL > 0 @@ -3622,7 +3622,7 @@ static void lcl_InvalidateContent( SwContentFrm *pCnt, sal_uInt8 nInv ) } if( nInv & INV_SIZE ) - pCnt->Prepare( PREP_CLEAR, 0, false ); + pCnt->Prepare( PREP_CLEAR, nullptr, false ); if( nInv & INV_POS ) pCnt->_InvalidatePos(); if( nInv & INV_PRTAREA ) |