diff options
author | Yegor Kozlov <yegor@apache.org> | 2007-09-13 19:11:10 +0000 |
---|---|---|
committer | Yegor Kozlov <yegor@apache.org> | 2007-09-13 19:11:10 +0000 |
commit | 0b8319bdcdcefea87e0cad3e1165c277f09e9a7a (patch) | |
tree | 409dec8e440ea3aa022f5491d214a0f6e68bf6a5 /src/java/org/apache | |
parent | 5e35e578b0be54430da70833e89d5bc508496bfe (diff) | |
download | poi-0b8319bdcdcefea87e0cad3e1165c277f09e9a7a.tar.gz poi-0b8319bdcdcefea87e0cad3e1165c277f09e9a7a.zip |
fixed re-open of bug #42844. HSSFEventFactory silently skips unknown records that happen to be continued.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@575406 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache')
-rw-r--r-- | src/java/org/apache/poi/hssf/eventusermodel/HSSFEventFactory.java | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/java/org/apache/poi/hssf/eventusermodel/HSSFEventFactory.java b/src/java/org/apache/poi/hssf/eventusermodel/HSSFEventFactory.java index 1cd80d535b..70c989c179 100644 --- a/src/java/org/apache/poi/hssf/eventusermodel/HSSFEventFactory.java +++ b/src/java/org/apache/poi/hssf/eventusermodel/HSSFEventFactory.java @@ -22,15 +22,7 @@ import java.io.InputStream; import java.io.IOException; import org.apache.poi.hssf.eventusermodel.HSSFUserException; -import org.apache.poi.hssf.record.RecordFormatException; -import org.apache.poi.hssf.record.Record; -import org.apache.poi.hssf.record.RecordInputStream; -import org.apache.poi.hssf.record.RecordFactory; -import org.apache.poi.hssf.record.ContinueRecord; -import org.apache.poi.hssf.record.DrawingRecord; -import org.apache.poi.hssf.record.DrawingGroupRecord; -import org.apache.poi.hssf.record.ObjRecord; -import org.apache.poi.hssf.record.TextObjectRecord; +import org.apache.poi.hssf.record.*; import org.apache.poi.poifs.filesystem.POIFSFileSystem; /** @@ -151,7 +143,7 @@ public class HSSFEventFactory { in.nextRecord(); sid = in.getSid();; - + // // for some reasons we have to make the workbook to be at least 4096 bytes // but if we have such workbook we fill the end of it with zeros (many zeros) @@ -215,7 +207,11 @@ public class HSSFEventFactory rec = lastRec; } else { - throw new RecordFormatException("Records should handle ContinueRecord internally. Should not see this exception"); + if (rec instanceof UnknownRecord) { + ;//silently skip records we don't know about + } else { + throw new RecordFormatException("Records should handle ContinueRecord internally. Should not see this exception"); + } } } |