mirror of https://github.com/apache/poi.git
[35799] getXFIndexForColAt(short ) added
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353752 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9a2dcc327b
commit
c1196ff362
|
@ -822,7 +822,7 @@ public class Sheet implements Model
|
|||
//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 @@ public class Sheet implements Model
|
|||
}
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue