Bug 63558 - XSLFTextParagraph leaves first line blank in cell in XSLFTableCell
Summary: XSLFTextParagraph leaves first line blank in cell in XSLFTableCell
Status: RESOLVED WORKSFORME
Alias: None
Product: POI
Classification: Unclassified
Component: XSLF (show other bugs)
Version: unspecified
Hardware: Other Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-10 04:30 UTC by Trupti
Modified: 2019-11-17 12:38 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Trupti 2019-07-10 04:30:58 UTC
When XSLFTextParagraph is added to XSLFTableCell and when new TextRun is added to the paragraph, text in the cell starts from second line in the cell. We can see that when PPT is opened. this issue is not letting us utilize vertical space and accommodate more rows.
Comment 1 Andreas Beeker 2019-07-22 22:07:49 UTC
Please add an example - I can't reproduce your issue on the trunk. Tested with Libre Office.



> @Test
> public void bug63558() throws Exception {
>     XMLSlideShow ppt = new XMLSlideShow();
>     XSLFSlide slide = ppt.createSlide();
>     XSLFTable tab = slide.createTable(4,3);
>     tab.setAnchor(new Rectangle2D.Double(50,50,500,500));
>     for (int x=0; x<4; x++) {
>         for (int y=0; y<3; y++) {
>             XSLFTableCell cell = tab.getCell(x, y);
>             // Variant 1
>             // cell.setText("("+x+","+y+")");
>             // Variant 2
>             cell.addNewTextParagraph().addNewTextRun().setText("("+x+","+y+")");
>         }
>     }
>     new DrawTableShape(tab).setAllBorders(2., Color.BLACK, StrokeStyle.LineDash.LG_DASH);
>     try (FileOutputStream fos = new FileOutputStream("blub.pptx")) {
>         ppt.write(fos);
>     }
> }
Comment 2 Dominik Stadler 2019-11-17 12:38:03 UTC
No response in quite some time, so we close this for now, please provide more information if this is still a problem for you.