Add test which shows that bug 51262 is fixed now

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1811595 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2017-10-09 19:35:32 +00:00
parent 2587ed1849
commit 88b3286345
2 changed files with 28 additions and 0 deletions

View File

@ -3137,4 +3137,32 @@ public final class TestBugs extends BaseTestBugzillaIssues {
// this will throw an Exception "RuntimeException: Can't read negative number of bytes"
new PropertySet(new DocumentInputStream(entry));
}
@Test
public void test51262() throws IOException {
try (HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("51262.xls")) {
Sheet sheet = wb.getSheetAt(0);
Row row = sheet.getRow(2);
Cell cell = row.getCell(1);
CellStyle style = cell.getCellStyle();
assertEquals(26, style.getFontIndex());
row = sheet.getRow(3);
cell = row.getCell(1);
style = cell.getCellStyle();
assertEquals(28, style.getFontIndex());
// check the two fonts
HSSFFont font = wb.getFontAt((short) 26);
assertTrue(font.getBold());
assertEquals(10, font.getFontHeightInPoints());
assertEquals("\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF", font.getFontName());
font = wb.getFontAt((short) 28);
assertTrue(font.getBold());
assertEquals(10, font.getFontHeightInPoints());
assertEquals("\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF", font.getFontName());
}
}
}

Binary file not shown.