https://bz.apache.org/bugzilla/show_bug.cgi?id=60605

Javen O'Neal <one...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #3 from Javen O'Neal <one...@apache.org> ---
While working on this, I read the javadoc comment for setSheetHidden(int
sheetIndex, int state) that the active sheet cannot be hidden, but we do not
enforce this.

Presumably, saving a workbook with a hidden active sheet would result in Excel
complaining about a corrupted workbook when opened (untested).

There are a few ways we can handle this:
1) Make the recommendation in the javadoc but do not enforce this rule
2) Option 1 plus logging a warning that an active sheet was hidden
3) throw an IllegalStateException when trying to hide an active sheet
4) Activate the next visible sheet if hiding the active sheet. Log a warning
that setSheetVisibility had this un-asked for side-effect. If there are no
other visible sheets, throw an IllegalStateException (this is closest to what
Excel does, but may make for some rare bugs).
5) Same as number 4, but defer checking until saving the workbook (throwing an
IllegalStateException at this point would be fatal and could cause problems if
the workbook is partially serialized).

Which behavior is least surprising?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to