style.setFont(newFont);
cell.setCellStyle(style);
}
public static void setFontStrikethrough(Worksheet sheet,int row,int col, boolean strikeout){
final Cell cell = Utils.getOrCreateCell(sheet,row,col);
final Book book = (Book) sheet.getWorkbook();
final short fontIdx = cell.getCellStyle().getFontIndex();
final Font font = book.getFontAt(fontIdx);
final boolean orgStrikeout = font.getStrikeout();
if (orgStrikeout == strikeout) { //no change, skip
return;
}
final short boldWeight = font.getBoldweight();
final Color color = BookHelper.getFontColor(book, font);
final short fontHeight = font.getFontHeight();
final String name = font.getFontName();
final boolean italic = font.getItalic();
final short typeOffset = font.getTypeOffset();
final byte underline = font.getUnderline();
final Font newFont = BookHelper.getOrCreateFont(book, boldWeight, color, fontHeight, name, italic, strikeout, typeOffset, underline);
final CellStyle style = cloneCellStyle(cell);
style.setFont(newFont);
cell.setCellStyle(style);
}