poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1734686 - /poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRichTextString.java
Date Sat, 12 Mar 2016 11:36:43 GMT
Author: centic
Date: Sat Mar 12 11:36:43 2016
New Revision: 1734686

URL: http://svn.apache.org/viewvc?rev=1734686&view=rev
Log:
Add test for bug 59098 which shows that this is fixed in 3.14.

Modified:
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRichTextString.java

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRichTextString.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRichTextString.java?rev=1734686&r1=1734685&r2=1734686&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRichTextString.java
(original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRichTextString.java
Sat Mar 12 11:36:43 2016
@@ -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 TestXSSFRichTextStrin
         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("<xml-fragment/>", rts.getFontAtIndex(s1-1).toString());
+        assertEquals(font, rts.getFontAtIndex(s2-1));
+        assertEquals("<xml-fragment/>", rts.getFontAtIndex(s3-1).toString());
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message