Bug 57967

Summary: ModifyDocumentSummaryInformation example deletes custom properties
Product: POI Reporter: Steve Tibbett <stevex-apache>
Component: HWPFAssignee: POI Developers List <dev>
Status: RESOLVED WORKSFORME    
Severity: regression    
Priority: P2    
Version: 3.12-FINAL   
Target Milestone: ---   
Hardware: Macintosh   
OS: All   
Attachments: Original document
Document modified by example code

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.