Bug 56469

Summary: [PATCH] patch for XWPF to support adding comments
Product: POI Reporter: Brady Alleman <balleman>
Component: XWPFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: enhancement CC: balleman, sperl.simon
Priority: P2 Keywords: PatchAvailable
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Attachments: a .tar.gz generated using "ant -f patch.xml" for supporting adding comments
a .tar.gz generated using "ant -f patch.xml" for supporting adding and editing comments
33570: a .tar.gz generated using "ant -f patch.xml" for supporting adding and editing comments

Description Brady Alleman 2014-04-29 01:34:50 UTC
Created attachment 31568 [details]
a .tar.gz generated using "ant -f patch.xml" for supporting adding comments

The attached is a .tar.gz generated using "ant -f patch.xml".  The goal of the patch is to allow adding and saving of new comments, while the existing support was mostly useful for reading them.  I will gladly accept feedback on how to better structure the changes.  Includes test case.
Comment 1 Nick Burch 2014-04-29 09:22:23 UTC
Thanks for this

At first glance, the way of adding comments to a paragraph doesn't look quite right to me. From the unit test, it doesn't look too bad for adding a comment to a paragraph you're creating, but it doesn't look very good for the edit case. Not certain what it should be, sorry, but the current way doesn't quite feel right...

Something a bit like the unit test which is an example might be good too!
Comment 2 Simon Sperl 2016-02-19 13:54:41 UTC
Created attachment 33570 [details]
a .tar.gz generated using "ant -f patch.xml" for supporting adding and editing comments

based on a mixture of the previous patch, logic from footnote and sweat.

In general a bit confused when to use create/add/get I tried to be consistent but I am afraid there is not much precedent.

I also think there is a real need for an AbstractBody class, the code duplication is getting pretty strong.
Comment 3 Simon Sperl 2016-02-19 14:39:34 UTC
Created attachment 33571 [details]
33570: a .tar.gz generated using "ant -f patch.xml" for supporting adding and editing comments

fixes a bug in the previous patch when having perfectly overlapping commentRanges
Comment 4 Sayi 2021-05-20 11:05:36 UTC
The comment feature has been supported, should be included in the upcoming Apache POI 5.0.1.