https://bz.apache.org/bugzilla/show_bug.cgi?id=65712
Bug ID: 65712
Summary: Missing Diagram relations when merging presentations
Product: POI
Version: 5.0.x-dev
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: XSLF
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
I'm trying to merge two presentations (using example from the XSLF Cookbook)
with the SmartArts inside and getting corrupted presentation as result
(PowerPoint says: "PowerPoint found a problem with content in merged.pptx")
After troubleshooting I've found that diagram relations is missing in the
slideslide2.xml.rels file.
Problem is caused by XSLFSheet::importPart() method which checks existence of
package part and skip creation of new relation for diagrams.
Code:
XMLSlideShow ppt = new XMLSlideShow();
String[] pptx = {"diagram.pptx", "diagram1.pptx"};
for(String arg : pptx){
XMLSlideShow src = XSLFTestDataSamples.openSampleDocument(arg);
for(XSLFSlide srcSlide : src.getSlides()){
ppt.createSlide().importContent(srcSlide);
}
}
FileOutputStream out = new FileOutputStream("merged.pptx");
ppt.write(out);
ppt.close();
Call stack:
importPart:679, XSLFSheet (org.apache.poi.xslf.usermodel)
copyDiagram:257, XSLFGraphicFrame (org.apache.poi.xslf.usermodel)
copy:213, XSLFGraphicFrame (org.apache.poi.xslf.usermodel)
wipeAndReinitialize:455, XSLFSheet (org.apache.poi.xslf.usermodel)
importContent:434, XSLFSheet (org.apache.poi.xslf.usermodel)
importContent:293, XSLFSlide (org.apache.poi.xslf.usermodel)
testMergeSlidesWithDiagram:206, TestXSLFSlide (org.apache.poi.xslf.usermodel)
I would like if someone looks at this issue and try to fix or provide details
on how this bug should be fixed.
Thank you.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]