Open-XML-SDK icon indicating copy to clipboard operation
Open-XML-SDK copied to clipboard

Can `LoadFromPart` set `OpenXmlPart` instead?

Open twsouthwick opened this issue 3 years ago • 2 comments

There are some times where a part is created and we need to have the part set, but it appears that LoadFromPart cannot set it itself. It would be nice to set it there.

Originally posted by @twsouthwick in https://github.com/OfficeDev/Open-XML-SDK/pull/997#discussion_r697611764

twsouthwick avatar Aug 30 '21 20:08 twsouthwick

@twsouthwick, as noted in PR #997, setting the OpenXmlPart in the LoadFromPart leads to a failed unit test.

ThomasBarnekow avatar Sep 07 '21 12:09 ThomasBarnekow

Right - the question is if that is a test failure or indication of a different issue.

Long term, it would be better to just have all part constructors take a package and set it in more of RAII style

twsouthwick avatar Sep 15 '21 18:09 twsouthwick