Bug 58618 - [PATCH] XWPFParagraph insertNewRun and removeRun work incorrectly for runs after hyperlink/field runs..
Summary: [PATCH] XWPFParagraph insertNewRun and removeRun work incorrectly for runs af...
Alias: None
Product: POI
Classification: Unclassified
Component: XWPF (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Keywords: PatchAvailable
Depends on:
Reported: 2015-11-16 23:41 UTC by Mark Bortolazzo
Modified: 2016-01-01 16:29 UTC (History)
0 users

PATCH (8.83 KB, application/x-gtar)
2015-11-16 23:54 UTC, Mark Bortolazzo

Note You need to log in before you can comment on or make changes to this bug.
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]
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.