Ensure that XSSFWorkbooks contain a BookView, some corrupt ones do not contain this, e.g. ones created by movescound.com
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1648158 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1cf8152d14
commit
26585f4e95
@ -238,6 +238,13 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Iterable<X
|
|||||||
|
|
||||||
// Build a tree of POIXMLDocumentParts, this workbook being the root
|
// Build a tree of POIXMLDocumentParts, this workbook being the root
|
||||||
load(XSSFFactory.getInstance());
|
load(XSSFFactory.getInstance());
|
||||||
|
|
||||||
|
// some broken Workbooks miss this...
|
||||||
|
if(!workbook.isSetBookViews()) {
|
||||||
|
CTBookViews bvs = workbook.addNewBookViews();
|
||||||
|
CTBookView bv = bvs.addNewWorkbookView();
|
||||||
|
bv.setActiveTab(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -261,6 +268,13 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Iterable<X
|
|||||||
|
|
||||||
// Build a tree of POIXMLDocumentParts, this workbook being the root
|
// Build a tree of POIXMLDocumentParts, this workbook being the root
|
||||||
load(XSSFFactory.getInstance());
|
load(XSSFFactory.getInstance());
|
||||||
|
|
||||||
|
// some broken Workbooks miss this...
|
||||||
|
if(!workbook.isSetBookViews()) {
|
||||||
|
CTBookViews bvs = workbook.addNewBookViews();
|
||||||
|
CTBookView bv = bvs.addNewWorkbookView();
|
||||||
|
bv.setActiveTab(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user