cvs commit: jakarta-poi/src/java/org/apache/poi/hssf/usermodel HSSFCell.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

cvs commit: jakarta-poi/src/java/org/apache/poi/hssf/usermodel HSSFCell.java

Amol Deshmukh-3
amol        2005/07/20 07:12:24

  Modified:    src/java/org/apache/poi/hssf/usermodel HSSFCell.java
  Log:
  [35799] Used getXFIndexForColAt(short ) to get the default ExtendedFormatRecord for the cell
 
  Revision  Changes    Path
  1.31      +7 -5      jakarta-poi/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java
 
  Index: HSSFCell.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- HSSFCell.java 20 May 2005 09:13:14 -0000 1.30
  +++ HSSFCell.java 20 Jul 2005 14:12:24 -0000 1.31
  @@ -31,7 +31,6 @@
   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 @@
           // 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 @@
                   (( 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));
       }
 
 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/