https://bz.apache.org/bugzilla/show_bug.cgi?id=68703

            Bug ID: 68703
           Summary: IllegalArgumentException: Unexpected color choice
                    CTFontCollectionImpl when reading font color for a
                    table cell
           Product: POI
           Version: unspecified
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLF
          Assignee: dev@poi.apache.org
          Reporter: he...@canva.com
  Target Milestone: ---

Created attachment 39609
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=39609&action=edit
Zip file containing a Maven project that reproduces the issue

Affected Version: 5.2.5 (5.2.4 possibly affected as well)

Issue:
When parsing some PowerPoint files with tables in Apache POI version 5.2.5 (and
possibly 5.2.4), attempting to retrieve the font color for text runs within the
table cell triggers the following exception:

```
Exception in thread "main" java.lang.IllegalArgumentException: Unexpected color
choice: class
org.openxmlformats.schemas.drawingml.x2006.main.impl.CTFontCollectionImpl
        at org.apache.poi.xslf.usermodel.XSLFColor.toColor(XSLFColor.java:161)
        at org.apache.poi.xslf.usermodel.XSLFColor.<init>(XSLFColor.java:66)
        at
org.apache.poi.xslf.usermodel.XSLFTableCell$XSLFCellTextRun.getFontColor(XSLFTableCell.java:755)
        at com.example.Main.main(Main.java:21)
```

Steps to Reproduce:
1. Download the attached zip file containing a Maven project.
2. Unzip the folder and navigate to its directory using the command line.
3. Run `mvn install` followed by `mvn exec:java`.
4. Observe the `IllegalArgumentException` that is thrown during execution.

We suspect that the commit causing this issue is
https://github.com/apache/poi/commit/624f83431065e1a7613f1f044f1820c27e504266#diff-f80c56131e376f24468d40928f5717820b38f1ebea9d16147b870763f8b682c7R78

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to