mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
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
17e62a85fa
commit
9c41ad8b67
@ -238,6 +238,13 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Iterable<X
|
||||
|
||||
// Build a tree of POIXMLDocumentParts, this workbook being the root
|
||||
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
|
||||
load(XSSFFactory.getInstance());
|
||||
|
||||
// some broken Workbooks miss this...
|
||||
if(!workbook.isSetBookViews()) {
|
||||
CTBookViews bvs = workbook.addNewBookViews();
|
||||
CTBookView bv = bvs.addNewWorkbookView();
|
||||
bv.setActiveTab(0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user