ironfede / openmcdf

Microsoft Compound File .net component - pure C# - netstandard 2.0
Mozilla Public License 2.0
295 stars 72 forks source link

[Test] Store the value of FmtID0 when reading a property set, and use that v… #135

Open Numpsy opened 3 weeks ago

Numpsy commented 3 weeks ago

…alue on write if available.

As discussed in #134, writing property sets other than SummaryInformation/DocumentSummaryInformation doesn't work because the FmdID0 always gets set to one of those two on write, so any sets that were deemed AppSpecific on load get the wrong value written.

Would it be reasonble to avoid that by retaining the existing FmtID0 when reading a stream, and writing the same value back on write? (falling back to the current behaviour if no value is available)?

We could maybe add a constructor that allows an ID to be specified when a brand new OLEPropertiesContainer is created, but that's a public API change so not quite the same.