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

            Bug ID: 60709
           Summary: shiftRows removes merged regions if shifting several
                    rows in one call
           Product: POI
           Version: 3.15-FINAL
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: SS Common
          Assignee: dev@poi.apache.org
          Reporter: david.lenini...@amalto.com
  Target Milestone: ---

Created attachment 34734
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34734&action=edit
File with 2 merged cells

The shiftRows method works as expected if we shift only one row at a time, but
if we try to shift several rows in a single call, it removes all merged areas
that belong to the shifted rows.

For instance, if we have a Xlsx document (cf attachment) with 2 merged cells
A3:B3
Assuming lastRowNum = sheet.getLastRowNum();

Executing the following code will removed this merged region : 

sheet.shiftRows(1, lastRowNum+1, -1, true, false);

Whereas the following code will "move" the merged region into A2:B2 as expected

for(int currentRow = 1; currentRow <=lastRowNum+1; currentRow++) {
    sheet.shiftRows(currentRow, currentRow, -1, true, false);
}

-- 
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