You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by am...@apache.org on 2005/07/20 16:11:38 UTC

cvs commit: jakarta-poi/src/java/org/apache/poi/hssf/model Sheet.java

amol        2005/07/20 07:11:38

  Modified:    src/java/org/apache/poi/hssf/model Sheet.java
  Log:
  [35799] getXFIndexForColAt(short ) added
  
  Revision  Changes    Path
  1.56      +32 -1     jakarta-poi/src/java/org/apache/poi/hssf/model/Sheet.java
  
  Index: Sheet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/java/org/apache/poi/hssf/model/Sheet.java,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- Sheet.java	31 May 2005 19:03:19 -0000	1.55
  +++ Sheet.java	20 Jul 2005 14:11:38 -0000	1.56
  @@ -822,7 +822,7 @@
         //Add the references to the DBCells in the IndexRecord (one for each block)
         int blockCount = rows.getRowBlockCount();
         //Calculate the size of this IndexRecord
  -      int indexRecSize = index.getRecordSizeForBlockCount(blockCount);
  +      int indexRecSize = IndexRecord.getRecordSizeForBlockCount(blockCount);
   
         int rowBlockOffset = 0;
         int cellBlockOffset = 0;
  @@ -1833,6 +1833,37 @@
           }
           return retval;
       }
  +    
  +    /**
  +     * get the index to the ExtendedFormatRecord "associated" with 
  +     * the column at specified 0-based index. (In this case, an 
  +     * ExtendedFormatRecord index is actually associated with a 
  +     * ColumnInfoRecord which spans 1 or more columns)
  +     * <br/>
  +     * Returns the index to the default ExtendedFormatRecord (0xF)
  +     * if no ColumnInfoRecord exists that includes the column
  +     * index specified. 
  +     * @param column
  +     * @return index of ExtendedFormatRecord associated with
  +     * ColumnInfoRecord that includes the column index or the
  +     * index of the default ExtendedFormatRecord (0xF)
  +     */
  +    public short getXFIndexForColAt(short column) {
  +        short retval = 0;
  +        ColumnInfoRecord ci = null;
  +        if (columns != null) {
  +            for (Iterator iterator = columns.getIterator(); iterator.hasNext();) {
  +                ci = (ColumnInfoRecord) iterator.next();
  +                if ((ci.getFirstColumn() <= column)
  +                        && (column <= ci.getLastColumn())) {
  +                    break;
  +                }
  +                ci = null;
  +            }
  +        }
  +        retval = (ci != null) ? ci.getXFIndex() : 0xF;
  +        return retval;
  +    }
   
       /**
        * set the width for a given column in 1/20th of a character width units
  
  
  

---------------------------------------------------------------------
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/