Bug 57967 - ModifyDocumentSummaryInformation example deletes custom properties
Summary: ModifyDocumentSummaryInformation example deletes custom properties
Status: RESOLVED WORKSFORME
Alias: None
Product: POI
Classification: Unclassified
Component: HWPF (show other bugs)
Version: 3.12-FINAL
Hardware: Macintosh All
: P2 regression (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-28 14:47 UTC by Steve Tibbett
Modified: 2016-08-13 20:48 UTC (History)
0 users



Attachments
Original document (217.50 KB, application/msword)
2015-05-28 15:01 UTC, Steve Tibbett
Details
Document modified by example code (217.50 KB, application/msword)
2015-05-28 15:02 UTC, Steve Tibbett
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Tibbett 2015-05-28 14:47:07 UTC
The ModifyDocumentSummaryInformation example should open the original file, modify some properties, including custom properties, and then write them back to the original file.

When I attempt to use it with POI 3.12, any custom properties already in the .doc file are actually removed, and the custom properties that are added in the example are not added.
Comment 1 Nick Burch 2015-05-28 14:57:13 UTC
I've just tried with a simple test file, and that example, and the example seems to make the changes I'd expect to it

Are you able to create a very simple test file that shows the problem for us to try to reproduce it with?
Comment 2 Steve Tibbett 2015-05-28 15:01:48 UTC
Created attachment 32762 [details]
Original document

This document has one custom property, "TestProperty", whose value is "TestValue".
Comment 3 Steve Tibbett 2015-05-28 15:02:31 UTC
Created attachment 32763 [details]
Document modified by example code

This is the resulting document.  Note the custom property is gone, and the changes made by the example are not reflected.
Comment 4 Steve Tibbett 2015-05-28 15:04:59 UTC
I've uploaded two files, the original document I'm starting with (I just created a new one), and the document after the ModifyDocumentSummaryInformation was run on it.

File was created with Word for Mac (Preview), Version 15.9.0 (150408), saved as "Word 97-2004 Document (.doc)".
Comment 5 Michiel 2015-07-13 17:47:43 UTC
I also cannot reproduce it. I took the file PropertyTest.doc, added a custom property and ran ModifyDocumentSummaryInformation on that file. It added the new custom properties and retained the one I added before execution as well. I'm using Word for Mac 2011.
Comment 6 Dominik Stadler 2016-08-13 20:48:51 UTC
A few comments indicate that this was not reproducible, therefore I am closing this WORKSFORME for now. If this is still a problem for you then please reopen this bug with some more information about how it can be reproduced, ideally a unit-test that can be added to POI to ensure the bug stays fixed into the future.