Fixed code that adds a format record to keep indexes to xfpos and bspos correct.Bug: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13219

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352877 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shawn Laubach 2002-10-04 20:27:16 +00:00
parent 4596d372c5
commit 66e0e30813
1 changed files with 2 additions and 0 deletions

View File

@ -1848,6 +1848,8 @@ public class Workbook {
* @see org.apache.poi.hssf.record.Record
*/
public short createFormat(String format) {
++xfpos; //These are to ensure that positions are updated properly
++bspos;
FormatRecord rec = new FormatRecord();
maxformatid = maxformatid >= (short)0xa4 ? (short)(maxformatid + 1) : (short)0xa4; //Starting value from M$ empiracle study.
rec.setIndexCode(maxformatid);