Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
56bc686c
Kaydet (Commit)
56bc686c
authored
Eki 08, 2015
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sot: prefix members of StgAvlNode
Change-Id: Ie6de63b524b99246be3d6d5d6e997c7abda675ad
üst
0df69aa1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
115 additions
and
115 deletions
+115
-115
stgavl.cxx
sot/source/sdstor/stgavl.cxx
+87
-87
stgavl.hxx
sot/source/sdstor/stgavl.hxx
+3
-3
stgdir.cxx
sot/source/sdstor/stgdir.cxx
+25
-25
No files found.
sot/source/sdstor/stgavl.cxx
Dosyayı görüntüle @
56bc686c
...
@@ -23,14 +23,14 @@
...
@@ -23,14 +23,14 @@
StgAvlNode
::
StgAvlNode
()
StgAvlNode
::
StgAvlNode
()
{
{
pLeft
=
pRight
=
NULL
;
m_pLeft
=
m_
pRight
=
NULL
;
nBalance
=
nId
=
0
;
m_nBalance
=
m_
nId
=
0
;
}
}
StgAvlNode
::~
StgAvlNode
()
StgAvlNode
::~
StgAvlNode
()
{
{
delete
pLeft
;
delete
m_
pLeft
;
delete
pRight
;
delete
m_
pRight
;
}
}
StgAvlNode
*
StgAvlNode
::
Find
(
StgAvlNode
*
pFind
)
StgAvlNode
*
StgAvlNode
::
Find
(
StgAvlNode
*
pFind
)
...
@@ -43,7 +43,7 @@ StgAvlNode* StgAvlNode::Find( StgAvlNode* pFind )
...
@@ -43,7 +43,7 @@ StgAvlNode* StgAvlNode::Find( StgAvlNode* pFind )
short
nRes
=
p
->
Compare
(
pFind
);
short
nRes
=
p
->
Compare
(
pFind
);
if
(
!
nRes
)
if
(
!
nRes
)
return
p
;
return
p
;
else
p
=
(
nRes
<
0
)
?
p
->
pLeft
:
p
->
pRight
;
else
p
=
(
nRes
<
0
)
?
p
->
m_pLeft
:
p
->
m_
pRight
;
}
}
}
}
return
NULL
;
return
NULL
;
...
@@ -69,14 +69,14 @@ short StgAvlNode::Locate
...
@@ -69,14 +69,14 @@ short StgAvlNode::Locate
while
(
pCur
!=
NULL
)
while
(
pCur
!=
NULL
)
{
{
// check for pPivot
// check for pPivot
if
(
pCur
->
nBalance
!=
0
)
if
(
pCur
->
m_
nBalance
!=
0
)
*
pPivot
=
pCur
,
*
pParent
=
*
pPrev
;
*
pPivot
=
pCur
,
*
pParent
=
*
pPrev
;
// save pPrev location and see what direction to go
// save pPrev location and see what direction to go
*
pPrev
=
pCur
;
*
pPrev
=
pCur
;
nRes
=
pCur
->
Compare
(
pFind
);
nRes
=
pCur
->
Compare
(
pFind
);
if
(
nRes
==
0
)
if
(
nRes
==
0
)
break
;
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 )
...
@@ -93,37 +93,37 @@ short StgAvlNode::Adjust( StgAvlNode** pHeavy, StgAvlNode* pNew )
// no traversing
// no traversing
OSL_ENSURE
(
pHeavy
&&
pNew
,
"The pointers is not allowed to be NULL!"
);
OSL_ENSURE
(
pHeavy
&&
pNew
,
"The pointers is not allowed to be NULL!"
);
if
(
pCur
==
pNew
||
!
pNew
)
if
(
pCur
==
pNew
||
!
pNew
)
return
nBalance
;
return
m_
nBalance
;
short
nRes
=
Compare
(
pNew
);
short
nRes
=
Compare
(
pNew
);
if
(
nRes
>
0
)
if
(
nRes
>
0
)
{
{
*
pHeavy
=
pCur
=
pRight
;
*
pHeavy
=
pCur
=
m_
pRight
;
nDelta
=
-
1
;
nDelta
=
-
1
;
}
}
else
else
{
{
*
pHeavy
=
pCur
=
pLeft
;
*
pHeavy
=
pCur
=
m_
pLeft
;
nDelta
=
1
;
nDelta
=
1
;
}
}
nBalance
=
0
;
m_
nBalance
=
0
;
while
(
pCur
!=
pNew
)
while
(
pCur
!=
pNew
)
{
{
nRes
=
pCur
->
Compare
(
pNew
);
nRes
=
pCur
->
Compare
(
pNew
);
if
(
nRes
>
0
)
if
(
nRes
>
0
)
{
{
// height of right increases by 1
// height of right increases by 1
pCur
->
nBalance
=
-
1
;
pCur
->
m_
nBalance
=
-
1
;
pCur
=
pCur
->
pRight
;
pCur
=
pCur
->
m_
pRight
;
}
}
else
else
{
{
// height of left increases by 1
// height of left increases by 1
pCur
->
nBalance
=
1
;
pCur
->
m_
nBalance
=
1
;
pCur
=
pCur
->
pLeft
;
pCur
=
pCur
->
m_
pLeft
;
}
}
}
}
nBalance
=
nBalance
+
nDelta
;
m_nBalance
=
m_
nBalance
+
nDelta
;
return
nDelta
;
return
nDelta
;
}
}
...
@@ -131,11 +131,11 @@ short StgAvlNode::Adjust( StgAvlNode** pHeavy, StgAvlNode* pNew )
...
@@ -131,11 +131,11 @@ short StgAvlNode::Adjust( StgAvlNode** pHeavy, StgAvlNode* pNew )
StgAvlNode
*
StgAvlNode
::
RotLL
()
StgAvlNode
*
StgAvlNode
::
RotLL
()
{
{
assert
(
pLeft
&&
"The pointer is not allowed to be NULL!"
);
assert
(
m_
pLeft
&&
"The pointer is not allowed to be NULL!"
);
StgAvlNode
*
pHeavy
=
pLeft
;
StgAvlNode
*
pHeavy
=
m_
pLeft
;
pLeft
=
pHeavy
->
pRight
;
m_pLeft
=
pHeavy
->
m_
pRight
;
pHeavy
->
pRight
=
this
;
pHeavy
->
m_
pRight
=
this
;
pHeavy
->
nBalance
=
nBalance
=
0
;
pHeavy
->
m_nBalance
=
m_
nBalance
=
0
;
return
pHeavy
;
return
pHeavy
;
}
}
...
@@ -143,71 +143,71 @@ StgAvlNode* StgAvlNode::RotLL()
...
@@ -143,71 +143,71 @@ StgAvlNode* StgAvlNode::RotLL()
StgAvlNode
*
StgAvlNode
::
RotLR
()
StgAvlNode
*
StgAvlNode
::
RotLR
()
{
{
assert
(
pLeft
&&
pLeft
->
pRight
&&
"The pointer is not allowed to be NULL!"
);
assert
(
m_pLeft
&&
m_pLeft
->
m_
pRight
&&
"The pointer is not allowed to be NULL!"
);
StgAvlNode
*
pHeavy
=
pLeft
;
StgAvlNode
*
pHeavy
=
m_
pLeft
;
StgAvlNode
*
pNewRoot
=
pHeavy
->
pRight
;
StgAvlNode
*
pNewRoot
=
pHeavy
->
m_
pRight
;
pHeavy
->
pRight
=
pNewRoot
->
pLeft
;
pHeavy
->
m_pRight
=
pNewRoot
->
m_
pLeft
;
pLeft
=
pNewRoot
->
pRight
;
m_pLeft
=
pNewRoot
->
m_
pRight
;
pNewRoot
->
pLeft
=
pHeavy
;
pNewRoot
->
m_
pLeft
=
pHeavy
;
pNewRoot
->
pRight
=
this
;
pNewRoot
->
m_
pRight
=
this
;
switch
(
pNewRoot
->
nBalance
)
switch
(
pNewRoot
->
m_
nBalance
)
{
{
case
1
:
// LR( b )
case
1
:
// LR( b )
nBalance
=
-
1
;
m_
nBalance
=
-
1
;
pHeavy
->
nBalance
=
0
;
pHeavy
->
m_
nBalance
=
0
;
break
;
break
;
case
-
1
:
// LR( c )
case
-
1
:
// LR( c )
pHeavy
->
nBalance
=
1
;
pHeavy
->
m_
nBalance
=
1
;
nBalance
=
0
;
m_
nBalance
=
0
;
break
;
break
;
case
0
:
// LR( a )
case
0
:
// LR( a )
nBalance
=
0
;
m_
nBalance
=
0
;
pHeavy
->
nBalance
=
0
;
pHeavy
->
m_
nBalance
=
0
;
break
;
break
;
}
}
pNewRoot
->
nBalance
=
0
;
pNewRoot
->
m_
nBalance
=
0
;
return
pNewRoot
;
return
pNewRoot
;
}
}
// perform RR rotation and return new root
// perform RR rotation and return new root
StgAvlNode
*
StgAvlNode
::
RotRR
()
StgAvlNode
*
StgAvlNode
::
RotRR
()
{
{
assert
(
pRight
&&
"The pointer is not allowed to be NULL!"
);
assert
(
m_
pRight
&&
"The pointer is not allowed to be NULL!"
);
StgAvlNode
*
pHeavy
=
pRight
;
StgAvlNode
*
pHeavy
=
m_
pRight
;
pRight
=
pHeavy
->
pLeft
;
m_pRight
=
pHeavy
->
m_
pLeft
;
pHeavy
->
pLeft
=
this
;
pHeavy
->
m_
pLeft
=
this
;
nBalance
=
pHeavy
->
nBalance
=
0
;
m_nBalance
=
pHeavy
->
m_
nBalance
=
0
;
return
pHeavy
;
return
pHeavy
;
}
}
// perform the RL rotation and return the new root
// perform the RL rotation and return the new root
StgAvlNode
*
StgAvlNode
::
RotRL
()
StgAvlNode
*
StgAvlNode
::
RotRL
()
{
{
assert
(
pRight
&&
pRight
->
pLeft
&&
"The pointer is not allowed to be NULL!"
);
assert
(
m_pRight
&&
m_pRight
->
m_
pLeft
&&
"The pointer is not allowed to be NULL!"
);
StgAvlNode
*
pHeavy
=
pRight
;
StgAvlNode
*
pHeavy
=
m_
pRight
;
StgAvlNode
*
pNewRoot
=
pHeavy
->
pLeft
;
StgAvlNode
*
pNewRoot
=
pHeavy
->
m_
pLeft
;
pHeavy
->
pLeft
=
pNewRoot
->
pRight
;
pHeavy
->
m_pLeft
=
pNewRoot
->
m_
pRight
;
pRight
=
pNewRoot
->
pLeft
;
m_pRight
=
pNewRoot
->
m_
pLeft
;
pNewRoot
->
pRight
=
pHeavy
;
pNewRoot
->
m_
pRight
=
pHeavy
;
pNewRoot
->
pLeft
=
this
;
pNewRoot
->
m_
pLeft
=
this
;
switch
(
pNewRoot
->
nBalance
)
switch
(
pNewRoot
->
m_
nBalance
)
{
{
case
-
1
:
// RL( b )
case
-
1
:
// RL( b )
nBalance
=
1
;
m_
nBalance
=
1
;
pHeavy
->
nBalance
=
0
;
pHeavy
->
m_
nBalance
=
0
;
break
;
break
;
case
1
:
// RL( c )
case
1
:
// RL( c )
pHeavy
->
nBalance
=
-
1
;
pHeavy
->
m_
nBalance
=
-
1
;
nBalance
=
0
;
m_
nBalance
=
0
;
break
;
break
;
case
0
:
// RL( a )
case
0
:
// RL( a )
nBalance
=
0
;
m_
nBalance
=
0
;
pHeavy
->
nBalance
=
0
;
pHeavy
->
m_
nBalance
=
0
;
break
;
break
;
}
}
pNewRoot
->
nBalance
=
0
;
pNewRoot
->
m_
nBalance
=
0
;
return
pNewRoot
;
return
pNewRoot
;
}
}
...
@@ -222,13 +222,13 @@ StgAvlNode* StgAvlNode::Rem( StgAvlNode** p, StgAvlNode* pDel, bool bPtrs )
...
@@ -222,13 +222,13 @@ StgAvlNode* StgAvlNode::Rem( StgAvlNode** p, StgAvlNode* pDel, bool bPtrs )
if
(
!
nRes
)
if
(
!
nRes
)
{
{
// Element found: remove
// 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
else
{
{
...
@@ -238,28 +238,28 @@ StgAvlNode* StgAvlNode::Rem( StgAvlNode** p, StgAvlNode* pDel, bool bPtrs )
...
@@ -238,28 +238,28 @@ StgAvlNode* StgAvlNode::Rem( StgAvlNode** p, StgAvlNode* pDel, bool bPtrs )
// this element with the element found.
// this element with the element found.
StgAvlNode
*
last
=
pCur
;
StgAvlNode
*
last
=
pCur
;
StgAvlNode
*
l
;
StgAvlNode
*
l
;
for
(
l
=
pCur
->
pLeft
;
for
(
l
=
pCur
->
m_
pLeft
;
l
->
pRight
;
last
=
l
,
l
=
l
->
pRight
)
{}
l
->
m_pRight
;
last
=
l
,
l
=
l
->
m_
pRight
)
{}
// remove the element from chain
// remove the element from chain
if
(
l
==
last
->
pRight
)
if
(
l
==
last
->
m_
pRight
)
last
->
pRight
=
l
->
pLeft
;
last
->
m_pRight
=
l
->
m_
pLeft
;
else
else
last
->
pLeft
=
l
->
pLeft
;
last
->
m_pLeft
=
l
->
m_
pLeft
;
// perform the replacement
// perform the replacement
l
->
pLeft
=
pCur
->
pLeft
;
l
->
m_pLeft
=
pCur
->
m_
pLeft
;
l
->
pRight
=
pCur
->
pRight
;
l
->
m_pRight
=
pCur
->
m_
pRight
;
*
p
=
l
;
*
p
=
l
;
// delete the element
// delete the element
pCur
->
pLeft
=
pCur
->
pRight
=
NULL
;
pCur
->
m_pLeft
=
pCur
->
m_
pRight
=
NULL
;
}
}
return
pCur
;
return
pCur
;
}
}
else
else
{
{
if
(
nRes
<
0
)
if
(
nRes
<
0
)
return
Rem
(
&
pCur
->
pLeft
,
pDel
,
bPtrs
);
return
Rem
(
&
pCur
->
m_
pLeft
,
pDel
,
bPtrs
);
else
else
return
Rem
(
&
pCur
->
pRight
,
pDel
,
bPtrs
);
return
Rem
(
&
pCur
->
m_
pRight
,
pDel
,
bPtrs
);
}
}
}
}
return
NULL
;
return
NULL
;
...
@@ -269,11 +269,11 @@ StgAvlNode* StgAvlNode::Rem( StgAvlNode** p, StgAvlNode* pDel, bool bPtrs )
...
@@ -269,11 +269,11 @@ StgAvlNode* StgAvlNode::Rem( StgAvlNode** p, StgAvlNode* pDel, bool bPtrs )
void
StgAvlNode
::
StgEnum
(
short
&
n
)
void
StgAvlNode
::
StgEnum
(
short
&
n
)
{
{
if
(
pLeft
)
if
(
m_
pLeft
)
pLeft
->
StgEnum
(
n
);
m_
pLeft
->
StgEnum
(
n
);
nId
=
n
++
;
m_
nId
=
n
++
;
if
(
pRight
)
if
(
m_
pRight
)
pRight
->
StgEnum
(
n
);
m_
pRight
->
StgEnum
(
n
);
}
}
// Add node to AVL tree.
// Add node to AVL tree.
...
@@ -300,32 +300,32 @@ bool StgAvlNode::Insert( StgAvlNode** pRoot, StgAvlNode* pIns )
...
@@ -300,32 +300,32 @@ bool StgAvlNode::Insert( StgAvlNode** pRoot, StgAvlNode* pIns )
// add new node
// add new node
if
(
nRes
<
0
)
if
(
nRes
<
0
)
pPrev
->
pLeft
=
pIns
;
pPrev
->
m_
pLeft
=
pIns
;
else
else
pPrev
->
pRight
=
pIns
;
pPrev
->
m_
pRight
=
pIns
;
// rebalance tree
// rebalance tree
short
nDelta
=
pPivot
->
Adjust
(
&
pHeavy
,
pIns
);
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
// left imbalance
if
(
nDelta
>
0
)
if
(
nDelta
>
0
)
if
(
pHeavy
->
nBalance
==
1
)
if
(
pHeavy
->
m_
nBalance
==
1
)
pNewRoot
=
pPivot
->
RotLL
();
pNewRoot
=
pPivot
->
RotLL
();
else
else
pNewRoot
=
pPivot
->
RotLR
();
pNewRoot
=
pPivot
->
RotLR
();
// right imbalance
// right imbalance
else
if
(
pHeavy
->
nBalance
==
-
1
)
else
if
(
pHeavy
->
m_
nBalance
==
-
1
)
pNewRoot
=
pPivot
->
RotRR
();
pNewRoot
=
pPivot
->
RotRR
();
else
else
pNewRoot
=
pPivot
->
RotRL
();
pNewRoot
=
pPivot
->
RotRL
();
// relink balanced subtree
// relink balanced subtree
if
(
pParent
==
NULL
)
if
(
pParent
==
NULL
)
*
pRoot
=
pNewRoot
;
*
pRoot
=
pNewRoot
;
else
if
(
pPivot
==
pParent
->
pLeft
)
else
if
(
pPivot
==
pParent
->
m_
pLeft
)
pParent
->
pLeft
=
pNewRoot
;
pParent
->
m_
pLeft
=
pNewRoot
;
else
if
(
pPivot
==
pParent
->
pRight
)
else
if
(
pPivot
==
pParent
->
m_
pRight
)
pParent
->
pRight
=
pNewRoot
;
pParent
->
m_
pRight
=
pNewRoot
;
}
}
return
true
;
return
true
;
}
}
...
@@ -385,9 +385,9 @@ StgAvlNode* StgAvlIterator::Find( short n )
...
@@ -385,9 +385,9 @@ StgAvlNode* StgAvlIterator::Find( short n )
StgAvlNode
*
p
=
m_pRoot
;
StgAvlNode
*
p
=
m_pRoot
;
while
(
p
)
while
(
p
)
{
{
if
(
n
==
p
->
nId
)
if
(
n
==
p
->
m_
nId
)
break
;
break
;
else
p
=
(
n
<
p
->
nId
)
?
p
->
pLeft
:
p
->
pRight
;
else
p
=
(
n
<
p
->
m_nId
)
?
p
->
m_pLeft
:
p
->
m_
pRight
;
}
}
return
p
;
return
p
;
}
}
...
...
sot/source/sdstor/stgavl.hxx
Dosyayı görüntüle @
56bc686c
...
@@ -36,9 +36,9 @@ private:
...
@@ -36,9 +36,9 @@ private:
void
StgEnum
(
short
&
);
void
StgEnum
(
short
&
);
static
StgAvlNode
*
Rem
(
StgAvlNode
**
,
StgAvlNode
*
,
bool
);
static
StgAvlNode
*
Rem
(
StgAvlNode
**
,
StgAvlNode
*
,
bool
);
protected
:
protected
:
short
nId
;
// iterator ID
short
m_
nId
;
// iterator ID
short
nBalance
;
// indicates tree balance
short
m_
nBalance
;
// indicates tree balance
StgAvlNode
*
pLeft
,
*
pRight
;
// leaves
StgAvlNode
*
m_pLeft
,
*
m_
pRight
;
// leaves
StgAvlNode
();
StgAvlNode
();
public
:
public
:
virtual
~
StgAvlNode
();
virtual
~
StgAvlNode
();
...
...
sot/source/sdstor/stgdir.cxx
Dosyayı görüntüle @
56bc686c
...
@@ -116,15 +116,15 @@ void StgDirEntry::Enum( sal_Int32& n )
...
@@ -116,15 +116,15 @@ void StgDirEntry::Enum( sal_Int32& n )
{
{
sal_Int32
nLeft
=
STG_FREE
,
nRight
=
STG_FREE
,
nDown
=
STG_FREE
;
sal_Int32
nLeft
=
STG_FREE
,
nRight
=
STG_FREE
,
nDown
=
STG_FREE
;
m_nEntry
=
n
++
;
m_nEntry
=
n
++
;
if
(
pLeft
)
if
(
m_
pLeft
)
{
{
static_cast
<
StgDirEntry
*>
(
pLeft
)
->
Enum
(
n
);
static_cast
<
StgDirEntry
*>
(
m_
pLeft
)
->
Enum
(
n
);
nLeft
=
static_cast
<
StgDirEntry
*>
(
pLeft
)
->
m_nEntry
;
nLeft
=
static_cast
<
StgDirEntry
*>
(
m_
pLeft
)
->
m_nEntry
;
}
}
if
(
pRight
)
if
(
m_
pRight
)
{
{
static_cast
<
StgDirEntry
*>
(
pRight
)
->
Enum
(
n
);
static_cast
<
StgDirEntry
*>
(
m_
pRight
)
->
Enum
(
n
);
nRight
=
static_cast
<
StgDirEntry
*>
(
pRight
)
->
m_nEntry
;
nRight
=
static_cast
<
StgDirEntry
*>
(
m_
pRight
)
->
m_nEntry
;
}
}
if
(
m_pDown
)
if
(
m_pDown
)
{
{
...
@@ -140,10 +140,10 @@ void StgDirEntry::Enum( sal_Int32& n )
...
@@ -140,10 +140,10 @@ void StgDirEntry::Enum( sal_Int32& n )
void
StgDirEntry
::
DelTemp
(
bool
bForce
)
void
StgDirEntry
::
DelTemp
(
bool
bForce
)
{
{
if
(
pLeft
)
if
(
m_
pLeft
)
static_cast
<
StgDirEntry
*>
(
pLeft
)
->
DelTemp
(
false
);
static_cast
<
StgDirEntry
*>
(
m_
pLeft
)
->
DelTemp
(
false
);
if
(
pRight
)
if
(
m_
pRight
)
static_cast
<
StgDirEntry
*>
(
pRight
)
->
DelTemp
(
false
);
static_cast
<
StgDirEntry
*>
(
m_
pRight
)
->
DelTemp
(
false
);
if
(
m_pDown
)
if
(
m_pDown
)
{
{
// If the storage is dead, of course all elements are dead, too
// If the storage is dead, of course all elements are dead, too
...
@@ -162,7 +162,7 @@ void StgDirEntry::DelTemp( bool bForce )
...
@@ -162,7 +162,7 @@ void StgDirEntry::DelTemp( bool bForce )
StgAvlNode
::
Remove
(
reinterpret_cast
<
StgAvlNode
**>
(
&
m_pUp
->
m_pDown
),
this
,
bDel
);
StgAvlNode
::
Remove
(
reinterpret_cast
<
StgAvlNode
**>
(
&
m_pUp
->
m_pDown
),
this
,
bDel
);
if
(
!
bDel
)
if
(
!
bDel
)
{
{
pLeft
=
pRight
=
m_pDown
=
0
;
m_pLeft
=
m_
pRight
=
m_pDown
=
0
;
m_bInvalid
=
m_bZombie
=
true
;
m_bInvalid
=
m_bZombie
=
true
;
}
}
}
}
...
@@ -178,11 +178,11 @@ bool StgDirEntry::Store( StgDirStrm& rStrm )
...
@@ -178,11 +178,11 @@ bool StgDirEntry::Store( StgDirStrm& rStrm )
return
false
;
return
false
;
// Do not store the current (maybe not committed) entry
// Do not store the current (maybe not committed) entry
m_aSave
.
Store
(
pEntry
);
m_aSave
.
Store
(
pEntry
);
if
(
pLeft
)
if
(
m_
pLeft
)
if
(
!
static_cast
<
StgDirEntry
*>
(
pLeft
)
->
Store
(
rStrm
)
)
if
(
!
static_cast
<
StgDirEntry
*>
(
m_
pLeft
)
->
Store
(
rStrm
)
)
return
false
;
return
false
;
if
(
pRight
)
if
(
m_
pRight
)
if
(
!
static_cast
<
StgDirEntry
*>
(
pRight
)
->
Store
(
rStrm
)
)
if
(
!
static_cast
<
StgDirEntry
*>
(
m_
pRight
)
->
Store
(
rStrm
)
)
return
false
;
return
false
;
if
(
m_pDown
)
if
(
m_pDown
)
if
(
!
m_pDown
->
Store
(
rStrm
)
)
if
(
!
m_pDown
->
Store
(
rStrm
)
)
...
@@ -218,11 +218,11 @@ bool StgDirEntry::StoreStreams( StgIo& rIo )
...
@@ -218,11 +218,11 @@ bool StgDirEntry::StoreStreams( StgIo& rIo )
{
{
if
(
!
StoreStream
(
rIo
)
)
if
(
!
StoreStream
(
rIo
)
)
return
false
;
return
false
;
if
(
pLeft
)
if
(
m_
pLeft
)
if
(
!
static_cast
<
StgDirEntry
*>
(
pLeft
)
->
StoreStreams
(
rIo
)
)
if
(
!
static_cast
<
StgDirEntry
*>
(
m_
pLeft
)
->
StoreStreams
(
rIo
)
)
return
false
;
return
false
;
if
(
pRight
)
if
(
m_
pRight
)
if
(
!
static_cast
<
StgDirEntry
*>
(
pRight
)
->
StoreStreams
(
rIo
)
)
if
(
!
static_cast
<
StgDirEntry
*>
(
m_
pRight
)
->
StoreStreams
(
rIo
)
)
return
false
;
return
false
;
if
(
m_pDown
)
if
(
m_pDown
)
if
(
!
m_pDown
->
StoreStreams
(
rIo
)
)
if
(
!
m_pDown
->
StoreStreams
(
rIo
)
)
...
@@ -235,10 +235,10 @@ bool StgDirEntry::StoreStreams( StgIo& rIo )
...
@@ -235,10 +235,10 @@ bool StgDirEntry::StoreStreams( StgIo& rIo )
void
StgDirEntry
::
RevertAll
()
void
StgDirEntry
::
RevertAll
()
{
{
m_aEntry
=
m_aSave
;
m_aEntry
=
m_aSave
;
if
(
pLeft
)
if
(
m_
pLeft
)
static_cast
<
StgDirEntry
*>
(
pLeft
)
->
RevertAll
();
static_cast
<
StgDirEntry
*>
(
m_
pLeft
)
->
RevertAll
();
if
(
pRight
)
if
(
m_
pRight
)
static_cast
<
StgDirEntry
*>
(
pRight
)
->
RevertAll
();
static_cast
<
StgDirEntry
*>
(
m_
pRight
)
->
RevertAll
();
if
(
m_pDown
)
if
(
m_pDown
)
m_pDown
->
RevertAll
();
m_pDown
->
RevertAll
();
}
}
...
@@ -249,9 +249,9 @@ bool StgDirEntry::IsDirty()
...
@@ -249,9 +249,9 @@ bool StgDirEntry::IsDirty()
{
{
if
(
m_bDirty
||
m_bInvalid
)
if
(
m_bDirty
||
m_bInvalid
)
return
true
;
return
true
;
if
(
pLeft
&&
static_cast
<
StgDirEntry
*>
(
pLeft
)
->
IsDirty
()
)
if
(
m_pLeft
&&
static_cast
<
StgDirEntry
*>
(
m_
pLeft
)
->
IsDirty
()
)
return
true
;
return
true
;
if
(
pRight
&&
static_cast
<
StgDirEntry
*>
(
pRight
)
->
IsDirty
()
)
if
(
m_pRight
&&
static_cast
<
StgDirEntry
*>
(
m_
pRight
)
->
IsDirty
()
)
return
true
;
return
true
;
if
(
m_pDown
&&
m_pDown
->
IsDirty
()
)
if
(
m_pDown
&&
m_pDown
->
IsDirty
()
)
return
true
;
return
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment