Hi,
We are in process of upgarding Aspose.Slides Java version from 15.3.0 to 15,6.0. One of our test case was working fine with older vesrion and now in version Aspose.Slides 15.6.0, this testcase is encountering ClassCastException. The stack trace is given below:
java.lang.ClassCastException: com.aspose.slides.any cannot be cast to com.aspose.slides.PatternFormatEffectiveData
oracle.epm.platform.core.reportpackage.docman.ppt.AsposeOpenXmlPptManagerTest.testMerge(AsposeOpenXmlPptManagerTest.java:1116)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
java.lang.reflect.Method.invoke(Method.java:606)
In that testcase, we are trying to merge two PowerPoint presentations using code given below:
public void testMerge() {
Presentation sample = new Presentation(“Office2013Blank.pptx”);
Presentation control = new Presentation(“LayoutObjects.pptx”);
for (IMasterSlide master : control.getMasters()) {
sample.getMasters().addClone(master);
}
for (ISlide slide : control.getSlides()) {
ILayoutSlide controlLayout = slide.getLayoutSlide();
IMasterSlide controlMaster = controlLayout.getMasterSlide();
IMasterSlide sampleMaster = .getMasterByName(sample.getMasters(), getMasterName(controlMaster));
ILayoutSlide layoutToUse = null;
for (ILayoutSlide layout : sampleMaster.getLayoutSlides()) {
if (StringUtils.equalsIgnoreCase(controlLayout.getName(),
layout.getName())) {
layoutToUse = layout;
break;
}
}
sample.getSlides().addClone(slide, layoutToUse);
}
sample.save(“TestMerge.pptx”, SaveFormat.Pptx);
}
private ImasterSlide getMasterByName(final IMasterSlideCollection presentationMasters, final String masterLookUp) {
final IMasterSlideCollection pptMasters = presentationMasters;
IMasterSlide desired = null;
for (IMasterSlide master : pptMasters) {
if (StringUtils.equalsIgnoreCase(masterLookUp, getMasterName(master))) {
desired = master;
break;
}
}
return desired;
}
private String getMasterName(final IMasterSlide master) {
return master.getThemeManager().getOverrideTheme().getName();
}
The PowerPoint presentation attached with this post for your reference.
Please have a look into this as soon as possible. We eagerly want to migrate to Aspose slides 15.6.0 version. This issue may become a blocker for this version migration.
Thanks
Manisha