Skip to content

Flat OPC and cloning features are broken #1814

Closed
@ThomasBarnekow

Description

@ThomasBarnekow

Describe the bug
Based on my analysis, the Flat OPC and cloning features are "broken" since v3.0.1:

  • When creating a Flat OPC document, the resulting WordprocessingDocument instances no longer have the relationship parts.
  • Cloning a WordprocessingDocument created from a Flat OPC document or string throws an OpenXmlPackageException.

To Reproduce
To reproduce, have a look at the OpenXmlSdtTests repo that I created for this purpose. I have created several xUnit-based projects that test the same features for the following versions:

  • v2.19.0, where everything works as expected,
  • v3.0.0, where everything works as expected after having made the changes related to Package being obsolete,
  • v3.0.1, where the features are first broken, and
  • v3.1.1, where the features are still broken.

Observed behavior

  1. Since v3.0.1, WordprocessingDocument instances created using WordprocessingDocument.FromFlatOpcString(xml) no longer have the relationship parts. Up to and including v3.0.0, those parts appeared.
  2. Since v3.0.1, cloning a WordprocessingDocument instance created using WordprocessingDocument.FromFlatOpcString(xml) can no longer be cloned. Calling the Clone() method or its overloads will throw an error.

Expected behavior

  1. Flat OPC documents are created correctly (as before).
  2. WordprocessingDocument instances can be cloned (as before).

Desktop (please complete the following information):

  • OS: any (tested on macOS and Windows 11)
  • Office version: any
  • .NET Target: any (tested using .NET 8 and .NET Framework 4.7.2)
  • DocumentFormat.OpenXml Version: since v3.0.1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions