Kaydet (Commit) 6cd053eb authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

since touching this: sprinkle in some nullptr

Change-Id: I8a229e020acddfda2e7c69fc7faf24d1c338c879
üst 7c1b420c
...@@ -23,12 +23,12 @@ ...@@ -23,12 +23,12 @@
#include <swcache.hxx> #include <swcache.hxx>
#include <swfntcch.hxx> #include <swfntcch.hxx>
static SwClientIter* pClientIters = 0; static SwClientIter* pClientIters = nullptr;
TYPEINIT0( SwClient ); TYPEINIT0( SwClient );
SwClient::SwClient( SwModify* pToRegisterIn ) SwClient::SwClient( SwModify* pToRegisterIn )
: pLeft( 0 ), pRight( 0 ), pRegisteredIn( 0 ) : pLeft( nullptr ), pRight( nullptr ), pRegisteredIn( nullptr )
{ {
if(pToRegisterIn) if(pToRegisterIn)
// connect to SwModify // connect to SwModify
...@@ -81,7 +81,7 @@ bool SwClient::GetInfo( SfxPoolItem& ) const ...@@ -81,7 +81,7 @@ bool SwClient::GetInfo( SfxPoolItem& ) const
} }
SwModify::SwModify() SwModify::SwModify()
: SwClient(0), pRoot(0) : SwClient(nullptr), pRoot(nullptr)
{ {
bModifyLocked = false; bModifyLocked = false;
bLockClientList = false; bLockClientList = false;
...@@ -91,7 +91,7 @@ SwModify::SwModify() ...@@ -91,7 +91,7 @@ SwModify::SwModify()
} }
SwModify::SwModify( SwModify* pToRegisterIn ) SwModify::SwModify( SwModify* pToRegisterIn )
: SwClient( pToRegisterIn ), pRoot( 0 ) : SwClient( pToRegisterIn ), pRoot( nullptr )
{ {
bModifyLocked = false; bModifyLocked = false;
bLockClientList = false; bLockClientList = false;
...@@ -122,7 +122,7 @@ SwModify::~SwModify() ...@@ -122,7 +122,7 @@ SwModify::~SwModify()
SwClient* p = aIter.GoStart(); SwClient* p = aIter.GoStart();
while ( p ) while ( p )
{ {
p->pRegisteredIn = 0; p->pRegisteredIn = nullptr;
p = ++aIter; p = ++aIter;
} }
} }
...@@ -195,7 +195,7 @@ bool SwModify::GetInfo( SfxPoolItem& rInfo ) const ...@@ -195,7 +195,7 @@ bool SwModify::GetInfo( SfxPoolItem& rInfo ) const
if( pLast ) if( pLast )
{ {
while( ( bRet = pLast->GetInfo( rInfo ) ) && while( ( bRet = pLast->GetInfo( rInfo ) ) &&
0 != ( pLast = ++aIter ) ) nullptr != ( pLast = ++aIter ) )
; ;
} }
} }
...@@ -218,15 +218,15 @@ void SwModify::Add( SwClient* pDepend ) ...@@ -218,15 +218,15 @@ void SwModify::Add( SwClient* pDepend )
} }
#endif #endif
// deregister new client in case it is already registered elsewhere // deregister new client in case it is already registered elsewhere
if( pDepend->pRegisteredIn != 0 ) if( pDepend->pRegisteredIn != nullptr )
pDepend->pRegisteredIn->Remove( pDepend ); pDepend->pRegisteredIn->Remove( pDepend );
if( !pRoot ) if( !pRoot )
{ {
// first client added // first client added
pRoot = pDepend; pRoot = pDepend;
pRoot->pLeft = 0; pRoot->pLeft = nullptr;
pRoot->pRight = 0; pRoot->pRight = nullptr;
} }
else else
{ {
...@@ -246,7 +246,7 @@ void SwModify::Add( SwClient* pDepend ) ...@@ -246,7 +246,7 @@ void SwModify::Add( SwClient* pDepend )
SwClient* SwModify::Remove( SwClient* pDepend ) SwClient* SwModify::Remove( SwClient* pDepend )
{ {
if ( bInDocDTOR ) if ( bInDocDTOR )
return 0; return nullptr;
if( pDepend->pRegisteredIn == this ) if( pDepend->pRegisteredIn == this )
{ {
...@@ -275,8 +275,8 @@ SwClient* SwModify::Remove( SwClient* pDepend ) ...@@ -275,8 +275,8 @@ SwClient* SwModify::Remove( SwClient* pDepend )
pTmp = pTmp->pNxtIter; pTmp = pTmp->pNxtIter;
} }
pDepend->pLeft = 0; pDepend->pLeft = nullptr;
pDepend->pRight = 0; pDepend->pRight = nullptr;
} }
else else
{ {
...@@ -284,7 +284,7 @@ SwClient* SwModify::Remove( SwClient* pDepend ) ...@@ -284,7 +284,7 @@ SwClient* SwModify::Remove( SwClient* pDepend )
} }
// disconnect client from me // disconnect client from me
pDepend->pRegisteredIn = 0; pDepend->pRegisteredIn = nullptr;
return pDepend; return pDepend;
} }
...@@ -369,8 +369,8 @@ bool SwDepend::GetInfo( SfxPoolItem& rInfo ) const ...@@ -369,8 +369,8 @@ bool SwDepend::GetInfo( SfxPoolItem& rInfo ) const
SwClientIter::SwClientIter( const SwModify& rModify ) SwClientIter::SwClientIter( const SwModify& rModify )
: rRoot(rModify) : rRoot(rModify)
, pNxtIter(NULL) , pNxtIter(nullptr)
, aSrchId(0) , aSrchId(nullptr)
{ {
if( pClientIters ) if( pClientIters )
{ {
...@@ -398,7 +398,7 @@ SwClientIter::~SwClientIter() ...@@ -398,7 +398,7 @@ SwClientIter::~SwClientIter()
{ {
SwClientIter* pTmp = pClientIters; SwClientIter* pTmp = pClientIters;
while( pTmp->pNxtIter != this ) while( pTmp->pNxtIter != this )
if( 0 == ( pTmp = pTmp->pNxtIter ) ) if( nullptr == ( pTmp = pTmp->pNxtIter ) )
{ {
OSL_ENSURE( this, "Lost my pointer" ); OSL_ENSURE( this, "Lost my pointer" );
return ; return ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment