fix deprecation issue

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1890785 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2021-06-14 21:56:46 +00:00
parent b7aa11852e
commit 678446554c
1 changed files with 1 additions and 1 deletions

View File

@ -233,7 +233,7 @@ public final class CellUtil {
public static void setFont(Cell cell, Font font) { public static void setFont(Cell cell, Font font) {
// Check if font belongs to workbook // Check if font belongs to workbook
Workbook wb = cell.getSheet().getWorkbook(); Workbook wb = cell.getSheet().getWorkbook();
final int fontIndex = font.getIndexAsInt(); final int fontIndex = font.getIndex();
if (!wb.getFontAt(fontIndex).equals(font)) { if (!wb.getFontAt(fontIndex).equals(font)) {
throw new IllegalArgumentException("Font does not belong to this workbook"); throw new IllegalArgumentException("Font does not belong to this workbook");
} }