Bug 60384

Summary: ShiftRows unexpected deletion of mergedRegions (due to 59740)
Product: POI Reporter: Fabio <fabio.heer>
Component: SS CommonAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: regression CC: david.leniniven, yuwun
Priority: P2    
Version: 3.15-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Bug Depends on: 59740    
Bug Blocks: 56454    
Attachments: Template for use case

Description Fabio 2016-11-16 16:46:32 UTC
Created attachment 34455 [details]
Template for use case

Due to https://bz.apache.org/bugzilla/show_bug.cgi?id=59740 merged regions are disappearing even when no overlap was created.

Typical use case:
You have a template like attached with a merged region in row 9.
Row 3 is "template-row":
1. It either gets removed (no prameter)
2. Or it gets filled with just 1 parameter
3. Or it gets duplicated and filled for each parameter

Since I have to add or remove rows with sheet.shiftRows(3, sheet.getLastRowNum(), n), the merged region in row 9 simply gets deleted.

Merged regions that do not create an overlap with another merged region should not be deleted just like that. I expect the merged region to shift just like it did in POI < 3.15
Comment 1 Dominik Stadler 2017-08-19 15:34:27 UTC
*** Bug 60709 has been marked as a duplicate of this bug. ***
Comment 2 Dominik Stadler 2017-08-19 16:34:36 UTC
This should be fixed again via r1805518, we now check differently if the merged reagion is overwritten or moved along by the shifting, this should make these cases work better.

Please note that there is discussion about a more complete implementation of handling of merged regions in bug #56454.
Comment 3 Dominik Stadler 2017-08-19 16:38:27 UTC
*** Bug 61163 has been marked as a duplicate of this bug. ***