Bug 52297 - Bullets are not aligned properly while converting ppt slide to image
Summary: Bullets are not aligned properly while converting ppt slide to image
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSLF (show other bugs)
Version: 3.8-dev
Hardware: PC Windows XP
: P2 major with 2 votes (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks: 52737
  Show dependency tree
 
Reported: 2011-12-07 06:16 UTC by akilg
Modified: 2015-11-09 00:44 UTC (History)
1 user (show)



Attachments
bullets overlap the text in slide image (60.91 KB, image/png)
2011-12-07 06:16 UTC, akilg
Details
orginal slide image (124.79 KB, image/png)
2011-12-07 06:20 UTC, akilg
Details
Here is a similar ppt file producing the same rendering artifacts (222.50 KB, application/vnd.ms-powerpoint)
2012-11-14 21:43 UTC, Jared
Details

Note You need to log in before you can comment on or make changes to this bug.
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 ...)