Skip to content

Commit

Permalink
Merge pull request #109 from Numpsy/users/rw/user_defined_4
Browse files Browse the repository at this point in the history
Correct the Guid used when writing the user defined properties sectio…
  • Loading branch information
ironfede authored Feb 19, 2024
2 parents aaaa238 + 82428fd commit 7f287e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions sources/OpenMcdf.Extensions/OLEProperties/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ public class PropertyContext

public static class WellKnownFMTID
{
public static string FMTID_SummaryInformation = "{F29F85E0-4FF9-1068-AB91-08002B27B3D9}";
public static string FMTID_DocSummaryInformation = "{D5CDD502-2E9C-101B-9397-08002B2CF9AE}";
public static string FMTID_UserDefinedProperties = "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}";
public static string FMTID_GlobalInfo = "{56616F00-C154-11CE-8553-00AA00A1F95B}";
public static string FMTID_ImageContents = "{56616400-C154-11CE-8553-00AA00A1F95B}";
public static string FMTID_ImageInfo = "{56616500-C154-11CE-8553-00AA00A1F95B}";
public const string FMTID_SummaryInformation = "{F29F85E0-4FF9-1068-AB91-08002B27B3D9}";
public const string FMTID_DocSummaryInformation = "{D5CDD502-2E9C-101B-9397-08002B2CF9AE}";
public const string FMTID_UserDefinedProperties = "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}";
public const string FMTID_GlobalInfo = "{56616F00-C154-11CE-8553-00AA00A1F95B}";
public const string FMTID_ImageContents = "{56616400-C154-11CE-8553-00AA00A1F95B}";
public const string FMTID_ImageInfo = "{56616500-C154-11CE-8553-00AA00A1F95B}";
}

public enum PropertyDimensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ internal OLEPropertiesContainer(CFStream cfStream)

switch (pStream.FMTID0.ToString("B").ToUpperInvariant())
{
case "{F29F85E0-4FF9-1068-AB91-08002B27B3D9}":
case WellKnownFMTID.FMTID_SummaryInformation:
this.ContainerType = ContainerType.SummaryInfo;
break;
case "{D5CDD502-2E9C-101B-9397-08002B2CF9AE}":
case WellKnownFMTID.FMTID_DocSummaryInformation:
this.ContainerType = ContainerType.DocumentSummaryInfo;
break;
default:
Expand Down Expand Up @@ -211,7 +211,7 @@ public void Save(CFStream cfStream)

NumPropertySets = 1,

FMTID0 = this.ContainerType == ContainerType.SummaryInfo ? new Guid("{F29F85E0-4FF9-1068-AB91-08002B27B3D9}") : new Guid("{D5CDD502-2E9C-101B-9397-08002B2CF9AE}"),
FMTID0 = this.ContainerType == ContainerType.SummaryInfo ? new Guid(WellKnownFMTID.FMTID_SummaryInformation) : new Guid(WellKnownFMTID.FMTID_DocSummaryInformation),
Offset0 = 0,

FMTID1 = Guid.Empty,
Expand Down Expand Up @@ -248,7 +248,7 @@ public void Save(CFStream cfStream)
PropertyContext = UserDefinedProperties.Context
};

ps.FMTID1 = new Guid("{D5CDD502-2E9C-101B-9397-08002B2CF9AE}");
ps.FMTID1 = new Guid(WellKnownFMTID.FMTID_UserDefinedProperties);
ps.Offset1 = 0;

foreach (var op in this.UserDefinedProperties.Properties)
Expand Down

0 comments on commit 7f287e6

Please sign in to comment.