views:

19

answers:

0

Hello,

I'm creating a PowerPoint slide using POI and I need to be able to copy and paste it to another presentation. I'm running into a problem where the title of the generated slide adopts a bulleted list style when copying it. Any ideas on how can I fix this? I tried both the production version (3.6-20091214) and the beta version (3.7-beta1-20100620).

To reproduce you can just run the following code:

import java.io.FileOutputStream;

import org.apache.poi.hslf.model.Slide;
import org.apache.poi.hslf.model.TextBox;
import org.apache.poi.hslf.usermodel.SlideShow;

public class TestPPT {

   /**
    * @param args
    */
   public static void main(String[] args) {
           try{
                   SlideShow slideShow = new SlideShow();
                   Slide slide = slideShow.createSlide();
                   TextBox title = slide.addTitle();
                   title.setText("Test Title");
                   FileOutputStream out =
                       new FileOutputStream("C:/slideshow.ppt");
                   slideShow.write(out);
                   out.close();
           }catch(Exception e){}}
}

open the slideshow.ppt, select the slide, copy and paste it right there and you should see a new slide with a bullet list with one entry reading "Test Title". See below.

alt text