summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-10-08 21:48:45 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-10-09 08:05:46 +0200
commit56bc686c2a0dbfffc6e9f40df0e61c7b98fb3340 (patch)
treee56aae134a4ceb70fc621eab12e5ee2781c31017 /sot
parent0df69aa16a31c8aebad9ddc38072a8ec13b01dd1 (diff)
sot: prefix members of StgAvlNode
Change-Id: Ie6de63b524b99246be3d6d5d6e997c7abda675ad
Diffstat (limited to 'sot')
-rw-r--r--sot/source/sdstor/stgavl.cxx174
-rw-r--r--sot/source/sdstor/stgavl.hxx6
-rw-r--r--sot/source/sdstor/stgdir.cxx50
3 files changed, 115 insertions, 115 deletions
diff --git a/sot/source/sdstor/stgavl.cxx b/sot/source/sdstor/stgavl.cxx
index 8baa8cf2bb7a..536e7de31e18 100644
--- a/sot/source/sdstor/stgavl.cxx
+++ b/sot/source/sdstor/stgavl.cxx
@@ -23,14 +23,14 @@
StgAvlNode::StgAvlNode()
{
- pLeft = pRight = NULL;
- nBalance = nId = 0;
+ m_pLeft = m_pRight = NULL;
+ m_nBalance = m_nId = 0;
}
StgAvlNode::~StgAvlNode()
{
- delete pLeft;
- delete pRight;
+ delete m_pLeft;
+ delete m_pRight;
}
StgAvlNode* StgAvlNode::Find( StgAvlNode* pFind )
@@ -43,7 +43,7 @@ StgAvlNode* StgAvlNode::Find( StgAvlNode* pFind )
short nRes = p->Compare( pFind );
if( !nRes )
return p;
- else p = ( nRes < 0 ) ? p->pLeft : p->pRight;
+ else p = ( nRes < 0 ) ? p->m_pLeft : p->m_pRight;
}
}
return NULL;
@@ -69,14 +69,14 @@ short StgAvlNode::Locate
while( pCur != NULL )
{
// check for pPivot
- if( pCur->nBalance != 0 )
+ if( pCur->m_nBalance != 0 )
*pPivot = pCur, *pParent = *pPrev;
// save pPrev location and see what direction to go
*pPrev = pCur;
nRes = pCur->Compare( pFind );
if( nRes == 0 )
break;
- else pCur = ( nRes < 0 ) ? pCur->pLeft : pCur->pRight;
+ else pCur = ( nRes < 0 ) ? pCur->m_pLeft : pCur->m_pRight;
}
}
@@ -93,37 +93,37 @@ short StgAvlNode::Adjust( StgAvlNode** pHeavy, StgAvlNode* pNew )
// no traversing
OSL_ENSURE( pHeavy && pNew, "The pointers is not allowed to be NULL!" );
if( pCur == pNew || !pNew )
- return nBalance;
+ return m_nBalance;
short nRes = Compare( pNew );
if( nRes > 0 )
{
- *pHeavy = pCur = pRight;
+ *pHeavy = pCur = m_pRight;
nDelta = -1;
}
else
{
- *pHeavy = pCur = pLeft;
+ *pHeavy = pCur = m_pLeft;
nDelta = 1;
}
- nBalance = 0;
+ m_nBalance = 0;
while( pCur != pNew )
{
nRes = pCur->Compare( pNew );
if( nRes > 0 )
{
// height of right increases by 1
- pCur->nBalance = -1;
- pCur = pCur->pRight;
+ pCur->m_nBalance = -1;
+ pCur = pCur->m_pRight;
}
else
{
// height of left increases by 1
- pCur->nBalance = 1;
- pCur = pCur->pLeft;
+ pCur->m_nBalance = 1;
+ pCur = pCur->m_pLeft;
}
}
- nBalance = nBalance + nDelta;
+ m_nBalance = m_nBalance + nDelta;
return nDelta;
}
@@ -131,11 +131,11 @@ short StgAvlNode::Adjust( StgAvlNode** pHeavy, StgAvlNode* pNew )
StgAvlNode* StgAvlNode::RotLL()
{
- assert(pLeft && "The pointer is not allowed to be NULL!");
- StgAvlNode *pHeavy = pLeft;
- pLeft = pHeavy->pRight;
- pHeavy->pRight = this;
- pHeavy->nBalance = nBalance = 0;
+ assert(m_pLeft && "The pointer is not allowed to be NULL!");
+ StgAvlNode *pHeavy = m_pLeft;
+ m_pLeft = pHeavy->m_pRight;
+ pHeavy->m_pRight = this;
+ pHeavy->m_nBalance = m_nBalance = 0;
return pHeavy;
}
@@ -143,71 +143,71 @@ StgAvlNode* StgAvlNode::RotLL()
StgAvlNode* StgAvlNode::RotLR()
{
- assert(pLeft && pLeft->pRight && "The pointer is not allowed to be NULL!");
- StgAvlNode* pHeavy = pLeft;
- StgAvlNode* pNewRoot = pHeavy->pRight;
+ assert(m_pLeft && m_pLeft->m_pRight && "The pointer is not allowed to be NULL!");
+ StgAvlNode* pHeavy = m_pLeft;
+ StgAvlNode* pNewRoot = pHeavy->m_pRight;
- pHeavy->pRight = pNewRoot->pLeft;
- pLeft = pNewRoot->pRight;
- pNewRoot->pLeft = pHeavy;
- pNewRoot->pRight = this;
+ pHeavy->m_pRight = pNewRoot->m_pLeft;
+ m_pLeft = pNewRoot->m_pRight;
+ pNewRoot->m_pLeft = pHeavy;
+ pNewRoot->m_pRight = this;
- switch( pNewRoot->nBalance )
+ switch( pNewRoot->m_nBalance )
{
case 1: // LR( b )
- nBalance = -1;
- pHeavy->nBalance = 0;
+ m_nBalance = -1;
+ pHeavy->m_nBalance = 0;
break;
case -1: // LR( c )
- pHeavy->nBalance = 1;
- nBalance = 0;
+ pHeavy->m_nBalance = 1;
+ m_nBalance = 0;
break;
case 0: // LR( a )
- nBalance = 0;
- pHeavy->nBalance = 0;
+ m_nBalance = 0;
+ pHeavy->m_nBalance = 0;
break;
}
- pNewRoot->nBalance = 0;
+ pNewRoot->m_nBalance = 0;
return pNewRoot;
}
// perform RR rotation and return new root
StgAvlNode* StgAvlNode::RotRR()
{
- assert(pRight && "The pointer is not allowed to be NULL!" );
- StgAvlNode* pHeavy = pRight;
- pRight = pHeavy->pLeft;
- pHeavy->pLeft = this;
- nBalance = pHeavy->nBalance = 0;
+ assert(m_pRight && "The pointer is not allowed to be NULL!" );
+ StgAvlNode* pHeavy = m_pRight;
+ m_pRight = pHeavy->m_pLeft;
+ pHeavy->m_pLeft = this;
+ m_nBalance = pHeavy->m_nBalance = 0;
return pHeavy;
}
// perform the RL rotation and return the new root
StgAvlNode* StgAvlNode::RotRL()
{
- assert(pRight && pRight->pLeft && "The pointer is not allowed to be NULL!");
- StgAvlNode* pHeavy = pRight;
- StgAvlNode* pNewRoot = pHeavy->pLeft;
- pHeavy->pLeft = pNewRoot->pRight;
- pRight = pNewRoot->pLeft;
- pNewRoot->pRight = pHeavy;
- pNewRoot->pLeft = this;
- switch( pNewRoot->nBalance )
+ assert(m_pRight && m_pRight->m_pLeft && "The pointer is not allowed to be NULL!");
+ StgAvlNode* pHeavy = m_pRight;
+ StgAvlNode* pNewRoot = pHeavy->m_pLeft;
+ pHeavy->m_pLeft = pNewRoot->m_pRight;
+ m_pRight = pNewRoot->m_pLeft;
+ pNewRoot->m_pRight = pHeavy;
+ pNewRoot->m_pLeft = this;
+ switch( pNewRoot->m_nBalance )
{
case -1: // RL( b )
- nBalance = 1;
- pHeavy->nBalance = 0;
+ m_nBalance = 1;
+ pHeavy->m_nBalance = 0;
break;
case 1: // RL( c )
- pHeavy->nBalance = -1;
- nBalance = 0;
+ pHeavy->m_nBalance = -1;
+ m_nBalance = 0;
break;
case 0: // RL( a )
- nBalance = 0;
- pHeavy->nBalance = 0;
+ m_nBalance = 0;
+ pHeavy->m_nBalance = 0;
break;
}
- pNewRoot->nBalance = 0;
+ pNewRoot->m_nBalance = 0;
return pNewRoot;
}
@@ -222,13 +222,13 @@ StgAvlNode* StgAvlNode::Rem( StgAvlNode** p, StgAvlNode* pDel, bool bPtrs )
if( !nRes )
{
// Element found: remove
- if( !pCur->pRight )
+ if( !pCur->m_pRight )
{
- *p = pCur->pLeft; pCur->pLeft = NULL;
+ *p = pCur->m_pLeft; pCur->m_pLeft = NULL;
}
- else if( !pCur->pLeft )
+ else if( !pCur->m_pLeft )
{
- *p = pCur->pRight; pCur->pRight = NULL;
+ *p = pCur->m_pRight; pCur->m_pRight = NULL;
}
else
{
@@ -238,28 +238,28 @@ StgAvlNode* StgAvlNode::Rem( StgAvlNode** p, StgAvlNode* pDel, bool bPtrs )
// this element with the element found.
StgAvlNode* last = pCur;
StgAvlNode* l;
- for( l = pCur->pLeft;
- l->pRight; last = l, l = l->pRight ) {}
+ for( l = pCur->m_pLeft;
+ l->m_pRight; last = l, l = l->m_pRight ) {}
// remove the element from chain
- if( l == last->pRight )
- last->pRight = l->pLeft;
+ if( l == last->m_pRight )
+ last->m_pRight = l->m_pLeft;
else
- last->pLeft = l->pLeft;
+ last->m_pLeft = l->m_pLeft;
// perform the replacement
- l->pLeft = pCur->pLeft;
- l->pRight = pCur->pRight;
+ l->m_pLeft = pCur->m_pLeft;
+ l->m_pRight = pCur->m_pRight;
*p = l;
// delete the element
- pCur->pLeft = pCur->pRight = NULL;
+ pCur->m_pLeft = pCur->m_pRight = NULL;
}
return pCur;
}
else
{
if( nRes < 0 )
- return Rem( &pCur->pLeft, pDel, bPtrs );
+ return Rem( &pCur->m_pLeft, pDel, bPtrs );
else
- return Rem( &pCur->pRight, pDel, bPtrs );
+ return Rem( &pCur->m_pRight, pDel, bPtrs );
}
}
return NULL;
@@ -269,11 +269,11 @@ StgAvlNode* StgAvlNode::Rem( StgAvlNode** p, StgAvlNode* pDel, bool bPtrs )
void StgAvlNode::StgEnum( short& n )
{
- if( pLeft )
- pLeft->StgEnum( n );
- nId = n++;
- if( pRight )
- pRight->StgEnum( n );
+ if( m_pLeft )
+ m_pLeft->StgEnum( n );
+ m_nId = n++;
+ if( m_pRight )
+ m_pRight->StgEnum( n );
}
// Add node to AVL tree.
@@ -300,32 +300,32 @@ bool StgAvlNode::Insert( StgAvlNode** pRoot, StgAvlNode* pIns )
// add new node
if( nRes < 0 )
- pPrev->pLeft = pIns;
+ pPrev->m_pLeft = pIns;
else
- pPrev->pRight = pIns;
+ pPrev->m_pRight = pIns;
// rebalance tree
short nDelta = pPivot->Adjust( &pHeavy, pIns );
- if( pPivot->nBalance >= 2 || pPivot->nBalance <= -2 )
+ if( pPivot->m_nBalance >= 2 || pPivot->m_nBalance <= -2 )
{
- pHeavy = ( nDelta < 0 ) ? pPivot->pRight : pPivot->pLeft;
+ pHeavy = ( nDelta < 0 ) ? pPivot->m_pRight : pPivot->m_pLeft;
// left imbalance
if( nDelta > 0 )
- if( pHeavy->nBalance == 1 )
+ if( pHeavy->m_nBalance == 1 )
pNewRoot = pPivot->RotLL();
else
pNewRoot = pPivot->RotLR();
// right imbalance
- else if( pHeavy->nBalance == -1 )
+ else if( pHeavy->m_nBalance == -1 )
pNewRoot = pPivot->RotRR();
else
pNewRoot = pPivot->RotRL();
// relink balanced subtree
if( pParent == NULL )
*pRoot = pNewRoot;
- else if( pPivot == pParent->pLeft )
- pParent->pLeft = pNewRoot;
- else if( pPivot == pParent->pRight )
- pParent->pRight = pNewRoot;
+ else if( pPivot == pParent->m_pLeft )
+ pParent->m_pLeft = pNewRoot;
+ else if( pPivot == pParent->m_pRight )
+ pParent->m_pRight = pNewRoot;
}
return true;
}
@@ -385,9 +385,9 @@ StgAvlNode* StgAvlIterator::Find( short n )
StgAvlNode* p = m_pRoot;
while( p )
{
- if( n == p->nId )
+ if( n == p->m_nId )
break;
- else p = ( n < p->nId ) ? p->pLeft : p->pRight;
+ else p = ( n < p->m_nId ) ? p->m_pLeft : p->m_pRight;
}
return p;
}
diff --git a/sot/source/sdstor/stgavl.hxx b/sot/source/sdstor/stgavl.hxx
index 5b29d0f7d2c7..14f68fc44062 100644
--- a/sot/source/sdstor/stgavl.hxx
+++ b/sot/source/sdstor/stgavl.hxx
@@ -36,9 +36,9 @@ private:
void StgEnum( short& );
static StgAvlNode* Rem( StgAvlNode**, StgAvlNode*, bool );
protected:
- short nId; // iterator ID
- short nBalance; // indicates tree balance
- StgAvlNode* pLeft, *pRight; // leaves
+ short m_nId; // iterator ID
+ short m_nBalance; // indicates tree balance
+ StgAvlNode* m_pLeft, *m_pRight; // leaves
StgAvlNode();
public:
virtual ~StgAvlNode();
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index 642049a88eea..79dcb1247477 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -116,15 +116,15 @@ void StgDirEntry::Enum( sal_Int32& n )
{
sal_Int32 nLeft = STG_FREE, nRight = STG_FREE, nDown = STG_FREE;
m_nEntry = n++;
- if( pLeft )
+ if( m_pLeft )
{
- static_cast<StgDirEntry*>(pLeft)->Enum( n );
- nLeft = static_cast<StgDirEntry*>(pLeft)->m_nEntry;
+ static_cast<StgDirEntry*>(m_pLeft)->Enum( n );
+ nLeft = static_cast<StgDirEntry*>(m_pLeft)->m_nEntry;
}
- if( pRight )
+ if( m_pRight )
{
- static_cast<StgDirEntry*>(pRight)->Enum( n );
- nRight = static_cast<StgDirEntry*>(pRight)->m_nEntry;
+ static_cast<StgDirEntry*>(m_pRight)->Enum( n );
+ nRight = static_cast<StgDirEntry*>(m_pRight)->m_nEntry;
}
if( m_pDown )
{
@@ -140,10 +140,10 @@ void StgDirEntry::Enum( sal_Int32& n )
void StgDirEntry::DelTemp( bool bForce )
{
- if( pLeft )
- static_cast<StgDirEntry*>(pLeft)->DelTemp( false );
- if( pRight )
- static_cast<StgDirEntry*>(pRight)->DelTemp( false );
+ if( m_pLeft )
+ static_cast<StgDirEntry*>(m_pLeft)->DelTemp( false );
+ if( m_pRight )
+ static_cast<StgDirEntry*>(m_pRight)->DelTemp( false );
if( m_pDown )
{
// If the storage is dead, of course all elements are dead, too
@@ -162,7 +162,7 @@ void StgDirEntry::DelTemp( bool bForce )
StgAvlNode::Remove( reinterpret_cast<StgAvlNode**>(&m_pUp->m_pDown), this, bDel );
if( !bDel )
{
- pLeft = pRight = m_pDown = 0;
+ m_pLeft = m_pRight = m_pDown = 0;
m_bInvalid = m_bZombie = true;
}
}
@@ -178,11 +178,11 @@ bool StgDirEntry::Store( StgDirStrm& rStrm )
return false;
// Do not store the current (maybe not committed) entry
m_aSave.Store( pEntry );
- if( pLeft )
- if( !static_cast<StgDirEntry*>(pLeft)->Store( rStrm ) )
+ if( m_pLeft )
+ if( !static_cast<StgDirEntry*>(m_pLeft)->Store( rStrm ) )
return false;
- if( pRight )
- if( !static_cast<StgDirEntry*>(pRight)->Store( rStrm ) )
+ if( m_pRight )
+ if( !static_cast<StgDirEntry*>(m_pRight)->Store( rStrm ) )
return false;
if( m_pDown )
if( !m_pDown->Store( rStrm ) )
@@ -218,11 +218,11 @@ bool StgDirEntry::StoreStreams( StgIo& rIo )
{
if( !StoreStream( rIo ) )
return false;
- if( pLeft )
- if( !static_cast<StgDirEntry*>(pLeft)->StoreStreams( rIo ) )
+ if( m_pLeft )
+ if( !static_cast<StgDirEntry*>(m_pLeft)->StoreStreams( rIo ) )
return false;
- if( pRight )
- if( !static_cast<StgDirEntry*>(pRight)->StoreStreams( rIo ) )
+ if( m_pRight )
+ if( !static_cast<StgDirEntry*>(m_pRight)->StoreStreams( rIo ) )
return false;
if( m_pDown )
if( !m_pDown->StoreStreams( rIo ) )
@@ -235,10 +235,10 @@ bool StgDirEntry::StoreStreams( StgIo& rIo )
void StgDirEntry::RevertAll()
{
m_aEntry = m_aSave;
- if( pLeft )
- static_cast<StgDirEntry*>(pLeft)->RevertAll();
- if( pRight )
- static_cast<StgDirEntry*>(pRight)->RevertAll();
+ if( m_pLeft )
+ static_cast<StgDirEntry*>(m_pLeft)->RevertAll();
+ if( m_pRight )
+ static_cast<StgDirEntry*>(m_pRight)->RevertAll();
if( m_pDown )
m_pDown->RevertAll();
}
@@ -249,9 +249,9 @@ bool StgDirEntry::IsDirty()
{
if( m_bDirty || m_bInvalid )
return true;
- if( pLeft && static_cast<StgDirEntry*>(pLeft)->IsDirty() )
+ if( m_pLeft && static_cast<StgDirEntry*>(m_pLeft)->IsDirty() )
return true;
- if( pRight && static_cast<StgDirEntry*>(pRight)->IsDirty() )
+ if( m_pRight && static_cast<StgDirEntry*>(m_pRight)->IsDirty() )
return true;
if( m_pDown && m_pDown->IsDirty() )
return true;