[Libreoffice-commits] .: 2 commits - sot/qa sot/source

Caolán McNamara caolan at kemper.freedesktop.org
Wed Feb 29 05:05:32 PST 2012


 sot/qa/cppunit/data/pass/fdo41642-3.compound |binary
 sot/source/sdstor/stgdir.cxx                 |   19 +++++++++++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)

New commits:
commit 4444565b179db949457ce2e4bade2cb33519df63
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Feb 29 13:04:49 2012 +0000

    refactor upper chain test a tiny bit

diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index e34e2d5..7a69118 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 ) )
commit 0a9ced485fb712ce0d03fb20be1df6067606e11c
Author: Wei Ming Khoo <wmk26 at cam.ac.uk>
Date:   Wed Feb 29 13:01:35 2012 +0000

    fix storage chain loop

diff --git a/sot/qa/cppunit/data/pass/fdo41642-3.compound b/sot/qa/cppunit/data/pass/fdo41642-3.compound
new file mode 100644
index 0000000..46a9e84
Binary files /dev/null and b/sot/qa/cppunit/data/pass/fdo41642-3.compound differ
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index 7bdade9..e34e2d5 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -825,6 +825,17 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper )
                 return;
             }
 
+            if (pUpper)
+            {
+                StgDirEntry *pUpperUpper = pUpper->pUp;
+                if (pUpperUpper && pUpperUpper->aEntry.GetLeaf(STG_CHILD) == nLeaf)
+                {
+                    OSL_FAIL("Leaf node of upper-upper StgDirEntry is same as current StgDirEntry's leaf node. Circular entry chain, discarding link");
+                    delete pCur;
+                    return;
+                }
+             }
+
             if( StgAvlNode::Insert
                 ( (StgAvlNode**) ( pUpper ? &pUpper->pDown : &pRoot ), pCur ) )
             {


More information about the Libreoffice-commits mailing list