Bug 52297

Summary: Bullets are not aligned properly while converting ppt slide to image
Product: POI Reporter: akilg <aki2885>
Component: HSLFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: major CC: daviesja
Priority: P2    
Version: 3.8-dev   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Bug Depends on:    
Bug Blocks: 52737    
Attachments: bullets overlap the text in slide image
orginal slide image
Here is a similar ppt file producing the same rendering artifacts

Description akilg 2011-12-07 06:16:03 UTC
Created attachment 28046 [details]
bullets overlap the text in slide image

I tried converting ppt to image in HSLF.
It worked fine ,except the formatting of bullets .

Bullets overlap's the text without any indent or spacing.

Attached the screenshots for the same.
Comment 1 akilg 2011-12-07 06:20:26 UTC
Created attachment 28047 [details]
orginal slide image
Comment 2 akilg 2011-12-07 06:21:11 UTC
I am Using the latest POI 3.8 beta 4 version
Comment 3 Yegor Kozlov 2012-02-27 09:00:48 UTC
 I'm testing with simple bullet lists created in PowerPoint 2010 and all bullet offsets are correct. Please attach the problematic ppt file.

Yegor
Comment 4 Jared 2012-11-14 21:43:34 UTC
Created attachment 29597 [details]
Here is a similar ppt file producing the same rendering artifacts

I added some lines to the 2nd page to show where the text should line up
Comment 5 Jared 2012-12-04 14:28:34 UTC
In looking at the failing PPT, this appears to be the failure in TextPainter.java:

elem[i]._bulletOffset > elem[i]._textOffset

Might change: 
if(elem[i]._bullet != null){
  graphics.drawString(elem[i]._bullet.getIterator(), (float)(pen.x + elem[i]._bulletOffset), (float)pen.y);
}

To:
if(elem[i]._bullet != null){
  graphics.drawString(elem[i]._bullet.getIterator(), (float)(pen.x + elem[i]._bulletOffset), (float)pen.y);
  if (elem[i]._bulletOffset >= elem[i]._textOffset) {
    elem[i]._textOffset+= elem[i]._bulletOffset;
  }
}

I will try this out locally.
Comment 6 Jared 2013-01-02 14:49:18 UTC
TextPainter.java, line ~143, added nested if inside of _bullet nullcheck.  This fixes the text/bullet offset issues in the presentation, still working out the vertical spacing fix.

if(elem[i]._bullet != null){
    graphics.drawString(elem[i]._bullet.getIterator(), (float)(pen.x + elem[i]._bulletOffset), (float)pen.y);
    if (elem[i]._textOffset < elem[i]._bulletOffset) 
        elem[i]._textOffset+= elem[i]._bulletOffset+5;
}
Comment 7 Andreas Beeker 2015-11-08 23:21:28 UTC
Partly fixed with r1713316
i.e. the mentioned bug is fixed, but there's still a rendering issue with the 2nd textbox (on the 2nd slide), where I can't find an information where the left margin or the bullet offset is set and therefore there's no hanging indent.
The POI code switches here to the master layout ... I guess the missing slide layout handling in HSLF is the key to this issue (and maybe to failing auto numbering issues too ...)