You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2020/01/03 09:37:19 UTC

[Bug 64046] New: shiftRows judge mergedRegions to remove error

https://bz.apache.org/bugzilla/show_bug.cgi?id=64046

            Bug ID: 64046
           Summary: shiftRows judge mergedRegions to remove error
           Product: POI
           Version: 4.1.1-FINAL
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: lin_yueshan@qq.com
  Target Milestone: ---

Created attachment 36944
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36944&action=edit
shift the second row occur error

The method of removalNeeded in abstract class RowShifter exist bug, the
CellRangeAddress of overwrite is defined as "overwrite = new
CellRangeAddress(firstRow, lastRow, 0, 0);". If the delete row's first column
is not a mergedRegion, then all the mergedRegion in the Row will not be
deleted, when to add mergeRegion, will occur IllegalStateException of "Cannot
add merged region " + candidateRegion.formatAsString() + " to sheet because it
overlaps with an existing merged region (" + existingRegion.formatAsString() +
").
My solution: the overwrite CellRangeAddress should be defined as "overwrite =
new CellRangeAddress(firstRow, lastRow, 0, Integer.MAX_VALUE);", then all the
mergedRegion in the deleteRow will be deleted, then can shiftRow successfully.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org