https://bz.apache.org/bugzilla/show_bug.cgi?id=68922

--- Comment #2 from Adam <adam.csiszar...@gmail.com> ---
Just encountered the same issue, and can confirm, the issue is the br
conversion to empty run.

Can fix this specific issue manually, but something is still odd. Comparing the
resultant slide xmls, there is no much difference, but the line breaks have a
font size of 18, while the rest of the text have 10. What we've seen is that
the <a:defRPr> tag is missing. We are using version 5.3.0.

And here is the code that we used to convert the empty runs back to line break
tags:

        final var newSlide =
result.createSlide(slide.getSlideLayout()).importContent(slide);

        newSlide.getXmlObject().getCSld().getSpTree().getSpList()
                        .stream()
                        .map(CTShape::getTxBody)
                        .filter(Objects::nonNull)
                        .flatMap(txBody -> txBody.getPList().stream())
                        .forEach(p -> {
                                final var invalidRuns = p.getRList()
                                                .stream()
                                                .filter(r -> r.xgetT() == null
|| Strings.isNullOrEmpty(r.getT()))
                                               
.collect(Collectors.toCollection(LinkedList::new));

                                while (!invalidRuns.isEmpty()) {
                                        try (final var cursorToInvalid =
invalidRuns.pop().newCursor()) {
                                                cursorToInvalid.removeXml();

                                                try (final var cursorToBR =
p.addNewBr().newCursor()) {
                                                       
cursorToBR.moveXml(cursorToInvalid);
                                                }
                                        }
                                }
                        });

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to