You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ce...@apache.org on 2017/10/09 19:35:32 UTC
svn commit: r1811595 - in /poi/trunk:
src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
test-data/spreadsheet/51262.xls
Author: centic
Date: Mon Oct 9 19:35:32 2017
New Revision: 1811595
URL: http://svn.apache.org/viewvc?rev=1811595&view=rev
Log:
Add test which shows that bug 51262 is fixed now
Added:
poi/trunk/test-data/spreadsheet/51262.xls
Modified:
poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java?rev=1811595&r1=1811594&r2=1811595&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java Mon Oct 9 19:35:32 2017
@@ -3137,4 +3137,32 @@ public final class TestBugs extends Base
// 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());
+ }
+ }
}
Added: poi/trunk/test-data/spreadsheet/51262.xls
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/spreadsheet/51262.xls?rev=1811595&view=auto
==============================================================================
Binary files poi/trunk/test-data/spreadsheet/51262.xls (added) and poi/trunk/test-data/spreadsheet/51262.xls Mon Oct 9 19:35:32 2017 differ
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org