}
public void setType(byte type) {
this.type = type;
+
+ // Ensure the value presense / absense is consistent for the new type
+ if (type == RangeType.MIN.id || type == RangeType.MAX.id ||
+ type == RangeType.FORMULA.id) {
+ this.value = null;
+ } else if (value == null) {
+ this.value = 0d;
+ }
}
public void setType(int type) {
this.type = (byte)type;
}
public void setParsedExpression(Ptg[] ptgs) {
formula = Formula.create(ptgs);
+ if (ptgs.length > 0) {
+ this.value = null;
+ }
}
public Double getValue() {
assertEquals("Values", s.getRow(0).getCell(0).toString());\r
assertEquals("10.0", s.getRow(2).getCell(0).toString());\r
\r
- // Check we found all the conditional formattings rules we should have\r
+ // Check we found all the conditional formatting rules we should have\r
SheetConditionalFormatting sheetCF = s.getSheetConditionalFormatting();\r
int numCF = 3;\r
int numCF12 = 15;\r
- int numCFEX = 0; // TODO This should be 1, but we don't support CFEX formattings yet\r
+ int numCFEX = 0; // TODO This should be 2, but we don't support CFEX formattings yet\r
assertEquals(numCF+numCF12+numCFEX, sheetCF.getNumConditionalFormattings());\r
\r
int fCF = 0, fCF12 = 0, fCFEX = 0;\r
assertEquals(BorderFormatting.BORDER_HAIR, r1fp.getBorderRight());\r
}\r
\r
- // TODO Fix this test to work for HSSF\r
- public void DISABLEDtestCreateIconFormatting() {\r
+ public void testCreateIconFormatting() {\r
Workbook workbook = _testDataProvider.createWorkbook();\r
Sheet sheet = workbook.createSheet();\r
\r