Hello

This problem occurs only on one condition, '\n' needs to be the last
character in the first RichTextRun.

Error sample code :

        SlideShow ppt = new SlideShow();
                        
        Slide s = ppt.createSlide();
        TextBox tb = new TextBox();
        TextRun tr = tb.createTextRun();
                        
        tb.setAnchor(new Rectangle(10,10,500,20));
        
        tr.getRichTextRuns()[0].setText("hello\n");
        tr.getRichTextRuns()[0].setFontName("Calibri");
        tr.getRichTextRuns()[0].setFontSize(12);
        
        RichTextRun rtr = tr.appendText("world");
        rtr.setFontName("Times New Roman");
        rtr.setFontSize(12);
                
        s.addShape(tb);
        
        FileOutputStream out = new FileOutputStream("report/slideshow.ppt");
        ppt.write(out);
        out.close();

Running sample code :

        SlideShow ppt = new SlideShow();
                        
        Slide s = ppt.createSlide();
        TextBox tb = new TextBox();
        TextRun tr = tb.createTextRun();
                        
        tb.setAnchor(new Rectangle(10,10,500,20));
        
        tr.getRichTextRuns()[0].setText("hello\n ");
        tr.getRichTextRuns()[0].setFontName("Calibri");
        tr.getRichTextRuns()[0].setFontSize(12);
        
        RichTextRun rtr = tr.appendText("world");
        rtr.setFontName("Times New Roman");
        rtr.setFontSize(12);
                
        s.addShape(tb);
        
        FileOutputStream out = new FileOutputStream("report/slideshow.ppt");
        ppt.write(out);
        out.close();


Regards
MG
-- 
View this message in context: 
http://www.nabble.com/HSLF-style-crashes-due-to-%27%5Cn%27-in-the-first-RichTextRun-tp17627089p17627089.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to