Bug 21722 - [PATCH] Add a ProtectRecord to Sheets and give control over protection in HSSFSheet
Summary: [PATCH] Add a ProtectRecord to Sheets and give control over protection in HSS...
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.0-pre3
Hardware: Other other
: P3 normal with 1 vote (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2003-07-18 22:51 UTC by Rick Berman
Modified: 2004-11-16 19:05 UTC (History)
0 users

cvs diff output for the entire patch set (8.14 KB, patch)
2003-07-18 22:52 UTC, Rick Berman
Details | Diff
Here's the same patch without tab characters in the files (8.65 KB, patch)
2003-07-19 01:12 UTC, Rick Berman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rick Berman 2003-07-18 22:51:16 UTC
1. Add a ProtectRecord to Sheet when it is created/initialized.  Default to no 
protection (false).
2. Add methods on HSSFSheet to manipulate the protection setting.
3. Replace the public short getProtect() method on ProtectRecord with public 
boolean getProtect().
4. Update ProtectionRev4Record to follow changes to ProtectRecord.
5. Fixed probable copy/paste typo in ProtectionRev4Record.toString().
6. Add support in TestHSSFSheet for the ability to control the protection of 
the sheet.

This has been done against the REL_2_BRANCH rather than the HEAD because the 
HEAD is a bit of a moving target lately.

I've not put @author tags in the files I've changed due to the general 
triviality of the changes I'm making.

This is my first submission so I'll assert here that I don't have legal baggage 
that would affect my ability to contribute.  My current client (the party 
interested in using POI with this patch) claims no rights to this code.
Comment 1 Rick Berman 2003-07-18 22:52:08 UTC
Created attachment 7382 [details]
cvs diff output for the entire patch set
Comment 2 Paul Krause 2003-07-18 22:56:41 UTC
This patch has tabs in it, and each line with tabs in it is indented twice as 
much as it should be.   It is not a big deal, but it would be nice if someone 
converted each tab to 4 spaces before this patch is committed.
Comment 3 Rick Berman 2003-07-19 01:12:45 UTC
Created attachment 7383 [details]
Here's the same patch without tab characters in the files
Comment 4 Rick Berman 2003-07-19 01:16:15 UTC
I added a second, semantically equivalent, patch to the attachments.  The 
second one eliminates the tab characters I introduced into the files.  Please 
note that Sheet.java and HSSFSheet.java came from CVS with a healthy dose of 
tab characters in each.  (ProtectionRev4Record.java, ProtectRecord.java, and 
TestHSSFSheet.java were each clean of tab characters.)  The second attachment 
deltas include a few more lines than the first.  This appears to be just cvs 
diff catching them due to whitespace changes.  I'm not sure why it would given 
that it's leaving out many other lines that had whitespace changes.

So, if/when this patch is applied, work with whichever attachment is more 
Comment 5 Andy Oliver 2003-07-24 17:21:47 UTC
we should apply this.  It will turn off like the #4 most frequently asked
question ;-) on the list
Comment 6 Avik Sengupta 2003-07-31 18:06:05 UTC
Can someone please verify that workbooks created with after the patch is applied
are still properly openable in excel. (creating new files, as well as after
modifying existing ones). Please?
Comment 7 Avik Sengupta 2003-08-23 18:58:29 UTC
Nobody answered my previous question... but looks ok-ish to me, checked a few
files within Excel.

Comitted to both rel-2 and HEAD... maybe it should have just gone to head.. but
anyways, its done. Thanks Rick.