From: Dominik Stadler Date: Sat, 12 Mar 2016 11:36:43 +0000 (+0000) Subject: Add test for bug 59098 which shows that this is fixed in 3.14. X-Git-Tag: REL_3_15_BETA2~464 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=86fc57b5490a132e70831ab88ce53a0162ec498c;p=poi.git Add test for bug 59098 which shows that this is fixed in 3.14. git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1734686 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRichTextString.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRichTextString.java index ea11d273da..7d45351fbd 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRichTextString.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRichTextString.java @@ -28,6 +28,7 @@ import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.xssf.XSSFTestDataSamples; import org.apache.poi.xssf.model.StylesTable; import org.junit.Test; +import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRPrElt; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRst; import org.openxmlformats.schemas.spreadsheetml.x2006.main.STXstring; @@ -516,4 +517,20 @@ public final class TestXSSFRichTextString extends TestCase { rt = new XSSFRichTextString(); assertNull(rt.toString()); } + + public void test59008Font() { + XSSFFont font = new XSSFFont(CTFont.Factory.newInstance()); + + XSSFRichTextString rts = new XSSFRichTextString(); + rts.append("This is correct "); + int s1 = rts.length(); + rts.append("This is Bold Red", font); + int s2 = rts.length(); + rts.append(" This uses the default font rather than the cell style font"); + int s3 = rts.length(); + + assertEquals("", rts.getFontAtIndex(s1-1).toString()); + assertEquals(font, rts.getFontAtIndex(s2-1)); + assertEquals("", rts.getFontAtIndex(s3-1).toString()); + } }