]> source.dussan.org Git - poi.git/commitdiff
Don't try to clone a chart, this makes integration-tests work for a few more document...
authorDominik Stadler <centic@apache.org>
Sun, 18 Jun 2017 05:59:25 +0000 (05:59 +0000)
committerDominik Stadler <centic@apache.org>
Sun, 18 Jun 2017 05:59:25 +0000 (05:59 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799037 13f79535-47bb-0310-9956-ffa450edef68

src/integrationtest/org/apache/poi/TestAllFiles.java
src/integrationtest/org/apache/poi/stress/SpreadsheetHandler.java
src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java
test-data/spreadsheet/56557.xlsx

index f3d79eb17234f87b0e979eef8015a883e7fb6056..14e346bd3f84f5ab4e35bfefe39ef064b094525f 100644 (file)
@@ -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(
index 854dbf2fba2dffa3c821c9b517b4ba701901b543..2b5c6295fdbbccc3b556d857131009bbdaff5b67 100644 (file)
@@ -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 extends AbstractFileHandler {
                }*/
 
            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) {
index 2a4653173f0ccd08bb093955923fa421969fd61c..9179362fa2add7fe14b9bcb1d3dd8c048bc2d301 100644 (file)
@@ -580,7 +580,7 @@ public final class TestSXSSFWorkbook extends BaseTestXWorkbook {
 
     @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));
index d092ffa6b66fbc0647baffd10219b2cb6125ea19..7ca891cf5177b386b4f10f477dbcac901a64ffa4 100644 (file)
Binary files a/test-data/spreadsheet/56557.xlsx and b/test-data/spreadsheet/56557.xlsx differ