Bug 68922

Summary: Text with a line break does not import correctly
Product: POI Reporter: Aleksei <alekseyk99>
Component: XSLFAssignee: POI Developers List <dev>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: 5.2.3-FINAL   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: original PPT with line break
difference between original and imported slide

Description Aleksei 2024-04-20 04:00:59 UTC
Created attachment 39676 [details]
original PPT with line break

A slide with text with a line break does not import correctly, 
resulting in a corrupted file that does not open. 
The problem is that the <a:br> tag is replaced with an empty <a:r> tag.

Possible duplicate:
https://bz.apache.org/bugzilla/show_bug.cgi?id=68668

To reproduce:

    InputStream is = new FileInputStream("test line break.pptx");
    XMLSlideShow ppt = new XMLSlideShow(is);
    FileOutputStream out = new FileOutputStream("test line break output.pptx");

    XSLFSlide slide = ppt.getSlides().get(0);
    
    XSLFSlide newSlide = ppt.createSlide();
    newSlide.importContent(slide);
    ppt.write(out);

Result:
 The "test line break output.pptx" file is corrupt.
Comment 1 Aleksei 2024-04-20 04:02:30 UTC
Created attachment 39677 [details]
difference between original and imported slide