/** * Adds an extended formatting record to the list. If the XF record passed * in has not been initialized, its index is determined based on the * xfRecords list, and * this position is passed to the XF records initialize method * * @param xf the xf record to add * @exception NumFormatRecordsException */ public final void addStyle(XFRecord xf) throws NumFormatRecordsException { if (!xf.isInitialized()) { int pos = xfRecords.size(); xf.initialize(pos, this, fonts); xfRecords.add(xf); } else { // The XF record has probably been read in. If the index is greater // Than the size of the list, then it is not a preset format, // so add it if (xf.getXFIndex() >= xfRecords.size()) { xfRecords.add(xf); } } }
/** * Adds an extended formatting record to the list. If the XF record passed * in has not been initialized, its index is determined based on the * xfRecords list, and * this position is passed to the XF records initialize method * * @param xf the xf record to add * @exception NumFormatRecordsException */ public final void addStyle(XFRecord xf) throws NumFormatRecordsException { if (!xf.isInitialized()) { int pos = xfRecords.size(); xf.initialize(pos, this, fonts); xfRecords.add(xf); } else { // The XF record has probably been read in. If the index is greater // Than the size of the list, then it is not a preset format, // so add it if (xf.getXFIndex() >= xfRecords.size()) { xfRecords.add(xf); } } }
if (!xfr.isInitialized())
/** * Adds the format information to the shared records. Performs the necessary * checks (and clones) to ensure that the formats are not shared. * Called from setCellDetails and setCellFormat */ private void addCellFormat() { // Check to see if the format is one of the shared Workbook defaults. If // so, then get hold of the Workbook's specific instance Styles styles = sheet.getWorkbook().getStyles(); format = styles.getFormat(format); try { if (!format.isInitialized()) { formattingRecords.addStyle(format); } } catch (NumFormatRecordsException e) { logger.warn("Maximum number of format records exceeded. Using " + "default format."); format = styles.getNormalStyle(); } }
if (!xfr.isInitialized())
/** * Adds the format information to the shared records. Performs the necessary * checks (and clones) to ensure that the formats are not shared. * Called from setCellDetails and setCellFormat */ private void addCellFormat() { // Check to see if the format is one of the shared Workbook defaults. If // so, then get hold of the Workbook's specific instance Styles styles = sheet.getWorkbook().getStyles(); format = styles.getFormat(format); try { if (!format.isInitialized()) { formattingRecords.addStyle(format); } } catch (NumFormatRecordsException e) { logger.warn("Maximum number of format records exceeded. Using " + "default format."); format = styles.getNormalStyle(); } }