Inserting paragraph into table from cursor

Anton Oellerer <[email protected]> Wed, 5 Oct 2022 17:18:02 +0000
Newsgroups gmane.comp.jakarta.poi.user
Message-ID <AS4PR09MB568355AD37A934772C425B46AB5D9@AS4PR09MB5683.eurprd09.prod.outlook.com>
Hello,
I am currently trying to insert a xwpf paragraph into a table with a cursor retrieved from another paragraph in the cell.
When inserting text into the xwpf document outside of tables, the following code works flawlessly:
document.insertNewParagraph(xwpfParagraph.getCTP().newCursor()))​
If the xwpfParagraph​ is inside of a table though, `xwpfParagraph.getCTP().newCursor()` returns a cursor to the paragraph, but `document.insertNewParagraph(...)` returns null​, since
the internal isCursorInBody​ check fails.
I do not know whether this is a bug or intended, but do you know how to achieve my goal correctly?
Best regards
Anton Oellerer
Junior Backend Developer

[cid:cda474d9-071c-46ac-bd9b-6b23e9a77df6]
docu tools GmbH • Gatterburggasse 5 • 1190 Wien

T +43 1 890 32 27 27 • [email protected]<mailto:[email protected]> • www.docu-tools.com<https://www.docu-tools.com/>

FN 531024v HG Wien • UID Nr. ATU75458238