I think I may have solved my own issue by simply creating the new slide 
show a different way:

XMLSlideShow newppt = coreppt;
XSLFSlide[] newSlides = newppt.getSlides();
for(int slideIndex=newSlides.length-1;slideIndex>=0;slideIndex--) {
        if(deckIndexes.contains(Integer.toString(slideIndex))) { 
//deckIndexes is a list of slide indexes that must be in the new show - 
basically a filter
                //do nothing - keep the slide
        } else {
                newppt.removeSlide(slideIndex);
        }
}

This seems to be working OK.  If anyone sees anything I am missing, please 
let me know.

-Lou


[email protected] wrote on 2012-06-07 07:09:41 PM:

> [email protected] 
> 2012-06-07 07:10 PM
> 
> Please respond to
> "POI Users List" <[email protected]>
> 
> To
> 
> [email protected], 
> 
> cc
> 
> Subject
> 
> merging pptx drops template
> 
> I just noticed that when I merged pptx files (creating a new pptx), the 
> slide templates are gone.  The code I am using is basically:
> 
> XMLSlideShow newppt = new XMLSlideShow();
> for(String ndx : deckIndexes) {
>         int iNdx = Integer.parseInt(ndx);
>         XSLFSlide slide = coreSlides[iNdx];
>         if(slide!=null) {
>                 newppt.createSlide().importContent(slide);  //THIS IS 
THE 
> CODE!!!
>         }
> }
> 
> I'm guessing I'm going to have to dip deeper into the slides, but I want 

> to be 100% sure before I go down that road.
> 
> Thanks,
> Lou

Reply via email to