]> source.dussan.org Git - poi.git/commitdiff
[bug-68703] fix issue with XSLFTextRuns in XSLFTableCells
authorPJ Fanning <fanningpj@apache.org>
Mon, 4 Mar 2024 14:56:20 +0000 (14:56 +0000)
committerPJ Fanning <fanningpj@apache.org>
Mon, 4 Mar 2024 14:56:20 +0000 (14:56 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1916108 13f79535-47bb-0310-9956-ffa450edef68

poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFTableCell.java
poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFTableCell.java

index d22ab8df1975dc1946d981ca2868b85fb87b7c31..a77617a381dc7c0030c597134e120c2af46f0c2a 100644 (file)
@@ -752,8 +752,12 @@ public class XSLFTableCell extends XSLFTextShape implements TableCell<XSLFShape,
                     }
 
                     XSLFTheme theme = getSheet().getTheme();
-                    final XSLFColor c = new XSLFColor(txStyle, theme, phClr, getSheet());
-                    return DrawPaint.createSolidPaint(c.getColorStyle());
+                    try {
+                        final XSLFColor c = new XSLFColor(txStyle, theme, phClr, getSheet());
+                        return DrawPaint.createSolidPaint(c.getColorStyle());
+                    } catch (IllegalArgumentException e) {
+                        return super.getFontColor();
+                    }
                 }
             }
         }
index 86db08d097ac774a1959c35c1bba28f62527d0a1..87bb0ce6a272c34cd74ac99b1e3a4661f8e833e5 100644 (file)
@@ -27,7 +27,6 @@ import java.util.List;
 
 import org.apache.poi.sl.usermodel.PaintStyle;
 import org.apache.poi.xslf.XSLFTestDataSamples;
-import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 
 class TestXSLFTableCell
@@ -229,7 +228,6 @@ class TestXSLFTableCell
         ppt.close();
     }
 
-    @Disabled
     @Test
     void testBug68703() throws IOException {
         try(XMLSlideShow pptx = XSLFTestDataSamples.openSampleDocument("bug68703.pptx")) {