https://bz.apache.org/bugzilla/show_bug.cgi?id=66312
Bug ID: 66312
Summary: Inserting paragraph into table from cursor
Product: POI
Version: 5.2.2-FINAL
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: XWPF
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Hello
I am trying to insert a paragraph next to another paragraph (`xwpfParagraph`)
in a table in the following way:
1. `XmlCursor cursor = xwpfParagraph.getCTP().newCursor()`
2. `XWPFParagraph paragraph = document.insertNewParagraph(cursor)`
Expectation:
`paragraph` contains a valid `XWPFParagraph`
Reality:
`paragraph` is `null`
This happens because the `XWPFDocument#insertNewParagraph` function checks the
validity of the cursor (in the `XWPFDocument#isCursorInBody` function) by
asserting that the parent of the `cursor` is the document`s body.
This is not the case in the example above, as the parent is the table, and only
the parent of the table is the document body.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]