field_1_row_number = rowNumber;
field_2_first_col = -1;
field_3_last_col = -1;
- field_4_height = (short)DEFAULT_HEIGHT_BIT;
- field_4_height = (short)DEFAULT_HEIGHT_BIT;
+ field_4_height = (short)0xFF;
field_5_optimize = ( short ) 0;
field_6_reserved = ( short ) 0;
field_7_option_flags = OPTION_BITS_ALWAYS_SET; // seems necessary for outlining
assertEquals(null, row.getCell(4));
assertEquals(HSSFCell.CELL_TYPE_NUMERIC, row.getCell(5).getCellType());
}
+
+ public void testRowHeight() {
+ HSSFWorkbook workbook = new HSSFWorkbook();
+ HSSFSheet sheet = workbook.createSheet();
+ HSSFRow row1 = sheet.createRow( (short) 0);
+
+ assertEquals(0xFF, row1.getHeight());
+ assertEquals(sheet.getDefaultRowHeight(), row1.getHeight());
+
+ HSSFRow row2 = sheet.createRow( (short) 1);
+ row2.setHeight((short)400);
+
+ assertEquals(400, row2.getHeight());
+
+ workbook = HSSFTestDataSamples.writeOutAndReadBack(workbook);
+ sheet = workbook.getSheetAt(0);
+
+ row1 = sheet.getRow(0);
+ assertEquals(0xFF, row1.getHeight());
+ assertEquals(sheet.getDefaultRowHeight(), row1.getHeight());
+
+ row2 = sheet.getRow(1);
+ assertEquals(400, row2.getHeight());
+ }
+
}
}
assertEquals("Hi Excel!", row.getCell(0).getRichStringCellValue().getString());
// check row height for 'default' flag
- assertEquals((short)0x8000, row.getHeight());
-
+ assertEquals((short)0xFF, row.getHeight());
+
HSSFTestDataSamples.writeOutAndReadBack(wb);
}
}