diff options
author | Nick Burch <nick@apache.org> | 2007-01-05 17:38:54 +0000 |
---|---|---|
committer | Nick Burch <nick@apache.org> | 2007-01-05 17:38:54 +0000 |
commit | f3afe8c16ce9cc5fd9b482a7718532e00ba5ea72 (patch) | |
tree | 1cacce98e4e5fcd86b4b5aae2fd657f273e1b714 /src/java/org | |
parent | 4b46881ecc72b4dd03ac111a786c613479b85d23 (diff) | |
download | poi-f3afe8c16ce9cc5fd9b482a7718532e00ba5ea72.tar.gz poi-f3afe8c16ce9cc5fd9b482a7718532e00ba5ea72.zip |
Yegor's patch from bug #41242
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@493098 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-rw-r--r-- | src/java/org/apache/poi/hssf/record/ObjRecord.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/java/org/apache/poi/hssf/record/ObjRecord.java b/src/java/org/apache/poi/hssf/record/ObjRecord.java index 34ccef7551..0dc48836fb 100644 --- a/src/java/org/apache/poi/hssf/record/ObjRecord.java +++ b/src/java/org/apache/poi/hssf/record/ObjRecord.java @@ -81,13 +81,25 @@ public class ObjRecord subrecords = new ArrayList(); //Check if this can be continued, if so then the //following wont work properly + int subSize = 0; byte[] subRecordData = in.readRemainder(); RecordInputStream subRecStream = new RecordInputStream(new ByteArrayInputStream(subRecordData)); while(subRecStream.hasNextRecord()) { subRecStream.nextRecord(); Record subRecord = SubRecord.createSubRecord(subRecStream); + subSize += subRecord.getRecordSize(); subrecords.add(subRecord); } + + /** + * Check if the RecordInputStream skipped EndSubRecord, + * if it did then append it explicitly. + * See Bug 41242 for details. + */ + if (subRecordData.length - subSize == 4){ + subrecords.add(new EndSubRecord()); + } + /* JMH the size present/not present in the code below needs to be considered in the RecordInputStream?? int pos = offset; |