Tried to evaluate all formulas in worksheets as part of the integration tests, but some documents fail and it probably increases runtime of tests considerably, so left commented out for now.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1738034 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2016-04-06 19:50:14 +00:00
parent b9e7c32ffe
commit 8b10d4d71b

View File

@ -44,7 +44,7 @@ public abstract class SpreadsheetHandler extends AbstractFileHandler {
// write once more
ByteArrayOutputStream out = writeToArray(wb);
// read in the writen file
// read in the written file
Workbook read;
try {
read = WorkbookFactory.create(new ByteArrayInputStream(out.toByteArray()));
@ -93,6 +93,21 @@ public abstract class SpreadsheetHandler extends AbstractFileHandler {
}
private void modifyContent(Workbook wb) {
/* a number of file fail because of various things: udf, unimplemented functions, ...
we would need quite a list of excludes and the large regression tests would probably
take a lot longer to run...
try {
// try to re-compute all formulas to find cases where parsing fails
wb.getCreationHelper().createFormulaEvaluator().evaluateAll();
} catch (RuntimeException e) {
// only allow a specific exception which indicates that an external
// reference was not found
if(!e.getMessage().contains("Could not resolve external workbook name")) {
throw e;
}
}*/
for (int i=wb.getNumberOfSheets()-1; i>=0; i--) {
try {
wb.cloneSheet(i);