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

   Follow-up to #971 (bug 66263).
   
   #971 also changed `XWPFParagraph`: runs inside an inline content control 
(`w:sdt`) were added to `getRuns()`, but only when they had `rPr`, and they 
were not added to `getIRuns()`. This causes problems:
   
   - `getRuns()` indexes shift for existing documents. `[r1, sdt(r2), r3]` used 
to give `[r1, r3]` and now gives `[r1, r2, r3]`.
   - `insertNewRun(pos)` (and the hyperlink/field versions) returns `null` when 
`pos` hits an SDT run, because that run's parent is not the paragraph.
   - Whether an SDT run appears in `getRuns()` depends on whether it has 
formatting.
   - The `CTSdtBlock` branch can never fire inside a `w:p`.
   
   This PR removes that part. SDT runs can still be reached via the `XWPFSDT` 
in `getIRuns()` and `XWPFSDTContent.getBodyElements()`. The table support for 
SDT rows from #971 is unchanged.
   
   It also replaces `XWPFTable.hasSdtRows` (a cursor scan) with 
`CTTbl.sizeOfSdtArray()`.
   
   Tests: rewrote the #971 paragraph tests to assert exact runs and text, and 
added `testInsertNewRunNextToSdtRun`.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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