You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Rick Berman <ri...@moai.com> on 2003/05/29 17:38:29 UTC

Why no ProtectRecord by default in Sheet.createSheet()?

(My apologies if this is the second time you've seen this.  I originally
sent it last week but it looks like it never got through.)

For a while now, we've had our own customization of
org.apache.poi.hssf.model.Sheet that adds a ProtectRecord (and sets the
protection to true) because we want to create protected sheets within our
workbooks.  Yes, we know that there is no password protection.  We just want
the users that download the files to be reminded what they are supposed to
be changing and what they aren't.

Before we go to the trouble of submitting a patch, I thought I'd ask whether
there is a reason that Sheet.createSheet() should *not* add the
ProtectRecord *with protection false* as does Workbook.createWorkbook()?
Our proposed patch would be something along the lines of copying the code
from Workbook.createProtect() into Sheet and then calling it from
Sheet.createSheet().  Our code would then fish out that record and switch
the protection setting for the sheets on which we need the protection.

Thanks,
  Rick Berman
  Moai Technologies

Re: Why no ProtectRecord by default in Sheet.createSheet()?

Posted by "Andrew C. Oliver" <ac...@apache.org>.
It sounds fair.  Just use a class member in Sheet to hold a reference to the
record (don't go fish, its too slow).  Write unit tests and make sure all
unit tests pass (its an unofficial requirement).

-andy


On 5/29/03 11:38 AM, "Rick Berman" <ri...@moai.com> wrote:

> (My apologies if this is the second time you've seen this.  I originally
> sent it last week but it looks like it never got through.)
> 
> For a while now, we've had our own customization of
> org.apache.poi.hssf.model.Sheet that adds a ProtectRecord (and sets the
> protection to true) because we want to create protected sheets within our
> workbooks.  Yes, we know that there is no password protection.  We just want
> the users that download the files to be reminded what they are supposed to
> be changing and what they aren't.
> 
> Before we go to the trouble of submitting a patch, I thought I'd ask whether
> there is a reason that Sheet.createSheet() should *not* add the
> ProtectRecord *with protection false* as does Workbook.createWorkbook()?
> Our proposed patch would be something along the lines of copying the code
> from Workbook.createProtect() into Sheet and then calling it from
> Sheet.createSheet().  Our code would then fish out that record and switch
> the protection setting for the sheets on which we need the protection.
> 
> Thanks,
> Rick Berman
> Moai Technologies
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 

-- 
Andrew C. Oliver
http://www.superlinksoftware.com/poi.jsp
Custom enhancements and Commercial Implementation for Jakarta POI

http://jakarta.apache.org/poi
For Java and Excel, Got POI?