waterWang opened a new pull request, #1192:
URL: https://github.com/apache/poi/pull/1192

   ## Description
   
   When `clearText()` is called on a text shape (e.g., `XSLFTextBox`), it 
removes all paragraphs from the `CTTextBody`. If the shape is saved without 
adding new content, the resulting OOXML document is invalid because the OOXML 
spec requires at least one paragraph in a text body.
   
   ## Fix
   
   After clearing all paragraphs, add a default empty paragraph to ensure the 
XML remains valid. This allows `clearText()` to be used safely without 
immediately adding new content.
   
   ## Test
   
   Added `testClearTextWithEmptyParagraph()` that:
   1. Creates a slide with a text box
   2. Calls `clearText()`
   3. Saves and re-reads the presentation
   4. Verifies the shape has at least one empty paragraph
   5. Verifies the text is empty string
   
   Fixes #919


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to