From eee5ade28e86c03479ceb27ff0e7cf2295d2c83e Mon Sep 17 00:00:00 2001 From: "Amol S. Deshmukh" Date: Wed, 20 Jul 2005 14:12:24 +0000 Subject: [PATCH] [35799] Used getXFIndexForColAt(short ) to get the default ExtendedFormatRecord for the cell git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353753 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/hssf/usermodel/HSSFCell.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java b/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java index f0216df148..60648d8138 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java @@ -31,7 +31,6 @@ import org.apache.poi.hssf.record.aggregates.FormulaRecordAggregate; import org.apache.poi.hssf.record.formula.Ptg; import java.text.DateFormat; -import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; @@ -155,9 +154,10 @@ public class HSSFCell // is different to CELL_TYPE_BLANK hence the following method call correctly // creates a new blank cell. setCellType(CELL_TYPE_BLANK, false); - ExtendedFormatRecord xf = book.getExFormatAt(0xf); - - setCellStyle(new HSSFCellStyle(( short ) 0xf, xf)); + + short xfindex = sheet.getXFIndexForColAt(col); + ExtendedFormatRecord xf = book.getExFormatAt(xfindex); + setCellStyle(new HSSFCellStyle(xfindex, xf)); } /** @@ -238,7 +238,9 @@ public class HSSFCell (( BoolErrRecord ) record).setValue(( byte ) 0); break; } - ExtendedFormatRecord xf = book.getExFormatAt(0xf); + + int xfindex = sheet.getXFIndexForColAt(col); + ExtendedFormatRecord xf = book.getExFormatAt(xfindex); setCellStyle(new HSSFCellStyle(( short ) 0xf, xf)); } -- 2.39.5