Bug 47250 - FontRecord 0x31 left 1 bytes remaining
FontRecord 0x31 left 1 bytes remaining
Status: RESOLVED FIXED
Product: POI
Classification: Unclassified
Component: HSSF
3.5-dev
PC Linux
: P2 normal (vote)
: ---
Assigned To: POI Developers List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2009-05-22 11:48 UTC by Jonathan Holloway
Modified: 2009-05-22 14:32 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Holloway 2009-05-22 11:48:56 UTC
Spreadsheet with record 0x31 throws the following exception when using ExcelExtractor:

org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: Initialisation of record 0x31 left 1 bytes remaining still to be read.
	at org.apache.poi.hssf.record.RecordInputStream.hasNextRecord(RecordInputStream.java:124)
	at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:402)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:277)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:202)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:184)

Output from BiffViewer (which ignores the record and continues to parse the spreadsheet) is as follows, I believe this is the correct record here:

    [java] [FONT]
     [java]     .fontheight      = c8
     [java]     .attributes      = 0
     [java]          .italic     = false
     [java]          .strikout   = false
     [java]          .macoutlined= false
     [java]          .macshadowed= false
     [java]     .colorpalette    = 7fff
     [java]     .boldweight      = 190
     [java]     .supersubscript  = 0
     [java]     .underline       = 0
     [java]     .family          = 0
     [java]     .charset         = 0
     [java]     .fontname        = 
     [java] [/FONT]
     [java] 
     [java] org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: Initialisation of record 0x31 left 1 bytes remaining still to be read.
     [java]     at org.apache.poi.hssf.record.RecordInputStream.hasNextRecord(RecordInputStream.java:124)
     [java]     at org.apache.poi.hssf.dev.BiffViewer.createRecords(BiffViewer.java:70)
     [java]     at org.apache.poi.hssf.dev.BiffViewer.main(BiffViewer.java:398)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java]     at java.lang.reflect.Method.invoke(Method.java:597)
     [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
     [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
     [java]     at org.apache.tools.ant.taskdefs.Java.run(Java.java:764)
     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:218)
     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:132)
     [java]     at org.apache.tools.ant.taskdefs.Java.execute(Java.java:105)
     [java]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
     [java]     at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java]     at java.lang.reflect.Method.invoke(Method.java:597)
     [java]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
     [java]     at org.apache.tools.ant.Task.perform(Task.java:348)
     [java]     at org.apache.tools.ant.Target.execute(Target.java:357)
     [java]     at org.apache.tools.ant.Target.performTasks(Target.java:385)
     [java]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
     [java]     at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
     [java]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
     [java]     at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
     [java]     at org.apache.tools.ant.Main.runBuild(Main.java:758)
     [java]     at org.apache.tools.ant.Main.startAnt(Main.java:217)
     [java]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
     [java]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
     [java] Discarding 1 bytes and continuing
     [java] Offset=0x00000334(820) recno=41 sid=0x0031 size=0x0010(16)
     [java] Offset=0x00000348(840) recno=42 sid=0x0031 size=0x001A(26)
     [java] [FONT]
     [java]     .fontheight      = c8
     [java]     .attributes      = 5
     [java]          .italic     = false
     [java]          .strikout   = false
     [java]          .macoutlined= false
     [java]          .macshadowed= false
  [java]     .colorpalette    = a
     [java]     .boldweight      = 2bc
     [java]     .supersubscript  = 0
     [java]     .underline       = 1
     [java]     .family          = 2
     [java]     .charset         = 0
     [java]     .fontname        = Arial
     [java] [/FONT]


Any other info please let me know.
Comment 1 Josh Micich 2009-05-22 14:32:34 UTC
Fixed in svn r777717

junit added