Summary: | [PATCH] XSLFBackground setFill() can corrupt the document | ||
---|---|---|---|
Product: | POI | Reporter: | Mate Borcsok <bmateusz> |
Component: | XSLF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 4.0.0-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: |
patch setFill function of XSLFBackground
testcase src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFBackground.java |
Comment on attachment 36152 [details]
patch setFill function of XSLFBackground
Looks sensible enough to me. Could you add a test case though?
Created attachment 36154 [details]
testcase src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFBackground.java
I added a new test suite with 4 test cases which covers the common use-cases, using some existing test pptx files from the repo.
changes applied using https://svn.apache.org/viewvc?view=revision&revision=1841240 |
Created attachment 36152 [details] patch setFill function of XSLFBackground The current setFill implementation only cares about noFill and solidFill attributes. If the presentation already contains e.g. a gradFill and you call setFill(null), it results in a background containing both a noFill and a gradFill, which is an invalid document and cannot be opened by PPT. See my patch which would fix that bug.