* @param font The Font that is used in the Cell
* @return true if computing the size for this Font will succeed, false otherwise
*/
- public static boolean canComputeColumnWidht(Font font) {
+ public static boolean canComputeColumnWidth(Font font) {
// not sure what is the best value sample-here, only "1" did not work on some platforms...
AttributedString str = new AttributedString("1w");
copyAttributes(font, str, 0, "1w".length());
Workbook wb = new XSSFWorkbook();
// cannot check on result because on some machines we get back false here!
- SheetUtil.canComputeColumnWidht(wb.getFontAt((short)0));
+ SheetUtil.canComputeColumnWidth(wb.getFontAt((short)0));
wb.close();
}
font.setFontName("some non existing font name");
// Even with invalid fonts we still get back useful data most of the time...
- SheetUtil.canComputeColumnWidht(font);
+ SheetUtil.canComputeColumnWidth(font);
}
}
// autoSize will fail if required fonts are not installed, skip this test then
Font font = wb.getFontAt(cell0.getCellStyle().getFontIndex());
Assume.assumeTrue("Cannot verify autoSizeColumn() because the necessary Fonts are not installed on this machine: " + font,
- SheetUtil.canComputeColumnWidht(font));
+ SheetUtil.canComputeColumnWidth(font));
assertEquals("Expecting no indentation in this test",
0, cell0.getCellStyle().getIndention());
double widthBeforeCol = SheetUtil.getColumnWidth(sheet, 0, false);
String info = widthManual + "/" + widthBeforeCell + "/" + widthBeforeCol + "/" +
- SheetUtil.canComputeColumnWidht(font) + "/" + computeCellWidthFixed(font, "1") + "/" + computeCellWidthFixed(font, "w") + "/" +
+ SheetUtil.canComputeColumnWidth(font) + "/" + computeCellWidthFixed(font, "1") + "/" + computeCellWidthFixed(font, "w") + "/" +
computeCellWidthFixed(font, "1w") + "/" + computeCellWidthFixed(font, "0000") + "/" + computeCellWidthFixed(font, longValue);
assertTrue("Expected to have cell width > 0 when computing manually, but had " + info, widthManual > 0);
assertTrue("Expected to have cell width > 0 BEFORE auto-size, but had " + info, widthBeforeCell > 0);