Bug 51302 - bullets fromat lost
Summary: bullets fromat lost
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSLF (show other bugs)
Version: 3.7-FINAL
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on: 45124
Blocks:
  Show dependency tree
 
Reported: 2011-05-31 18:35 UTC by River
Modified: 2015-11-01 23:24 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description River 2011-05-31 18:35:20 UTC
when create a slide to display some content and bullets, the bullets  lost format.

public class BulletsDemo {
	
    public static void main(String[] args) throws Exception {
    	BulletsDemo bd = new BulletsDemo();
        SlideShow ppt = new SlideShow();

        Slide slide = ppt.createSlide();

        TextBox shape = new TextBox();
        bd.normalSlide(shape);
        bd.bulletSlide(shape);
        slide.addShape(shape);
       
        FileOutputStream out = new FileOutputStream("c:/bullets.ppt");
        ppt.write(out);
        out.close();
   }
  
  
    public  void bulletSlide(TextBox shape) {
    	String content = "January\rFebruary\rMarch\rApril"; 
    	TextRun tr = shape.createTextRun();
       	RichTextRun rt = tr.appendText(content);
        rt.setBulletOffset(30);
        rt.setTextOffset(50); 
        rt.setBulletChar('\u25CF');
        rt.setFontSize(18);
    }
    
    public  void normalSlide(TextBox shape) {
    	String content = "Apache POI 3.7 Demo\r"; 
    	RichTextRun rt =   shape.getTextRun().getRichTextRuns()[0];
    	rt.setText(content);
		rt.setFontSize(25);
	}
   
}
Comment 1 Andreas Beeker 2015-11-01 23:24:02 UTC
This works now as expected and partly fixed as part of #45124

For reference - this is my testcode:

public void bug51302() throws IOException {
    HSLFSlideShow ppt = new HSLFSlideShow();

    HSLFSlide slide = ppt.createSlide();

    HSLFTextBox shape = slide.createTextBox();
    HSLFTextRun tr0 = shape.appendText("Apache POI 3.7 Demo", true);
    tr0.setFontSize(25d);
    HSLFTextRun tr1 = 
shape.appendText("January\u000bFebruary\u000bMarch\u000bApril", true);
    tr1.setFontSize(18d);
    HSLFTextParagraph tp = tr1.getTextParagraph();
    tp.setBulletStyle('\u25CF', Color.black);
    tp.setLeftMargin(30d);

    shape.setAnchor(new Rectangle(100, 100, 400, 500));
    
    FileOutputStream out = new FileOutputStream("bullets.ppt");
    ppt.write(out);
    out.close();
    
    ppt.close();
}