8000 Always populate UserDefinedProperties.PropertyNames when reading a file with UserDefined properties, and add a read/write user property test by Numpsy · Pull Request #117 · ironfede/openmcdf · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Always populate UserDefinedProperties.PropertyNames when reading a file with UserDefined properties, and add a read/write user property test #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 27, 2024

Conversation

Numpsy
Copy link
Contributor
@Numpsy Numpsy commented Feb 27, 2024

refs #104 and #106 (comment)

.Where(p => p.PropertyType == PropertyType.DictionaryProperty).FirstOrDefault()?.Value;

UserDefinedProperties.PropertyNames = existingPropertyNames ?? new Dictionary<uint, string> ();
Copy link
Contributor Author
@Numpsy Numpsy Feb 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test file 'english.presets.doc' contains a UserDefinedProperties section, but it doesn't contain a dictionary property, which as it stands prevents a user from adding new properties to the existing section.

The Microsoft documentation at https://learn.microsoft.com/en-us/openspecs/office_file_formats/ms-oshared/1414f765-ea8e-4a1e-a19c-641500e5f93d says that the UserDefinedProperty section MUST have a dictionary property so I'm not sure why this file doesn't have one, but - If it must be there then i think it's reasonable to always have PropertyNames set to a not-null value for the UserDefined property section?

@ironfede ironfede merged commit 4b53773 into ironfede:master Feb 27, 2024
@Numpsy Numpsy deleted the test_user_property_add branch February 27, 2024 22:39
@Numpsy Numpsy mentioned this pull request Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0