List of usage examples for org.apache.poi.hssf.usermodel HSSFCellStyle getParentStyle
public HSSFCellStyle getParentStyle()
From source file:org.formulacompiler.spreadsheet.internal.excel.xls.saver.ExcelXLSSaver.java
License:Open Source License
private void extractCellFormatsFrom(Workbook _xwb) { final short styleCount = _xwb.getNumCellStyles(); for (short idx = 0; idx < styleCount; idx++) { final HSSFCellStyle cellStyle = (HSSFCellStyle) _xwb.getCellStyleAt(idx); try {//w ww . jav a2 s. c om final String styleName = cellStyle.getParentStyle().getUserStyleName(); if (styleName != null) { this.cellStyles.put(styleName, cellStyle); } } catch (Exception e) { // Do nothing, we use only styles with parents } } }