aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java')
-rw-r--r--src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java
index ca69fa6266..9c3ca693ad 100644
--- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java
+++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestWorkbook.java
@@ -448,7 +448,7 @@ public abstract class BaseTestWorkbook {
sheet.createRow(0).createCell(0).setCellValue("Test");
sheet.createRow(1).createCell(0).setCellValue(36.6);
sheet.addMergedRegion(new CellRangeAddress(0, 1, 0, 2));
- sheet.addMergedRegion(new CellRangeAddress(1, 2, 0, 2));
+ sheet.addMergedRegion(new CellRangeAddress(2, 3, 0, 2));
assertTrue(sheet.isSelected());
Sheet clonedSheet = book.cloneSheet(0);
@@ -457,16 +457,16 @@ public abstract class BaseTestWorkbook {
assertEquals(2, clonedSheet.getNumMergedRegions());
assertFalse(clonedSheet.isSelected());
- //cloned sheet is a deep copy, adding rows in the original does not affect the clone
+ //cloned sheet is a deep copy, adding rows or merged regions in the original does not affect the clone
sheet.createRow(2).createCell(0).setCellValue(1);
- sheet.addMergedRegion(new CellRangeAddress(0, 2, 0, 2));
- assertEquals(2, clonedSheet.getPhysicalNumberOfRows());
+ sheet.addMergedRegion(new CellRangeAddress(4, 5, 0, 2));
assertEquals(2, clonedSheet.getPhysicalNumberOfRows());
+ assertEquals(2, clonedSheet.getNumMergedRegions());
clonedSheet.createRow(2).createCell(0).setCellValue(1);
- clonedSheet.addMergedRegion(new CellRangeAddress(0, 2, 0, 2));
- assertEquals(3, clonedSheet.getPhysicalNumberOfRows());
+ clonedSheet.addMergedRegion(new CellRangeAddress(6, 7, 0, 2));
assertEquals(3, clonedSheet.getPhysicalNumberOfRows());
+ assertEquals(3, clonedSheet.getNumMergedRegions());
}