Skip to content

Commit f7954e5

Browse files
committed
fix for issue1281, ignore missing calcChain part
1 parent 35141f2 commit f7954e5

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/DocumentFormat.OpenXml.Framework/Packaging/OpenXmlPartContainer.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1794,10 +1794,17 @@ internal OpenXmlPart CreateOpenXmlPart(string relationshipType)
17941794
/// <param name="loadedParts">Temp collection to detect loaded (shared) parts.</param>
17951795
internal void LoadReferencedPartsAndRelationships(OpenXmlPackage openXmlPackage, OpenXmlPart? sourcePart, RelationshipCollection relationshipCollection, Dictionary<Uri, OpenXmlPart> loadedParts)
17961796
{
1797-
foreach (var relationship in relationshipCollection)
1797+
List<string> partsToIgnore = new()
17981798
{
17991799
// Fix bug https://github.com/OfficeDev/Open-XML-SDK/issues/1205
1800-
if (relationship.RelationshipType == @"http://schemas.microsoft.com/office/2006/relationships/recovered")
1800+
@"http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain",
1801+
1802+
// Fix bug https://github.com/OfficeDev/Open-XML-SDK/issues/1205
1803+
@"http://schemas.microsoft.com/office/2006/relationships/recovered",
1804+
};
1805+
foreach (var relationship in relationshipCollection)
1806+
{
1807+
if (partsToIgnore.Contains(relationship.RelationshipType))
18011808
{
18021809
continue;
18031810
}

0 commit comments

Comments
 (0)