Bug 68922 - Text with a line break does not import correctly
Summary: Text with a line break does not import correctly
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: XSLF (show other bugs)
Version: 5.2.3-FINAL
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-20 04:00 UTC by Aleksei
Modified: 2024-04-20 04:02 UTC (History)
0 users



Attachments
original PPT with line break (28.84 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2024-04-20 04:00 UTC, Aleksei
Details
difference between original and imported slide (43.28 KB, image/png)
2024-04-20 04:02 UTC, Aleksei
Details

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