mirror of https://github.com/apache/poi.git
bug 56958: validate array formulas wasn't correctly checking for overlap with a merged region
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1748829 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3f4d479b13
commit
f4948c2d14
|
@ -395,10 +395,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
|
|||
|
||||
if(cell.isPartOfArrayFormulaGroup()){
|
||||
CellRangeAddress arrayRange = cell.getArrayFormulaRange();
|
||||
if (arrayRange.getNumberOfCells() > 1 &&
|
||||
// region.intersects(arrayRange) is more concise and probably correct. Is it equivalent?
|
||||
( arrayRange.isInRange(region.getFirstRow(), region.getFirstColumn()) ||
|
||||
arrayRange.isInRange(region.getFirstRow(), region.getFirstColumn())) ){
|
||||
if (arrayRange.getNumberOfCells() > 1 && region.intersects(arrayRange)) {
|
||||
String msg = "The range " + region.formatAsString() + " intersects with a multi-cell array formula. " +
|
||||
"You cannot merge cells of an array.";
|
||||
throw new IllegalStateException(msg);
|
||||
|
|
Loading…
Reference in New Issue