Bug 56469 - [PATCH] patch for XWPF to support adding comments
Summary: [PATCH] patch for XWPF to support adding comments
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XWPF (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2014-04-29 01:34 UTC by Brady Alleman
Modified: 2021-05-20 11:05 UTC (History)
2 users (show)



Attachments
a .tar.gz generated using "ant -f patch.xml" for supporting adding comments (6.20 KB, application/x-gzip)
2014-04-29 01:34 UTC, Brady Alleman
Details
a .tar.gz generated using "ant -f patch.xml" for supporting adding and editing comments (19.63 KB, patch)
2016-02-19 13:54 UTC, Simon Sperl
Details | Diff
33570: a .tar.gz generated using "ant -f patch.xml" for supporting adding and editing comments (19.59 KB, patch)
2016-02-19 14:39 UTC, Simon Sperl
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.