You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Mathieu Grosmaire <ma...@gmail.com> on 2008/06/04 17:56:45 UTC

HSLF need help for bullet in RichTextRun

Hello

Is it possible to mix bulleted text with no-bulleted text in one TextRun?

Such as :

- my sample paragraph
  with bullet

my sample paragraph
without bullet

I have tried something but it does not work.

Sample code :
	SlideShow ppt = new SlideShow();
			
	Slide s = ppt.createSlide();
			
	TextBox tb = new TextBox();
			
	tb.setAnchor(new Rectangle(10,10,500,300));
			
	tb.setText("my sample paragraph with bullet");
			
	RichTextRun rtr = tb.getTextRun().getRichTextRuns()[0];
	rtr.setFontName("Times New Roman");
	rtr.setFontSize(12);
	rtr.setBullet(true);
		
	rtr = tb.getTextRun().appendText("\n");
	rtr.setFontName("Times New Roman");
	rtr.setFontSize(12);
			
	rtr = tb.getTextRun().appendText("\n");
	rtr.setFontName("Times New Roman");
	rtr.setFontSize(12);
			
	rtr = tb.getTextRun().appendText("my sample paragraph without bullet");
	rtr.setFontName("Times New Roman");
	rtr.setFontSize(12);
	rtr.setBullet(false);
			
	s.addShape(tb);
			
			
	FileOutputStream out = new FileOutputStream("report/slideshow.ppt");
	ppt.write(out);
	out.close();

Thanks and regards
MG
-- 
View this message in context: http://www.nabble.com/HSLF-need-help-for-bullet-in-RichTextRun-tp17650104p17650104.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: HSLF need help for bullet in RichTextRun

Posted by Yegor Kozlov <ye...@dinom.ru>.
> Hello

> Is it possible to mix bulleted text with no-bulleted text in one TextRun?

In theory your code should work. Unfortunately this part of HSLF is
buggy and not well tested.

I will see if I can fix that in 3.1-final.

Regards,
Yegor
> Such as :

> - my sample paragraph
>   with bullet

> my sample paragraph
> without bullet

> I have tried something but it does not work.

> Sample code :
>         SlideShow ppt = new SlideShow();
>                         
>         Slide s = ppt.createSlide();
>                         
>         TextBox tb = new TextBox();
>                         
>         tb.setAnchor(new Rectangle(10,10,500,300));
>                         
>         tb.setText("my sample paragraph with bullet");
>                         
>         RichTextRun rtr = tb.getTextRun().getRichTextRuns()[0];
>         rtr.setFontName("Times New Roman");
>         rtr.setFontSize(12);
>         rtr.setBullet(true);
>                 
>         rtr = tb.getTextRun().appendText("\n");
>         rtr.setFontName("Times New Roman");
>         rtr.setFontSize(12);
>                         
>         rtr = tb.getTextRun().appendText("\n");
>         rtr.setFontName("Times New Roman");
>         rtr.setFontSize(12);
>                         
>         rtr = tb.getTextRun().appendText("my sample paragraph without bullet");
>         rtr.setFontName("Times New Roman");
>         rtr.setFontSize(12);
>         rtr.setBullet(false);
>                         
>         s.addShape(tb);
>                         
>                         
>         FileOutputStream out = new
> FileOutputStream("report/slideshow.ppt");
>         ppt.write(out);
>         out.close();

> Thanks and regards
> MG


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org