Author: centic
Date: Sun Jun 18 05:59:25 2017
New Revision: 1799037
URL: http://svn.apache.org/viewvc?rev=1799037&view=rev
Log:
Don't try to clone a chart, this makes integration-tests work for a few more
documents, also the one added via bug 56557
Modified:
poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java
poi/trunk/src/integrationtest/org/apache/poi/stress/SpreadsheetHandler.java
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java
poi/trunk/test-data/spreadsheet/56557.xlsx
Modified: poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java?rev=1799037&r1=1799036&r2=1799037&view=diff
==============================================================================
--- poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java (original)
+++ poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java Sun Jun 18
05:59:25 2017
@@ -299,8 +299,7 @@ public class TestAllFiles {
"spreadsheet/poc-xmlbomb.xlsx", // contains xml-entity-expansion
"spreadsheet/poc-xmlbomb-empty.xlsx", // contains xml-entity-expansion
"spreadsheet/poc-shared-strings.xlsx", // contains
shared-string-entity-expansion
- "spreadsheet/60255_extra_drawingparts.xlsx", // Non-drawing drawing
-
+
// old Excel files, which we only support simple text extraction of
"spreadsheet/testEXCEL_2.xls",
"spreadsheet/testEXCEL_3.xls",
@@ -321,12 +320,8 @@ public class TestAllFiles {
"ddf/47143.dat",
// sheet cloning errors
- "spreadsheet/47813.xlsx",
"spreadsheet/56450.xls",
- "spreadsheet/OddStyleRecord.xls",
- "spreadsheet/WithChartSheet.xlsx",
- "spreadsheet/chart_sheet.xlsx",
- "spreadsheet/SimpleScatterChart.xlsx"
+ "spreadsheet/OddStyleRecord.xls"
);
private static final Set<String> IGNORED = unmodifiableHashSet(
Modified:
poi/trunk/src/integrationtest/org/apache/poi/stress/SpreadsheetHandler.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/integrationtest/org/apache/poi/stress/SpreadsheetHandler.java?rev=1799037&r1=1799036&r2=1799037&view=diff
==============================================================================
--- poi/trunk/src/integrationtest/org/apache/poi/stress/SpreadsheetHandler.java
(original)
+++ poi/trunk/src/integrationtest/org/apache/poi/stress/SpreadsheetHandler.java
Sun Jun 18 05:59:25 2017
@@ -31,6 +31,7 @@ import org.apache.poi.ss.usermodel.Sheet
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.apache.poi.util.RecordFormatException;
+import org.apache.poi.xssf.usermodel.XSSFChartSheet;
public abstract class SpreadsheetHandler extends AbstractFileHandler {
public void handleWorkbook(Workbook wb) throws IOException {
@@ -125,6 +126,11 @@ public abstract class SpreadsheetHandler
}*/
for (int i=wb.getNumberOfSheets()-1; i>=0; i--) {
+ if(wb.getSheetAt(i) instanceof XSSFChartSheet) {
+ // clone for chart-sheets is not supported
+ continue;
+ }
+
try {
wb.cloneSheet(i);
} catch (RecordFormatException e) {
Modified:
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java?rev=1799037&r1=1799036&r2=1799037&view=diff
==============================================================================
---
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java
(original)
+++
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java
Sun Jun 18 05:59:25 2017
@@ -580,7 +580,7 @@ public final class TestSXSSFWorkbook ext
@Test
public void test56557() throws IOException, InvalidFormatException {
- Workbook wb =
WorkbookFactory.create(XSSFTestDataSamples.getSampleFile("56557.xlsx"));
+ Workbook wb =
WorkbookFactory.create(XSSFTestDataSamples.getSampleFile("56557.xlsx"), null,
false);
// Using streaming XSSFWorkbook makes the output file invalid
wb = new SXSSFWorkbook(((XSSFWorkbook) wb));
Modified: poi/trunk/test-data/spreadsheet/56557.xlsx
URL:
http://svn.apache.org/viewvc/poi/trunk/test-data/spreadsheet/56557.xlsx?rev=1799037&r1=1799036&r2=1799037&view=diff
==============================================================================
Binary files - no diff available.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]