HSSFCell cell = (HSSFCell) value;
if (cell != null) {
HSSFCellStyle style = cell.getCellStyle();
- HSSFFont f = wb.getFontAt(style.getFontIntIndex());
+ HSSFFont f = wb.getFontAt(style.getFontIndexAsInt());
boolean isbold = f.getBold();
boolean isitalics = f.getItalic();
if (c != null) {
HSSFCellStyle s = c.getCellStyle();
- HSSFFont f = wb.getFontAt(s.getFontIntIndex());
+ HSSFFont f = wb.getFontAt(s.getFontIndexAsInt());
setFont(SVTableUtils.makeFont(f));
if (s.getFillPattern() == FillPatternType.SOLID_FOREGROUND) {
System.out.print("FG=" + renderColor(style.getFillForegroundColorColor()) + " ");
System.out.print("BG=" + renderColor(style.getFillBackgroundColorColor()) + " ");
- Font font = wb.getFontAt(style.getFontIntIndex());
+ Font font = wb.getFontAt(style.getFontIndexAsInt());
System.out.print("Font=" + font.getFontName() + " ");
System.out.print("FontColor=");
if (font instanceof HSSFFont) {
}
private void fontStyle(CellStyle style) {
- Font font = wb.getFontAt(style.getFontIntIndex());
+ Font font = wb.getFontAt(style.getFontIndexAsInt());
if (font.getBold()) {
out.format(" font-weight: bold;%n");
* @since 4.0.0
*/
@Override
- public int getFontIntIndex()
+ public int getFontIndexAsInt()
{
return _format.getFontIndex();
}
/**
* gets the font for this style
* @param parentWorkbook The HSSFWorkbook that this style belongs to
- * @see org.apache.poi.hssf.usermodel.HSSFCellStyle#getFontIntIndex()
+ * @see org.apache.poi.hssf.usermodel.HSSFCellStyle#getFontIndexAsInt()
* @see org.apache.poi.hssf.usermodel.HSSFWorkbook#getFontAt(int)
*/
public HSSFFont getFont(org.apache.poi.ss.usermodel.Workbook parentWorkbook) {
- return ((HSSFWorkbook) parentWorkbook).getFontAt(getFontIntIndex());
+ return ((HSSFWorkbook) parentWorkbook).getFontAt(getFontIndexAsInt());
}
/**
FontRecord fr = _workbook.createNewFont();
fr.cloneStyleFrom(
source._workbook.getFontRecordAt(
- source.getFontIntIndex()
+ source.getFontIndexAsInt()
)
);
/**
* gets the index of the font for this style
* @see Workbook#getFontAt(short)
- * @deprecated use <code>getFontIntIndex()</code> instead
+ * @deprecated use <code>getFontIndexAsInt()</code> instead
*/
@Removal(version = "4.2")
short getFontIndex();
* @see Workbook#getFontAt(int)
* @since 4.0.0
*/
- int getFontIntIndex();
+ int getFontIndexAsInt();
/**
* set the cell's using this style to be hidden
put(properties, FILL_PATTERN, style.getFillPattern());
put(properties, FILL_FOREGROUND_COLOR, style.getFillForegroundColor());
put(properties, FILL_BACKGROUND_COLOR, style.getFillBackgroundColor());
- put(properties, FONT, style.getFontIntIndex());
+ put(properties, FONT, style.getFontIndexAsInt());
put(properties, HIDDEN, style.getHidden());
put(properties, INDENTION, style.getIndention());
put(properties, LEFT_BORDER_COLOR, style.getLeftBorderColor());
if (cellType == CellType.FORMULA)
cellType = cell.getCachedFormulaResultType();
- Font font = wb.getFontAt(style.getFontIntIndex());
+ Font font = wb.getFontAt(style.getFontIndexAsInt());
double width = -1;
if (cellType == CellType.STRING) {
* @since 4.0.0
*/
@Override
- public int getFontIntIndex() {
+ public int getFontIndexAsInt() {
return getFontId();
}
private static void assumeRequiredFontsAreInstalled(final Workbook workbook, final Cell cell) {
// autoSize will fail if required fonts are not installed, skip this test then
- Font font = workbook.getFontAt(cell.getCellStyle().getFontIntIndex());
+ Font font = workbook.getFontAt(cell.getCellStyle().getFontIndexAsInt());
Assume.assumeTrue("Cannot verify autoSizeColumn() because the necessary Fonts are not installed on this machine: " + font,
SheetUtil.canComputeColumnWidth(font));
}
private static void assumeRequiredFontsAreInstalled(final Workbook workbook, final Cell cell) {
// autoSize will fail if required fonts are not installed, skip this test then
- Font font = workbook.getFontAt(cell.getCellStyle().getFontIntIndex());
+ Font font = workbook.getFontAt(cell.getCellStyle().getFontIndexAsInt());
Assume.assumeTrue("Cannot verify autoSizeColumn() because the necessary Fonts are not installed on this machine: " + font,
SheetUtil.canComputeColumnWidth(font));
}
cellXf.setXfId(1);
stylesTable.putCellXf(cellXf);
XSSFCellStyle cellStyle = new XSSFCellStyle(1, 1, stylesTable, null);
- assertEquals(1, cellStyle.getFontIntIndex());
+ assertEquals(1, cellStyle.getFontIndexAsInt());
sheet.setDefaultColumnStyle(3, cellStyle);
assertEquals(1, ctWorksheet.getColsArray(0).getColArray(0).getStyle());
Cell cell = row.getCell(1);
CellStyle style = cell.getCellStyle();
- assertEquals(26, style.getFontIntIndex());
+ assertEquals(26, style.getFontIndexAsInt());
row = sheet.getRow(3);
cell = row.getCell(1);
style = cell.getCellStyle();
- assertEquals(28, style.getFontIntIndex());
+ assertEquals(28, style.getFontIndexAsInt());
// check the two fonts
HSSFFont font = wb.getFontAt(26);
s1 = wb2.getSheetAt(0);
assertEquals(num0 + 1, wb2.getNumberOfFontsAsInt());
- int idx = s1.getRow(0).getCell(0).getCellStyle().getFontIntIndex();
+ int idx = s1.getRow(0).getCell(0).getCellStyle().getFontIndexAsInt();
Font fnt = wb2.getFontAt(idx);
assertNotNull(fnt);
assertEquals(IndexedColors.YELLOW.getIndex(), fnt.getColor());