From d090c6b77ab8162b6cd2fcd7f57b67e694a53c68 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Sat, 6 Jul 2024 20:17:22 +0000 Subject: [PATCH] update TestXSSFSheetShiftRows git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1918978 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/xssf/usermodel/TestXSSFSheetShiftRows.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java index dd87c6577d..37ea899237 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFSheetShiftRows.java @@ -539,12 +539,17 @@ public final class TestXSSFSheetShiftRows extends BaseTestSheetShiftRows { } final int firstCol = 1; final int secondCol = firstCol + 1; + final int thirdCol = secondCol + 1; sheet.addMergedRegion(new CellRangeAddress(0, 0, firstCol, secondCol)); sheet.addMergedRegion(new CellRangeAddress(1, 2, firstCol, firstCol)); - sheet.addMergedRegion(new CellRangeAddress(3, 3, firstCol, secondCol)); + sheet.addMergedRegion(new CellRangeAddress(3, 3, secondCol, thirdCol)); assertEquals(3, sheet.getNumMergedRegions()); sheet.shiftColumns(2, 5, -1); - // assertEquals(2, sheet.getNumMergedRegions()); + // only the 3rd merged region should remain + assertEquals(1, sheet.getNumMergedRegions()); + CellRangeAddress mr = sheet.getMergedRegion(0); + CellRangeAddress expectedMR = new CellRangeAddress(3, 3, secondCol - 1, thirdCol - 1); + assertEquals(expectedMR, mr); } } } -- 2.39.5