Author: fanningpj
Date: Sun May 11 16:02:06 2025
New Revision: 1925505

URL: http://svn.apache.org/viewvc?rev=1925505&view=rev
Log:
extend test

Modified:
    
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFRichTextString.java
    
poi/trunk/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFTextParagraph.java

Modified: 
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFRichTextString.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFRichTextString.java?rev=1925505&r1=1925504&r2=1925505&view=diff
==============================================================================
--- 
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFRichTextString.java
 (original)
+++ 
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFRichTextString.java
 Sun May 11 16:02:06 2025
@@ -390,7 +390,7 @@ public class XSSFRichTextString implemen
      * Return a copy of the font in use at a particular index.
      *
      * @param index         The index.
-     * @return              A copy of the  font that's currently being applied 
at that
+     * @return              A copy of the font that's currently being applied 
at that
      *                      index or null if no font is being applied or the
      *                      index is out of range.
      */

Modified: 
poi/trunk/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFTextParagraph.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFTextParagraph.java?rev=1925505&r1=1925504&r2=1925505&view=diff
==============================================================================
--- 
poi/trunk/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFTextParagraph.java
 (original)
+++ 
poi/trunk/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFTextParagraph.java
 Sun May 11 16:02:06 2025
@@ -90,7 +90,7 @@ class TestXSSFTextParagraph {
             text.setBulletFontColor(color);
             assertEquals(color, text.getBulletFontColor());
 
-            final byte[] colorBytes = new byte[] { (byte) 255, 127, 0 };
+            final byte[] colorBytes = new byte[]{(byte) 255, 127, 0};
             text.setBulletFontColor(colorBytes);
             assertArrayEquals(colorBytes, text.getBulletFontColorAsBytes());
 
@@ -196,4 +196,32 @@ class TestXSSFTextParagraph {
             new XSSFTextParagraph(text.getXmlObject(), shape.getCTShape());
         }
     }
+
+    @Test
+    void testXSSFTextParagraph2() throws IOException {
+        try (XSSFWorkbook wb = new XSSFWorkbook()) {
+            XSSFSheet sheet = wb.createSheet();
+            XSSFDrawing drawing = sheet.createDrawingPatriarch();
+
+            XSSFTextBox shape = drawing.createTextbox(new XSSFClientAnchor(0, 
0, 0, 0, 2, 2, 3, 4));
+            XSSFTextRun run = 
shape.getTextParagraphs().get(0).getTextRuns().get(0);
+            final byte[] colorBytes = new byte[]{0, (byte) 255, (byte) 255};
+            run.setFont("Arial");
+            run.setFontColor(colorBytes);
+            run.setText("Test String");
+
+            List<XSSFTextParagraph> paras = shape.getTextParagraphs();
+            assertEquals(1, paras.size());
+
+            XSSFTextParagraph text = paras.get(0);
+            assertEquals("Test String", text.getText());
+
+            List<XSSFTextRun> runs = text.getTextRuns();
+            assertEquals(1, runs.size());
+            XSSFTextRun run2 = runs.get(0);
+            assertEquals(run.getText(), run2.getText());
+            assertEquals(run.getFontFamily(), run2.getFontFamily());
+            assertArrayEquals(run.getFontColorAsBytes(), 
run2.getFontColorAsBytes());
+        }
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to