From: Yegor Kozlov Date: Sat, 11 Dec 2010 13:48:18 +0000 (+0000) Subject: mark GutsRecord as terminating row blocks, prevent exception when reading workbooks... X-Git-Tag: REL_3_8_BETA1~102 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=de72a3ca7347ef9b0a69ccdcca437cc7b23e7b16;p=poi.git mark GutsRecord as terminating row blocks, prevent exception when reading workbooks with unexpected GutsRecords, see Bugzilla 50426 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1044655 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index a5e4670409..fe9ac0bd46 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 50246 - Properly position GutsRecord when reading HSSF workbooks 48539 - Added implementation for MROUND(), VAR() and VARP() 50446 - Code cleanup and optimizations to keep some IDE quiet 50437 - Support passing ranges to NPV() diff --git a/src/java/org/apache/poi/hssf/model/RecordOrderer.java b/src/java/org/apache/poi/hssf/model/RecordOrderer.java index b7d942e5dc..764d5a5110 100644 --- a/src/java/org/apache/poi/hssf/model/RecordOrderer.java +++ b/src/java/org/apache/poi/hssf/model/RecordOrderer.java @@ -417,6 +417,7 @@ final class RecordOrderer { case ObjRecord.sid: case TextObjectRecord.sid: + case GutsRecord.sid: // see Bugzilla 50426 case WindowOneRecord.sid: // should really be part of workbook stream, but some apps seem to put this before WINDOW2 case WindowTwoRecord.sid: diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java index 288479ac68..cb7cdbd1f6 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java @@ -1894,4 +1894,9 @@ if(1==2) { HSSFWorkbook wb = openSample("50020.xls"); writeOutAndReadBack(wb); } + + public void test50426() throws Exception { + HSSFWorkbook wb = openSample("50426.xls"); + writeOutAndReadBack(wb); + } } diff --git a/test-data/spreadsheet/50426.xls b/test-data/spreadsheet/50426.xls new file mode 100644 index 0000000000..1a807f854c Binary files /dev/null and b/test-data/spreadsheet/50426.xls differ