]> source.dussan.org Git - poi.git/commitdiff
[35799] Used getXFIndexForColAt(short ) to get the default ExtendedFormatRecord for...
authorAmol S. Deshmukh <amol@apache.org>
Wed, 20 Jul 2005 14:12:24 +0000 (14:12 +0000)
committerAmol S. Deshmukh <amol@apache.org>
Wed, 20 Jul 2005 14:12:24 +0000 (14:12 +0000)
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

index f0216df14836e4709603200fe99590ed6915fd2b..60648d81386bba682e4814fda843659a85dd5e71 100644 (file)
@@ -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));
     }