Bug 66568 - Incorrect font color chosen from master slide when font color is unspecified.
Summary: Incorrect font color chosen from master slide when font color is unspecified.
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: XSLF (show other bugs)
Version: 5.2.3-FINAL
Hardware: Macintosh All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2023-04-18 04:47 UTC by Evan
Modified: 2023-04-21 18:05 UTC (History)
0 users

example issue (361.21 KB, application/zip)
2023-04-21 17:58 UTC, Evan

Note You need to log in before you can comment on or make changes to this bug.
Description Evan 2023-04-18 04:47:33 UTC
Attached is a PPTX file with a master slide and a slide with a paragraph text run set with no font color, but appears as cyan.

The master slide contains a slide which has two text elements, one colored cyan and the other colored red.

However when read by POI as follows:
var solidPaint = (PaintStyle.SolidPaint) textRun.getFontColor();
var solidColor = solidPaint.getSolidColor();
var color = solidColor.getColor();

Expected behaviour:
`color` is cyan, as that it what is rendered by PPTX.

Observed behaviour:
`color` is red.

Steps to reproduce:

1. Download the attached zip file containing a Maven project, unzip the folder and `cd` into its directory.
2. Run `mvn install` and then `mvn exec:java`.
3. Observe the following:
Actual Color: java.awt.Color[r=255,g=0,b=0]
Expected Color: java.awt.Color[r=0,g=255,b=255]

Proposed solution:
POI searches for the correct element to obtain the color from when the color is missing.

Thank you! Let us know if there is any additional information that would be of help.
Comment 1 PJ Fanning 2023-04-18 22:22:40 UTC
'Download the attached zip file' -- there is nothing attached
Comment 2 Evan 2023-04-21 17:58:07 UTC
Created attachment 38544 [details]
example issue

My bad! Not sure why it didn't attach originally.