poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From one...@apache.org
Subject svn commit: r1748829 - /poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
Date Fri, 17 Jun 2016 10:22:10 GMT
Author: onealj
Date: Fri Jun 17 10:22:09 2016
New Revision: 1748829

URL: http://svn.apache.org/viewvc?rev=1748829&view=rev
Log:
bug 56958: validate array formulas wasn't correctly checking for overlap with a merged region

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java?rev=1748829&r1=1748828&r2=1748829&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java Fri Jun 17 10:22:09
2016
@@ -395,10 +395,7 @@ public class XSSFSheet extends POIXMLDoc
 
                 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);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message