Create an arror cell if a formula parsing exception is caught
This commit is contained in:
parent
5dd1ac4029
commit
0a8d031bd9
1 changed files with 8 additions and 2 deletions
|
@ -326,8 +326,14 @@ public class Workbook implements org.openoffice.xmerge.Document {
|
|||
|
||||
// Now the formatting is out of the way add the cell
|
||||
if(cellContents.startsWith("=")) {
|
||||
Formula f = new Formula(row, col, cellContents, ixfe, fmt.getValue());
|
||||
currentWS.addCell(f);
|
||||
try {
|
||||
Formula f = new Formula(row, col, cellContents, ixfe, fmt.getValue());
|
||||
currentWS.addCell(f);
|
||||
} catch(Exception e) {
|
||||
Debug.log(Debug.TRACE, "Parsing Exception thrown : " + e.getMessage());
|
||||
BoolErrCell errorCell = new BoolErrCell(row, col, ixfe, 0x2A, 1);
|
||||
currentWS.addCell(errorCell);
|
||||
}
|
||||
} else if(category.equalsIgnoreCase(OfficeConstants.CELLTYPE_FLOAT)) {
|
||||
FloatNumber num = new FloatNumber(row, col, cellContents, ixfe);
|
||||
currentWS.addCell(num);
|
||||
|
|
Loading…
Reference in a new issue