diff --git a/sources/OpenMcdf/CompoundFile.cs b/sources/OpenMcdf/CompoundFile.cs index 7b9374c4..38b18dad 100644 --- a/sources/OpenMcdf/CompoundFile.cs +++ b/sources/OpenMcdf/CompoundFile.cs @@ -1502,44 +1502,19 @@ internal List GetSectorChain(int secID, SectorType chainType) internal RBTree GetChildrenTree(IDirectoryEntry entry) { - RBTree bst = new RBTree(); + RBTree bst = new(); // Load children from their original tree. - LoadChildren(bst, entry); - //bst = DoLoadChildrenTrusted(directoryEntries[sid]); - - //bst.Print(); - //bst.Print(); - //Trace.WriteLine("#### After rethreading"); - - return bst; - } - - private RBTree DoLoadChildrenTrusted(IDirectoryEntry de) - { - RBTree bst = null; - - if (de.Child != DirectoryEntry.NOSTREAM) + if (entry.Child != DirectoryEntry.NOSTREAM) { - bst = new RBTree(directoryEntries[de.Child]); + IDirectoryEntry child = directoryEntries[entry.Child]; + List levelSIDs = new List(); + LoadChildren(bst, child, levelSIDs); } return bst; } - private void LoadChildren(RBTree bst, IDirectoryEntry de) - { - if (de.Child != DirectoryEntry.NOSTREAM) - { - IDirectoryEntry child = directoryEntries[de.Child]; - if (child.StgType != StgType.StgInvalid) - { - List levelSIDs = new List(); - LoadChildren(bst, child, levelSIDs); - } - } - } - private static void NullifyChildNodes(IDirectoryEntry de) { de.Parent = null;