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

            Bug ID: 69154
           Summary: Shifting columns with merged regions generates an
                    error about overlapping regions
           Product: POI
           Version: 5.2.2-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: jesper.jorgen...@tungstenautomation.com
  Target Milestone: ---

Created attachment 39788
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=39788&action=edit
Unit Test file that shows the error

In some cases where an Excel document contains merged region shifting columns
to the left generates an error of the form (region here are just examples):

Cannot add merged region E2:E3 to sheet because it overlaps with an existing
merged region (D2:E2).

The attached Java class demonstrate the bug. It works fine with the merged
regions at row 1 (index 0), but inserting a row above the region makes it fail.

The error is in ColumnShifter line 117:

overwrite = new CellRangeAddress(0, 0, firstCol, lastCol);

where it should be: 

overwrite = new CellRangeAddress(merged.getFirstRow(), merged.getLastRow(),
firstCol, lastCol);

a similar error occurs in line 112. The problem is that it always refers to the
first row (0) in the sheet and not to the the first row of the merged region.

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

Reply via email to