summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-02-29 13:04:49 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-02-29 13:05:05 +0000
commit4444565b179db949457ce2e4bade2cb33519df63 (patch)
tree189d5881808a26bef5a0a79a8f467a8e278607f6 /sot
parent0a9ced485fb712ce0d03fb20be1df6067606e11c (diff)
refactor upper chain test a tiny bit
Diffstat (limited to 'sot')
-rw-r--r--sot/source/sdstor/stgdir.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index e34e2d53dd24..7a69118569ef 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -818,15 +818,15 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper )
if( nLeaf != 0 && nLeft != 0 && nRight != 0 )
{
//fdo#41642 Do we need to check full chain upwards for loops ?
- if (pUpper && pUpper->aEntry.GetLeaf(STG_CHILD) == nLeaf)
- {
- OSL_FAIL("Leaf node of upper StgDirEntry is same as current StgDirEntry's leaf node. Circular entry chain, discarding link");
- delete pCur;
- return;
- }
-
if (pUpper)
{
+ if (pUpper->aEntry.GetLeaf(STG_CHILD) == nLeaf)
+ {
+ OSL_FAIL("Leaf node of upper StgDirEntry is same as current StgDirEntry's leaf node. Circular entry chain, discarding link");
+ delete pCur;
+ return;
+ }
+
StgDirEntry *pUpperUpper = pUpper->pUp;
if (pUpperUpper && pUpperUpper->aEntry.GetLeaf(STG_CHILD) == nLeaf)
{
@@ -834,7 +834,7 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper )
delete pCur;
return;
}
- }
+ }
if( StgAvlNode::Insert
( (StgAvlNode**) ( pUpper ? &pUpper->pDown : &pRoot ), pCur ) )