Bug 58618

Summary: [PATCH] XWPFParagraph insertNewRun and removeRun work incorrectly for runs after hyperlink/field runs..
Product: POI Reporter: Mark Bortolazzo <mb_apache>
Component: XWPFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal Keywords: PatchAvailable
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: PATCH

Description Mark Bortolazzo 2015-11-16 23:41:04 UTC
When XWPFParagraph is created any runs in Hyperlinks and Fields are added into the runs/iruns lists.  When these runs are removed/inserted the index on the base base R list is different to the index on the runs/iruns list.

This means runs after a hyperlink/field run can't be manipulated properly.

We need to calculate the correct position in the R list based on the run list which contains R runs plus hyperlink/field runs.
Comment 1 Mark Bortolazzo 2015-11-16 23:54:01 UTC
Created attachment 33280 [details]
PATCH
Comment 2 Dominik Stadler 2016-01-01 16:29:10 UTC
Thanks for the patch! It should be applied now via r1722503, removeRun() already seems to take this into account correctly.