use of org.xlsx4j.sml.CTXf in project docx4j by plutext.
the class CellUtils method getNumberFormatIndex.
// /**
// * Get the index of the number format (numFmt) record used by this cell format.
// *
// * @return the index of the number format
// */
// public long getDataFormatIndexZZZ(CTCellStyle cellStyle) {
// CTXf xf = this.stylesPart.getXfByIndex(cellStyle.getXfId());
// if (xf == null) {
// throw new RuntimeException("xf unexpectedly null");
// }
//
// System.out.println("Using NumFmtId " + xf.getNumFmtId());
//
// return xf.getNumFmtId();
// //(short)_cellXf.getNumFmtId();
// }
/**
* Get the index of the number format (numFmt) record used by this cell format.
*
* @return the index of the number format
*/
public static long getNumberFormatIndex(Cell _cell) {
Styles stylesPart = WorksheetPart.getWorksheetPart(_cell).getWorkbookPart().getStylesPart();
CTXf xf = stylesPart.getXfByIndex(_cell.getS());
if (xf == null) {
throw new RuntimeException("xf unexpectedly null");
}
log.debug("Using NumFmtId " + xf.getNumFmtId());
return xf.getNumFmtId();
// (short)_cellXf.getNumFmtId();
}
use of org.xlsx4j.sml.CTXf in project docx4j by plutext.
the class CellUtils method getCellStyle.
/**
* Return the cell's style.
*
* @return the cell's style.</code>
*/
public static CTCellStyle getCellStyle(Cell _cell) {
Styles stylesPart = WorksheetPart.getWorksheetPart(_cell).getWorkbookPart().getStylesPart();
CTXf xf = stylesPart.getXfByIndex(_cell.getS());
if (xf == null) {
throw new RuntimeException("xf unexpectedly null");
}
return stylesPart.getStyleByIndex(xf.getXfId());
}