poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 34072] New: - No easy way to tell if worksheet is hidden (no access to the BoundsheetRecord option flag)
Date Fri, 18 Mar 2005 11:24:00 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34072>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34072

           Summary: No easy way to tell if worksheet is hidden (no access to
                    the BoundsheetRecord option flag)
           Product: POI
           Version: 2.5
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: HSSF
        AssignedTo: poi-dev@jakarta.apache.org
        ReportedBy: bobwhite@writeme.com


All I really want to know is whether a worksheet is hidden or not.  It would be
nice if there was a simple boolean method on HSSFSheet that showed this
attribute. It would be so simple to do.  But the way Workbook hides the
boundsheets ArrayList, this is just not possible.  It seems like the only thing
that Workbook doesn't report about any given BoundsheetRecord is the option flag.

Here's what I propose for HSSFWorkbook:

  /**
   * Returns true if given worksheet is hidden.
   *
   * @param  iSheetnum index of worksheet to test.
   * @return true if given worksheet is hidden.
   * @throws    IndexOutOfBoundsException if iSheetnum is out of range 
   */
  public boolean isHidden( int iSheetnum )
  {
    getWorkbook().isHidden( iSheetnum );
  }

Then in Workbook:
  /**
   * Returns true if given worksheet is hidden.
   *
   * @param  iSheetnum index of worksheet to test.
   * @return true if given worksheet is hidden.
   * @throws    IndexOutOfBoundsException if iSheetnum is out of range 
   */
  public boolean isHidden( int iSheetnum )
  {
    BoundSheetRecord bsr = getBoundsheetRecord( iSheetnum );
    return bsr.getOptions() != 0;
  }
    
  /**
   * Returns the BoundsheetRecord associated with given sheet number.
   *
   * @param  iSheetnum index of BoundsheetRecord to return.
   * @return the BoundsheetRecord at the specified position in this list.
   * @throws    IndexOutOfBoundsException if iSheetnum is out of range 
   *        <tt>(iSheetnum &lt; 0 || iSheetnum &gt;= boundsheets.size())</tt>.
   */
  protected BoundsheetRecord getBoundsheetRecord( int iSheetnum )
  { 
    return (BoundsheetRecord)boundsheets.get( iSheetnum );
  }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/


Mime
View raw message