Browse Source

Bug #54016 - Avoid exception when parsing workbooks with DConRefRecord in row aggregate

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1402482 13f79535-47bb-0310-9956-ffa450edef68
tags/3.10-beta1
Yegor Kozlov 11 years ago
parent
commit
4575104984

+ 1
- 0
src/documentation/content/xdocs/status.xml View File



<changes> <changes>
<release version="3.9-beta1" date="2012-??-??"> <release version="3.9-beta1" date="2012-??-??">
<action dev="poi-developers" type="fix">54016 - Avoid exception when parsing workbooks with DConRefRecord in row aggregate</action>
<action dev="poi-developers" type="fix">54008 - Fixed Ant build to support build directories with blanks</action> <action dev="poi-developers" type="fix">54008 - Fixed Ant build to support build directories with blanks</action>
<action dev="poi-developers" type="fix">53374 - Avoid exceptions when parsing hyperlinks of type "javascript://"</action> <action dev="poi-developers" type="fix">53374 - Avoid exceptions when parsing hyperlinks of type "javascript://"</action>
<action dev="poi-developers" type="fix">53404 - Fixed compatibility bug with modifying xls files created by POI-3.6 and earlier</action> <action dev="poi-developers" type="fix">53404 - Fixed compatibility bug with modifying xls files created by POI-3.6 and earlier</action>

+ 5
- 15
src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java View File

import java.util.TreeMap; import java.util.TreeMap;


import org.apache.poi.hssf.model.RecordStream; import org.apache.poi.hssf.model.RecordStream;
import org.apache.poi.hssf.record.ArrayRecord;
import org.apache.poi.hssf.record.CellValueRecordInterface;
import org.apache.poi.hssf.record.ContinueRecord;
import org.apache.poi.hssf.record.DBCellRecord;
import org.apache.poi.hssf.record.DimensionsRecord;
import org.apache.poi.hssf.record.FormulaRecord;
import org.apache.poi.hssf.record.IndexRecord;
import org.apache.poi.hssf.record.MergeCellsRecord;
import org.apache.poi.hssf.record.MulBlankRecord;
import org.apache.poi.hssf.record.Record;
import org.apache.poi.hssf.record.RowRecord;
import org.apache.poi.hssf.record.SharedFormulaRecord;
import org.apache.poi.hssf.record.TableRecord;
import org.apache.poi.hssf.record.UnknownRecord;
import org.apache.poi.hssf.record.*;
import org.apache.poi.ss.formula.FormulaShifter; import org.apache.poi.ss.formula.FormulaShifter;
import org.apache.poi.ss.SpreadsheetVersion; import org.apache.poi.ss.SpreadsheetVersion;


case RowRecord.sid: case RowRecord.sid:
insertRow((RowRecord) rec); insertRow((RowRecord) rec);
continue; continue;
case DBCellRecord.sid:
case DConRefRecord.sid:
addUnknownRecord(rec);
continue;
case DBCellRecord.sid:
// end of 'Row Block'. Should only occur after cell records // end of 'Row Block'. Should only occur after cell records
// ignore DBCELL records because POI generates them upon re-serialization // ignore DBCELL records because POI generates them upon re-serialization
continue; continue;

+ 6
- 0
src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java View File



wb = writeOutAndReadBack((HSSFWorkbook) wb); wb = writeOutAndReadBack((HSSFWorkbook) wb);
} }

public void test54016() {
// This used to break
HSSFWorkbook wb = openSample("54016.xls");
wb = HSSFTestDataSamples.writeOutAndReadBack(wb);
}
} }

BIN
test-data/spreadsheet/54016.xls View File


Loading…
Cancel
Save