Clone - chart became invisible?

Hello,

This seems related to - Clone - table shifted to top left corner?
We’re doing the same as explained in that thread but this time with different documents.

Edit: We’re using Aspose.Slides for Java 15.5.1 version.

We’re trying to clone the masters from one presentation
“SamplePpt” to another ppt “ChartTest.pptx”. If we’ve a master with same name
present in ChartTest.pptx, we’re cloning SamplePpt’s master and adding
additional doclet layouts to it and add it finally to ChartTest.pptx, and
delete the older one from DocletPpt. We also change all slides base
layouts.


Issue: There is a chart in slide 2 of “ChartTest.pptx”. After running the code we get output document in which slide 2’s chart become invisible. Please check attached output ppt - “ChartTest.pptx_After_Application.pptx”.

NOTE: If we reset the slide 2, we see the chart being visible again.

Please have a look. Thanks.


Here is the code:

Code:
public void bug() {
String dirUrl = “Bug - RENDERING ISSUE FOR CHART ON PPT RP\”;
String docxName = “SamplePpt.pptx”;
String doclet = “ChartTest.pptx”;
Presentation sample = new Presentation(dirUrl + docxName);
Presentation dclt = new Presentation(dirUrl + doclet);

formattingApplication(dclt, sample);

dclt.save(dirUrl + doclet + “_After_Application.pptx”, SaveFormat.Pptx);
}

static IMasterSlide getMasterByName(final IMasterSlideCollection presentationMasters, final String masterLookUp) {


final IMasterSlideCollection pptMasters = presentationMasters;

IMasterSlide desired = null;
for (IMasterSlide master : pptMasters) {
if (masterLookUp.equals(getMasterName(master))) {
desired = master;
break;
}
}
return desired;
}

static ILayoutSlide getLayoutByName(final IMasterSlide master, final String layoutName) {
ILayoutSlide layout = null;
for (final ILayoutSlide layoutAttached : master.getLayoutSlides()) {
if (layoutAttached.getName().equals(layoutName)) {
layout = layoutAttached;
break;
}
}
return layout;
}

void formattingApplication(Presentation loadedPresentation, Presentation sampleTemplate) {
final IMasterSlideCollection loadedMasters = loadedPresentation.getMasters();

// Hard coding the Office Theme, as both SamplePpt and DocletPpt has Office Theme master. Just one master
IMasterSlide actualMaster = getMasterByName(loadedMasters, “Office Theme”);
IMasterSlide sampleMaster = getMasterByName(sampleTemplate.getMasters(), “Office Theme”);

IMasterSlide finalMaster = loadedMasters.addClone(sampleMaster);

for (final ILayoutSlide actualMasterLayout : actualMaster.getLayoutSlides()) {
if (getLayoutByName(finalMaster, actualMasterLayout.getName()) == null) {
finalMaster.getLayoutSlides().addClone(actualMasterLayout);
}
}

for (final ILayoutSlide actualMasterLayout : actualMaster.getLayoutSlides()) {
if (actualMasterLayout.hasDependingSlides()) {
final ILayoutSlide finalMasterLayout = getLayoutByName(finalMaster, actualMasterLayout.getName());
if (finalMasterLayout == null) {
throw new IllegalStateException(“The layout should be present in final master!”);
}

final ISlide[] basedSlides = actualMasterLayout.getDependingSlides();

if (basedSlides == null || basedSlides.length == 0) {
throw new IllegalStateException(“Aspose told there are some depending slides!”);
}

for (final ISlide slide : basedSlides) {
slide.setLayoutSlide(finalMasterLayout);
}

if (actualMasterLayout.hasDependingSlides()) {
throw new IllegalStateException(“Dependencies should be resolved!”);
}
}
}


// final master is all set for ruling new world and
// old actual master is relieved!
loadedMasters.remove(actualMaster);
}

static String getMasterName(final IMasterSlide master) {
return master.getThemeManager().getOverrideTheme().getName();
}

Thanks,
Prakhar

Hi Prakhar,

I have worked with the presentation file shared by you and have been able to observe the issue specified. An issue with ID SLIDESJAVA-34937 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

We are sorry for your inconvenience,

One more issue:

Extra theme2.xml in ppt\theme\ folder when you unzip the output document ChartTest.pptx_After_Application.pptx.

If you notice formattingApplication() method

we remove the master at last -
// final master is all set for ruling new world and
// old actual master is relieved!
loadedMasters.remove(actualMaster);

It seems that removing a master is not removing the corresponding themes.xml.

Actually there is a one to one mapping between slide master and themes.xml. So, if we remove master the corresponding themes.xml should get deleted.

In this case it’s not happening. ChartTest.pptx has one master Office Theme which we delete after cloning Office Theme master from SamplePpt.pptx. Now we see that after removal the output ppt doesn’t has the old ppt master but the removal leaves themes.xml.


Please have a look. We expect that removal of slide master should remove themes.xml as well corresponding to that particular slide master.

Thanks,
Prakhar

PS: Note that code and input documents are same, please check the extra themes.xml in output document generated from same code.




Hi Prakhar,

I have observed the issue details shared by you concerning to xml file. An issue with ID SLIDESJAVA-34945 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

We are sorry for your inconvenience,

The issues you have found earlier (filed as SLIDESJAVA-34937) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as SLIDESJAVA-34945) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.